Skip to content

Commit

Permalink
fix typos in boundary conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenwu0728 committed Dec 8, 2024
1 parent 0497814 commit 3d779de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/Fields/apply_bcs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
##### apply flux boundary conditions to tracer tendency `Gc`
#####

# a positive west flux is associated with an *increase* in `Gc` near the west boundary.
# same for south and bottom.
# positive west/south/bottom bc values are associated with an *increase* in `Gc` near the boundary.
@kernel function apply_west_bcs_kernel!(Gc, grid, west_bc, iter, ΔT)
j, k = @index(Global, NTuple)
jj = j + grid.Hy
Expand All @@ -25,8 +24,7 @@ end
@inbounds Gc[ii, jj, grid.Nz+grid.Hz] += getbc(bottom_bc, i, j, iter) * ΔT * Az(ii, jj, grid.Nz+grid.Hz, grid) / volume(ii, jj, grid.Nz+grid.Hz, grid)
end

# a positive east flux is associated with an *decrease* in `Gc` near the east boundary.
# same for north and top.
# positive east/north/top bc values are associated with a *decrease* in `Gc` near the boundary.
@kernel function apply_east_bcs_kernel!(Gc, grid, east_bc, iter, ΔT)
j, k = @index(Global, NTuple)
jj = j + grid.Hy
Expand Down
4 changes: 2 additions & 2 deletions src/Fields/boundary_conditions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ function validate_bc(bc, bc_size, nΔT)
if size(bc) == bc_size
return nothing
else
throw(ArgumentError("BC west: grid mismatch, size(bc) must equal to $(bc_size) for a constant flux boundary condition."))
throw(ArgumentError("BC: grid mismatch, size(bc) must equal to $(bc_size) for a constant flux boundary condition."))
end
end
if typeof(bc) <: AbstractArray{eltype(bc),3}
if size(bc) == (bc_size..., nΔT)
return nothing
else
throw(ArgumentError("BC west: grid mismatch, size(bc) must equal to $((bc_size..., nΔT)) for a time-dependent flux boundary condition."))
throw(ArgumentError("BC: grid mismatch, size(bc) must equal to $((bc_size..., nΔT)) for a time-dependent flux boundary condition."))
end
end
end
Expand Down

0 comments on commit 3d779de

Please sign in to comment.