Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More informative message when user provides smaller halo size than ImmersedBoundraryGrid requires #2984

Merged
merged 3 commits into from
Mar 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/Fields/regridding_fields.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ const c = Center()

Regrid field `b` onto the grid of field `a`.

!!! warning "Functionality limitation"
Currently `regrid!` only regrids in the vertical ``z`` direction and works only on
fields that have data only in ``z`` direction.

Example
=======

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,14 @@ validate_momentum_advection(momentum_advection, grid::AbstractHorizontallyCurvil
validate_momentum_advection(momentum_advection::Union{VectorInvariant, Nothing}, grid::AbstractHorizontallyCurvilinearGrid) = momentum_advection

function validate_model_halo(grid, momentum_advection, tracer_advection, closure)
user_halo = halo_size(grid)
required_halo = inflate_halo_size(1, 1, 1, grid,
momentum_advection,
tracer_advection,
closure)

any(user_halo .< required_halo) &&
throw(ArgumentError("The grid halo $user_halo must be at least equal to $required_halo. Note that an ImmersedBoundaryGrid requires an extra halo point."))
user_halo = halo_size(grid)
required_halo = inflate_halo_size(1, 1, 1, grid,
momentum_advection,
tracer_advection,
closure)

any(user_halo .< required_halo) &&
throw(ArgumentError("The grid halo $user_halo must be at least equal to $required_halo. Note that an ImmersedBoundaryGrid requires an extra halo point in all non-flat directions compared to a non-immersed boundary grid."))
end

initialize_model!(model::HydrostaticFreeSurfaceModel) = initialize_free_surface!(model.free_surface, model.grid, model.velocities)
Expand Down
2 changes: 1 addition & 1 deletion src/Models/NonhydrostaticModels/nonhydrostatic_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ function inflate_grid_halo_size(grid, tendency_terms...)

if any(user_halo .< required_halo) # Replace grid
@warn "Inflating model grid halo size to ($Hx, $Hy, $Hz) and recreating grid. " *
"Note that an ImmersedBoundaryGrid requires an extra halo point. "
"Note that an ImmersedBoundaryGrid requires an extra halo point in all non-flat directions compared to a non-immersed boundary grid."
"The model grid will be different from the input grid. To avoid this warning, " *
"pass halo=($Hx, $Hy, $Hz) when constructing the grid."

Expand Down