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

(0.92.0) Make RungeKutta3 the default time-stepper for NonhydrostaticModel #3580

Merged
merged 44 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
d4db1f2
Make RK3 the default time-stepper for NonhydrostaticModel
glwagner May 5, 2024
50f9c87
Merge remote-tracking branch 'origin/main' into glw/rk3-default
glwagner May 5, 2024
2328b5e
Change regression tests to use AB2
glwagner May 5, 2024
d1dab60
Fix up time stepping tests
glwagner May 5, 2024
c935367
Fix up forcings tests
glwagner May 5, 2024
657512e
Fix more tests
glwagner May 5, 2024
1a8c14f
Fix docstrings
glwagner May 6, 2024
df6f01a
Fix datetime test but thats weird
glwagner May 6, 2024
3c34501
Fix doctest for seawater density
glwagner May 8, 2024
4300061
update docstring
navidcy May 8, 2024
be1d588
Merge branch 'main' into glw/rk3-default
glwagner May 8, 2024
6789878
Merge branch 'main' into glw/rk3-default
navidcy May 8, 2024
e62329d
Fix docstrings
glwagner May 8, 2024
3aafdd3
Last docstring? famous last words
glwagner May 8, 2024
c847ec6
Merge branch 'main' into glw/rk3-default
glwagner May 8, 2024
19ed053
Merge branch 'main' into glw/rk3-default
glwagner May 20, 2024
23d7c0b
Merge branch 'main' into glw/rk3-default
glwagner May 30, 2024
c6f2e58
Merge branch 'main' into glw/rk3-default
navidcy Jul 11, 2024
bd6d16b
Merge branch 'main' into glw/rk3-default
navidcy Aug 27, 2024
0a5627e
Merge branch 'main' into glw/rk3-default
glwagner Aug 27, 2024
fec957c
Test AB2 for date tests now
glwagner Aug 28, 2024
440b142
Use AB2 for time-stepping tests
glwagner Aug 28, 2024
77143a9
Merge branch 'main' into glw/rk3-default
glwagner Aug 28, 2024
70bdb26
Merge branch 'main' into glw/rk3-default
glwagner Sep 7, 2024
50caa71
Update time stepper tests
glwagner Sep 8, 2024
52731ea
Use AB2 for netcdf tests
glwagner Sep 8, 2024
7ff075a
Merge branch 'main' into glw/rk3-default
glwagner Sep 18, 2024
4442989
Update NetCDF test to AB2
glwagner Sep 18, 2024
ed5846e
Update another NetCDF test to AB2
glwagner Sep 19, 2024
1936d62
Merge branch 'main' into glw/rk3-default
glwagner Sep 21, 2024
500b69c
Bump to new version
glwagner Sep 21, 2024
141460f
Merge branch 'main' into glw/rk3-default
navidcy Sep 22, 2024
95684e9
Just cosmetic stuff
glwagner Sep 23, 2024
09a06d6
More cosmetic upgrades
glwagner Sep 24, 2024
1de1d00
oops
glwagner Sep 25, 2024
e94ffe3
FT -> Ft
navidcy Sep 25, 2024
cbf216e
Merge branch 'main' into glw/rk3-default
glwagner Sep 25, 2024
8a3d117
Fix eulers
glwagner Sep 26, 2024
6b1796c
Update pipeline.yml
glwagner Sep 26, 2024
1542dbd
Merge branch 'main' into glw/rk3-default
glwagner Sep 26, 2024
ca9ec32
Merge branch 'main' into glw/rk3-default
glwagner Sep 27, 2024
0767427
Merge branch 'main' into glw/rk3-default
glwagner Sep 28, 2024
e7a826e
Merge branch 'main' into glw/rk3-default
navidcy Sep 28, 2024
acbed75
Merge branch 'main' into glw/rk3-default
glwagner Sep 29, 2024
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
8 changes: 8 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ steps:
agents:
queue: Oceananigans
architecture: GPU
retry:
automatic:
- exit_status: 1
limit: 1

- label: "🏕️ initialize cpu environment"
key: "init_cpu"
Expand All @@ -38,6 +42,10 @@ steps:
agents:
queue: Oceananigans
architecture: CPU
retry:
automatic:
- exit_status: 1
limit: 1

#####
##### Unit tests
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Oceananigans"
uuid = "9e8cae18-63c1-5223-a75c-80ca9d6e9a09"
authors = ["Climate Modeling Alliance and contributors"]
version = "0.91.15"
version = "0.92.0"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
4 changes: 2 additions & 2 deletions docs/src/model_setup/boundary_conditions.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ julia> no_slip_field_bcs = FieldBoundaryConditions(no_slip_bc);
julia> model = NonhydrostaticModel(; grid, boundary_conditions=(u=no_slip_field_bcs, v=no_slip_field_bcs, w=no_slip_field_bcs))
NonhydrostaticModel{CPU, RectilinearGrid}(time = 0 seconds, iteration = 0)
├── grid: 16×16×16 RectilinearGrid{Float64, Periodic, Bounded, Bounded} on CPU with 3×3×3 halo
├── timestepper: QuasiAdamsBashforth2TimeStepper
├── timestepper: RungeKutta3TimeStepper
├── advection scheme: Centered reconstruction order 2
├── tracers: ()
├── closure: Nothing
Expand Down Expand Up @@ -404,7 +404,7 @@ julia> c_bcs = FieldBoundaryConditions(top = ValueBoundaryCondition(20.0),
julia> model = NonhydrostaticModel(grid=grid, boundary_conditions=(u=u_bcs, c=c_bcs), tracers=:c)
NonhydrostaticModel{CPU, RectilinearGrid}(time = 0 seconds, iteration = 0)
├── grid: 16×16×16 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 3×3×3 halo
├── timestepper: QuasiAdamsBashforth2TimeStepper
├── timestepper: RungeKutta3TimeStepper
├── advection scheme: Centered reconstruction order 2
├── tracers: c
├── closure: Nothing
Expand Down
12 changes: 6 additions & 6 deletions docs/src/model_setup/buoyancy_and_equation_of_state.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ julia> grid = RectilinearGrid(size=(8, 8, 8), extent=(1, 1, 1));
julia> model = NonhydrostaticModel(; grid, buoyancy=nothing)
NonhydrostaticModel{CPU, RectilinearGrid}(time = 0 seconds, iteration = 0)
├── grid: 8×8×8 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 3×3×3 halo
├── timestepper: QuasiAdamsBashforth2TimeStepper
├── timestepper: RungeKutta3TimeStepper
├── advection scheme: Centered reconstruction order 2
├── tracers: ()
├── closure: Nothing
Expand All @@ -43,7 +43,7 @@ The option `buoyancy = nothing` is the default for [`NonhydrostaticModel`](@ref)
julia> model = NonhydrostaticModel(; grid)
NonhydrostaticModel{CPU, RectilinearGrid}(time = 0 seconds, iteration = 0)
├── grid: 8×8×8 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 3×3×3 halo
├── timestepper: QuasiAdamsBashforth2TimeStepper
├── timestepper: RungeKutta3TimeStepper
├── advection scheme: Centered reconstruction order 2
├── tracers: ()
├── closure: Nothing
Expand Down Expand Up @@ -77,7 +77,7 @@ a buoyancy tracer by including `:b` in `tracers` and specifying `buoyancy = Buo
julia> model = NonhydrostaticModel(; grid, buoyancy=BuoyancyTracer(), tracers=:b)
NonhydrostaticModel{CPU, RectilinearGrid}(time = 0 seconds, iteration = 0)
├── grid: 8×8×8 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 3×3×3 halo
├── timestepper: QuasiAdamsBashforth2TimeStepper
├── timestepper: RungeKutta3TimeStepper
├── advection scheme: Centered reconstruction order 2
├── tracers: b
├── closure: Nothing
Expand Down Expand Up @@ -118,7 +118,7 @@ S.I. units ``\text{m}\,\text{s}^{-2}``) and requires to add `:T` and `:S` as tra
julia> model = NonhydrostaticModel(; grid, buoyancy=SeawaterBuoyancy(), tracers=(:T, :S))
NonhydrostaticModel{CPU, RectilinearGrid}(time = 0 seconds, iteration = 0)
├── grid: 8×8×8 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 3×3×3 halo
├── timestepper: QuasiAdamsBashforth2TimeStepper
├── timestepper: RungeKutta3TimeStepper
├── advection scheme: Centered reconstruction order 2
├── tracers: (T, S)
├── closure: Nothing
Expand Down Expand Up @@ -157,7 +157,7 @@ SeawaterBuoyancy{Float64}:
julia> model = NonhydrostaticModel(; grid, buoyancy, tracers=(:T, :S))
NonhydrostaticModel{CPU, RectilinearGrid}(time = 0 seconds, iteration = 0)
├── grid: 8×8×8 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 3×3×3 halo
├── timestepper: QuasiAdamsBashforth2TimeStepper
├── timestepper: RungeKutta3TimeStepper
├── advection scheme: Centered reconstruction order 2
├── tracers: (T, S)
├── closure: Nothing
Expand Down Expand Up @@ -238,7 +238,7 @@ Buoyancy:
julia> model = NonhydrostaticModel(; grid, buoyancy, tracers=:b)
NonhydrostaticModel{CPU, RectilinearGrid}(time = 0 seconds, iteration = 0)
├── grid: 8×8×8 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 3×3×3 halo
├── timestepper: QuasiAdamsBashforth2TimeStepper
├── timestepper: RungeKutta3TimeStepper
├── advection scheme: Centered reconstruction order 2
├── tracers: b
├── closure: Nothing
Expand Down
2 changes: 1 addition & 1 deletion docs/src/model_setup/lagrangian_particles.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ model = NonhydrostaticModel(grid=grid, particles=lagrangian_particles)
# output
NonhydrostaticModel{CPU, RectilinearGrid}(time = 0 seconds, iteration = 0)
├── grid: 10×10×10 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 3×3×3 halo
├── timestepper: QuasiAdamsBashforth2TimeStepper
├── timestepper: RungeKutta3TimeStepper
├── advection scheme: Centered reconstruction order 2
├── tracers: ()
├── closure: Nothing
Expand Down
6 changes: 3 additions & 3 deletions docs/src/model_setup/tracers.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ julia> grid = RectilinearGrid(size=(16, 16, 16), extent=(1, 1, 1));
julia> model = NonhydrostaticModel(; grid)
NonhydrostaticModel{CPU, RectilinearGrid}(time = 0 seconds, iteration = 0)
├── grid: 16×16×16 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 3×3×3 halo
├── timestepper: QuasiAdamsBashforth2TimeStepper
├── timestepper: RungeKutta3TimeStepper
├── advection scheme: Centered reconstruction order 2
├── tracers: ()
├── closure: Nothing
Expand All @@ -30,7 +30,7 @@ For example, to add conservative temperature `T` and absolute salinity `S`:
julia> model = NonhydrostaticModel(; grid, tracers=(:T, :S))
NonhydrostaticModel{CPU, RectilinearGrid}(time = 0 seconds, iteration = 0)
├── grid: 16×16×16 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 3×3×3 halo
├── timestepper: QuasiAdamsBashforth2TimeStepper
├── timestepper: RungeKutta3TimeStepper
├── advection scheme: Centered reconstruction order 2
├── tracers: (T, S)
├── closure: Nothing
Expand Down Expand Up @@ -65,7 +65,7 @@ An arbitrary number of tracers may be simulated. For example, to simulate
julia> model = NonhydrostaticModel(; grid, tracers=(:T, :S, :C₁, :CO₂, :nitrogen))
NonhydrostaticModel{CPU, RectilinearGrid}(time = 0 seconds, iteration = 0)
├── grid: 16×16×16 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 3×3×3 halo
├── timestepper: QuasiAdamsBashforth2TimeStepper
├── timestepper: RungeKutta3TimeStepper
├── advection scheme: Centered reconstruction order 2
├── tracers: (T, S, C₁, CO₂, nitrogen)
├── closure: Nothing
Expand Down
2 changes: 1 addition & 1 deletion docs/src/simulation_tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ julia> grid = RectilinearGrid(GPU(); size=(1, 1, 1), extent=(1, 1, 1), halo=(1,
julia> model = NonhydrostaticModel(; grid)
NonhydrostaticModel{GPU, RectilinearGrid}(time = 0 seconds, iteration = 0)
├── grid: 1×1×1 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on GPU with 1×1×1 halo
├── timestepper: QuasiAdamsBashforth2TimeStepper
├── timestepper: RungeKutta3TimeStepper
├── tracers: ()
├── closure: Nothing
├── buoyancy: Nothing
Expand Down
2 changes: 1 addition & 1 deletion src/BuoyancyModels/buoyancy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ model = NonhydrostaticModel(; grid, buoyancy, tracers=:b)

NonhydrostaticModel{CPU, RectilinearGrid}(time = 0 seconds, iteration = 0)
├── grid: 1×8×8 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 1×3×3 halo
├── timestepper: QuasiAdamsBashforth2TimeStepper
├── timestepper: RungeKutta3TimeStepper
├── advection scheme: Centered reconstruction order 2
├── tracers: b
├── closure: Nothing
Expand Down
6 changes: 3 additions & 3 deletions src/Models/NonhydrostaticModels/nonhydrostatic_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ end
closure = nothing,
boundary_conditions::NamedTuple = NamedTuple(),
tracers = (),
timestepper = :QuasiAdamsBashforth2,
timestepper = :RungeKutta3,
background_fields::NamedTuple = NamedTuple(),
particles::ParticlesOrNothing = nothing,
biogeochemistry::AbstractBGCOrNothing = nothing,
Expand Down Expand Up @@ -95,7 +95,7 @@ Keyword arguments
- `tracers`: A tuple of symbols defining the names of the modeled tracers, or a `NamedTuple` of
preallocated `CenterField`s.
- `timestepper`: A symbol that specifies the time-stepping method. Either `:QuasiAdamsBashforth2` or
`:RungeKutta3`.
`:RungeKutta3` (default).
- `background_fields`: `NamedTuple` with background fields (e.g., background flow). Default: `nothing`.
- `particles`: Lagrangian particles to be advected with the flow. Default: `nothing`.
- `biogeochemistry`: Biogeochemical model for `tracers`.
Expand All @@ -121,7 +121,7 @@ function NonhydrostaticModel(; grid,
closure = nothing,
boundary_conditions::NamedTuple = NamedTuple(),
tracers = (),
timestepper = :QuasiAdamsBashforth2,
timestepper = :RungeKutta3,
background_fields::NamedTuple = NamedTuple(),
particles::ParticlesOrNothing = nothing,
biogeochemistry::AbstractBGCOrNothing = nothing,
Expand Down
2 changes: 1 addition & 1 deletion src/Models/seawater_density.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ SeawaterBuoyancy{Float64}:
julia> model = NonhydrostaticModel(; grid, buoyancy, tracers)
NonhydrostaticModel{CPU, RectilinearGrid}(time = 0 seconds, iteration = 0)
├── grid: 1×1×100 RectilinearGrid{Float64, Flat, Flat, Bounded} on CPU with 0×0×3 halo
├── timestepper: QuasiAdamsBashforth2TimeStepper
├── timestepper: RungeKutta3TimeStepper
├── advection scheme: Centered reconstruction order 2
├── tracers: (T, S)
├── closure: Nothing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function run_ocean_large_eddy_simulation_regression_test(arch, grid_type, closur

# Model instantiation
model = NonhydrostaticModel(; grid, closure,
timestepper = :QuasiAdamsBashforth2,
coriolis = FPlane(f=1e-4),
buoyancy = SeawaterBuoyancy(; equation_of_state),
tracers = (:T, :S),
Expand Down
1 change: 1 addition & 0 deletions test/regression_tests/rayleigh_benard_regression_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ function run_rayleigh_benard_regression_test(arch, grid_type)
bottom = BoundaryCondition(Value(), Δb))

model = NonhydrostaticModel(; grid,
timestepper = :QuasiAdamsBashforth2,
closure = ScalarDiffusivity(ν=ν, κ=κ),
tracers = (:b, :c),
buoyancy = Buoyancy(model=BuoyancyTracer()),
Expand Down
1 change: 1 addition & 0 deletions test/regression_tests/thermal_bubble_regression_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function run_thermal_bubble_regression_test(arch, grid_type)
closure = ScalarDiffusivity(ν=4e-2, κ=4e-2)

model = NonhydrostaticModel(; grid, closure,
timestepper = :QuasiAdamsBashforth2,
coriolis = FPlane(f=1e-4),
buoyancy = SeawaterBuoyancy(),
hydrostatic_pressure_anomaly = CenterField(grid),
Expand Down
12 changes: 7 additions & 5 deletions test/test_boundary_conditions_integration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function test_boundary_condition(arch, FT, topo, side, field_name, boundary_cond
buoyancy=SeawaterBuoyancy(), tracers=(:T, :S))

success = try
time_step!(model, 1e-16, euler=true)
navidcy marked this conversation as resolved.
Show resolved Hide resolved
time_step!(model, 1e-16)
true
catch err
@warn "test_boundary_condition errored with " * sprint(showerror, err)
Expand Down Expand Up @@ -61,10 +61,12 @@ function fluxes_with_diffusivity_boundary_conditions_are_correct(arch, FT)
κₑ_bcs = FieldBoundaryConditions(grid, (Center, Center, Center), bottom=ValueBoundaryCondition(κ₀))
model_bcs = (b=buoyancy_bcs, κₑ=(b=κₑ_bcs,))

model = NonhydrostaticModel(
grid=grid, tracers=:b, buoyancy=BuoyancyTracer(),
closure=AnisotropicMinimumDissipation(), boundary_conditions=model_bcs
)
model = NonhydrostaticModel(; grid,
timestepper = :QuasiAdamsBashforth2,
tracers = :b,
buoyancy = BuoyancyTracer(),
closure = AnisotropicMinimumDissipation(),
boundary_conditions = model_bcs)

b₀(x, y, z) = z * bz
set!(model, b=b₀)
Expand Down
Loading