CliMA / Oceananigans.jl

🌊 Julia software for fast, friendly, flexible, ocean-flavored fluid dynamics on CPUs and GPUs
https://clima.github.io/OceananigansDocumentation/stable
MIT License
927 stars 188 forks source link

Halo inflation + restriction on halo size makes it impossible to run some problems #3622

Open glwagner opened 1 month ago

glwagner commented 1 month ago

For example,

using Oceananigans

grid = RectilinearGrid(size = (16, 1, 16),
                       x = (0, 1),
                       y = (0, 1),
                       z = (0, 1),
                       topology = (Periodic, Periodic, Bounded))

model = NonhydrostaticModel(; grid, advection = WENO(order=5))

errors with

julia> include("problem.jl")
┌ Warning: Inflating model grid halo size to (3, 3, 3) and recreating grid. Note that an ImmersedBoundaryGrid requires an extra halo point in all non-flat directions compared to a non-immersed boundary grid.
└ @ Oceananigans.Models.NonhydrostaticModels ~/.julia/packages/Oceananigans/OHYQj/src/Models/NonhydrostaticModels/nonhydrostatic_model.jl:223
ERROR: LoadError: ArgumentError: halo must be ≤ size for coordinate y

Sad, because I didn't actually ask for a halo (3, 3, 3)! Manually setting things doesn't help:

using Oceananigans

grid = RectilinearGrid(size = (16, 1, 16),
                       halo = (3, 1, 3),
                       x = (0, 1),
                       y = (0, 1),
                       z = (0, 1),
                       topology = (Periodic, Periodic, Bounded))

model = NonhydrostaticModel(; grid, advection = WENO(order=5))

I guess the restriction on the halo size is supposed to be an optimization, but its not working in this case because I can't even set up my model. @navidcy

navidcy commented 1 month ago

okie -- there is definitely something wrong there