From 4e6b1a33e71d472ba9c1397cfbf1aaf0d14a8067 Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Sat, 6 Apr 2024 11:59:39 +0300 Subject: [PATCH 1/4] show advection scheme(s) --- .../show_nonhydrostatic_model.jl | 1 + .../show_shallow_water_model.jl | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Models/NonhydrostaticModels/show_nonhydrostatic_model.jl b/src/Models/NonhydrostaticModels/show_nonhydrostatic_model.jl index 512df4cc16..aefa3f2a94 100644 --- a/src/Models/NonhydrostaticModels/show_nonhydrostatic_model.jl +++ b/src/Models/NonhydrostaticModels/show_nonhydrostatic_model.jl @@ -15,6 +15,7 @@ function Base.show(io::IO, model::NonhydrostaticModel) print(io, summary(model), "\n", "├── grid: ", summary(model.grid), "\n", "├── timestepper: ", TS, "\n", + "├── advection scheme: ", summary(model.advection), "\n", "├── tracers: ", tracernames, "\n", "├── closure: ", closure_summary(model.closure), "\n", "├── buoyancy: ", summary(model.buoyancy), "\n") diff --git a/src/Models/ShallowWaterModels/show_shallow_water_model.jl b/src/Models/ShallowWaterModels/show_shallow_water_model.jl index ade4209708..ce1f7cb7a1 100644 --- a/src/Models/ShallowWaterModels/show_shallow_water_model.jl +++ b/src/Models/ShallowWaterModels/show_shallow_water_model.jl @@ -1,9 +1,25 @@ using Oceananigans.Utils: prettytime """Show the innards of a `Model` in the REPL.""" -Base.show(io::IO, model::ShallowWaterModel{G, A, T}) where {G, A, T} = +function Base.show(io::IO, model::ShallowWaterModel{G, A, T}) where {G, A, T} + TS = nameof(typeof(model.timestepper)) + print(io, "ShallowWaterModel{$(Base.typename(A)), $T}", "(time = $(prettytime(model.clock.time)), iteration = $(model.clock.iteration)) \n", "├── grid: $(summary(model.grid))\n", + "├── timestepper: ", TS, "\n") + + if model.advection !== nothing + print(io, "├── advection scheme: ", "\n") + names = keys(model.advection) + for name in names[1:end-1] + print(io, "│ ├── " * string(name) * ": " * summary(model.advection[name]), "\n") + end + name = names[end] + print(io, "│ └── " * string(name) * ": " * summary(model.advection[name]), "\n") + end + + print(io, "├── tracers: $(tracernames(model.tracers))\n", "└── coriolis: $(typeof(model.coriolis))") +end \ No newline at end of file From fe1f5a758345f5a1bb9f63c7015c98dfaaaac299 Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Sat, 6 Apr 2024 12:38:05 +0300 Subject: [PATCH 2/4] delete empty cubed sphere ci pipelines cubed sphere is tested in MultiRegion atm --- .buildkite/pipeline.yml | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index cf67f0bf59..fabaa5cade 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -423,33 +423,6 @@ steps: architecture: CPU depends_on: "init_cpu" -##### -##### Cubed sphere -##### - - - label: "🐡 gpu cubed sphere tests" - env: - JULIA_DEPOT_PATH: "$SVERDRUP_HOME/.julia-$BUILDKITE_BUILD_NUMBER" - TEST_GROUP: "cubed_sphere" - commands: - - "$SVERDRUP_HOME/julia-$JULIA_VERSION/bin/julia -O0 --color=yes --project -e 'using Pkg; Pkg.test()'" - agents: - queue: Oceananigans - architecture: GPU - depends_on: "init_gpu" - - - label: "🦔 cpu cubed sphere tests" - env: - JULIA_DEPOT_PATH: "$TARTARUS_HOME/.julia-$BUILDKITE_BUILD_NUMBER" - TEST_GROUP: "cubed_sphere" - CUDA_VISIBLE_DEVICES: "-1" - commands: - - "$TARTARUS_HOME/julia-$JULIA_VERSION/bin/julia -O0 --color=yes --project -e 'using Pkg; Pkg.test()'" - agents: - queue: Oceananigans - architecture: CPU - depends_on: "init_cpu" - ##### ##### Multi-Region ##### From a070c6420595fef5350b80c4caf6e39685190f67 Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Sun, 7 Apr 2024 08:07:16 +0300 Subject: [PATCH 3/4] fix doctests --- docs/src/model_setup/boundary_conditions.md | 2 ++ docs/src/model_setup/buoyancy_and_equation_of_state.md | 6 ++++++ docs/src/model_setup/lagrangian_particles.md | 1 + docs/src/model_setup/tracers.md | 3 +++ src/BuoyancyModels/buoyancy.jl | 1 + src/Models/seawater_density.jl | 1 + 6 files changed, 14 insertions(+) diff --git a/docs/src/model_setup/boundary_conditions.md b/docs/src/model_setup/boundary_conditions.md index 9ead613e45..857b5f1f45 100644 --- a/docs/src/model_setup/boundary_conditions.md +++ b/docs/src/model_setup/boundary_conditions.md @@ -43,6 +43,7 @@ julia> model = NonhydrostaticModel(; grid, boundary_conditions=(u=no_slip_field_ 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 +├── advection scheme: Centered reconstruction order 2 ├── tracers: () ├── closure: Nothing ├── buoyancy: Nothing @@ -404,6 +405,7 @@ julia> model = NonhydrostaticModel(grid=grid, boundary_conditions=(u=u_bcs, c=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 +├── advection scheme: Centered reconstruction order 2 ├── tracers: c ├── closure: Nothing ├── buoyancy: Nothing diff --git a/docs/src/model_setup/buoyancy_and_equation_of_state.md b/docs/src/model_setup/buoyancy_and_equation_of_state.md index ce9470b11a..3dec28b35c 100644 --- a/docs/src/model_setup/buoyancy_and_equation_of_state.md +++ b/docs/src/model_setup/buoyancy_and_equation_of_state.md @@ -29,6 +29,7 @@ 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 +├── advection scheme: Centered reconstruction order 2 ├── tracers: () ├── closure: Nothing ├── buoyancy: Nothing @@ -43,6 +44,7 @@ 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 +├── advection scheme: Centered reconstruction order 2 ├── tracers: () ├── closure: Nothing ├── buoyancy: Nothing @@ -78,6 +80,7 @@ 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 +├── advection scheme: Centered reconstruction order 2 ├── tracers: b ├── closure: Nothing ├── buoyancy: BuoyancyTracer with ĝ = NegativeZDirection() @@ -118,6 +121,7 @@ julia> model = NonhydrostaticModel(; grid, buoyancy=SeawaterBuoyancy(), tracers= 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 +├── advection scheme: Centered reconstruction order 2 ├── tracers: (T, S) ├── closure: Nothing ├── buoyancy: SeawaterBuoyancy with g=9.80665 and LinearEquationOfState(thermal_expansion=0.000167, haline_contraction=0.00078) with ĝ = NegativeZDirection() @@ -175,6 +179,7 @@ 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 +├── advection scheme: Centered reconstruction order 2 ├── tracers: (T, S) ├── closure: Nothing ├── buoyancy: SeawaterBuoyancy with g=1.3 and LinearEquationOfState(thermal_expansion=0.000167, haline_contraction=0.00078) with ĝ = NegativeZDirection() @@ -250,6 +255,7 @@ 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 +├── advection scheme: Centered reconstruction order 2 ├── tracers: b ├── closure: Nothing ├── buoyancy: BuoyancyTracer with ĝ = Tuple{Float64, Float64, Float64} diff --git a/docs/src/model_setup/lagrangian_particles.md b/docs/src/model_setup/lagrangian_particles.md index dfdfd1c646..2db8c9fd94 100644 --- a/docs/src/model_setup/lagrangian_particles.md +++ b/docs/src/model_setup/lagrangian_particles.md @@ -44,6 +44,7 @@ model = NonhydrostaticModel(grid=grid, particles=lagrangian_particles) 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 +├── advection scheme: Centered reconstruction order 2 ├── tracers: () ├── closure: Nothing ├── buoyancy: Nothing diff --git a/docs/src/model_setup/tracers.md b/docs/src/model_setup/tracers.md index 2231a6d3d0..9ab731a325 100644 --- a/docs/src/model_setup/tracers.md +++ b/docs/src/model_setup/tracers.md @@ -16,6 +16,7 @@ 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 +├── advection scheme: Centered reconstruction order 2 ├── tracers: () ├── closure: Nothing ├── buoyancy: Nothing @@ -30,6 +31,7 @@ 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 +├── advection scheme: Centered reconstruction order 2 ├── tracers: (T, S) ├── closure: Nothing ├── buoyancy: Nothing @@ -64,6 +66,7 @@ julia> model = NonhydrostaticModel(; grid, tracers=(:T, :S, :C₁, :CO₂, :nitr 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 +├── advection scheme: Centered reconstruction order 2 ├── tracers: (T, S, C₁, CO₂, nitrogen) ├── closure: Nothing ├── buoyancy: Nothing diff --git a/src/BuoyancyModels/buoyancy.jl b/src/BuoyancyModels/buoyancy.jl index ea792abcf1..7ae87e40b1 100644 --- a/src/BuoyancyModels/buoyancy.jl +++ b/src/BuoyancyModels/buoyancy.jl @@ -32,6 +32,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 3×3×3 halo ├── timestepper: QuasiAdamsBashforth2TimeStepper +├── advection scheme: Centered reconstruction order 2 ├── tracers: b ├── closure: Nothing ├── buoyancy: BuoyancyTracer with ĝ = Tuple{Float64, Float64, Float64} diff --git a/src/Models/seawater_density.jl b/src/Models/seawater_density.jl index 2df2ee78f8..d3073976d3 100644 --- a/src/Models/seawater_density.jl +++ b/src/Models/seawater_density.jl @@ -82,6 +82,7 @@ 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 +├── advection scheme: Centered reconstruction order 2 ├── tracers: (T, S) ├── closure: Nothing ├── buoyancy: SeawaterBuoyancy with g=9.80665 and BoussinesqEquationOfState{Float64} with ĝ = NegativeZDirection() From a89d20e12eaa1b62ea89d9c3c58826b324306bb5 Mon Sep 17 00:00:00 2001 From: "Navid C. Constantinou" Date: Sun, 7 Apr 2024 08:15:53 +0300 Subject: [PATCH 4/4] code alignment --- .../show_hydrostatic_free_surface_model.jl | 1 - src/Models/ShallowWaterModels/show_shallow_water_model.jl | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Models/HydrostaticFreeSurfaceModels/show_hydrostatic_free_surface_model.jl b/src/Models/HydrostaticFreeSurfaceModels/show_hydrostatic_free_surface_model.jl index 56b649b80b..88cd4ab915 100644 --- a/src/Models/HydrostaticFreeSurfaceModels/show_hydrostatic_free_surface_model.jl +++ b/src/Models/HydrostaticFreeSurfaceModels/show_hydrostatic_free_surface_model.jl @@ -50,4 +50,3 @@ function Base.show(io::IO, model::HydrostaticFreeSurfaceModel) print(io, "└── particles: $(length(particles)) Lagrangian particles with $(length(properties)) properties: $properties") end end - diff --git a/src/Models/ShallowWaterModels/show_shallow_water_model.jl b/src/Models/ShallowWaterModels/show_shallow_water_model.jl index ce1f7cb7a1..6ba594438b 100644 --- a/src/Models/ShallowWaterModels/show_shallow_water_model.jl +++ b/src/Models/ShallowWaterModels/show_shallow_water_model.jl @@ -22,4 +22,4 @@ function Base.show(io::IO, model::ShallowWaterModel{G, A, T}) where {G, A, T} print(io, "├── tracers: $(tracernames(model.tracers))\n", "└── coriolis: $(typeof(model.coriolis))") -end \ No newline at end of file +end