Repository navigation
Improving Oceananigans' split barotropic solver - #5812
simone-silvestri wants to merge 188 commits into
Conversation
… into ss/sm05-barotropic
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5812 +/- ##
===========================================
+ Coverage 25.96% 74.35% +48.38%
===========================================
Files 439 444 +5
Lines 27275 28255 +980
===========================================
+ Hits 7083 21009 +13926
+ Misses 20192 7246 -12946
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Improves split-explicit barotropic accuracy, filtering, topology handling, and Runge–Kutta integration.
Changes:
- Adds higher-order averaging kernels and slow-forcing reconstruction.
- Introduces SSPRK3 and higher-order barotropic substepping.
- Extends diagnostics, tripolar, multi-region, and implicit-advection support.
Reviewed changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
test/test_tripolar_grid.jl |
Updates serial-fold expectations. |
test/test_split_explicit_free_surface_solver.jl |
Tests kernels, reconstruction, and RK3 substeps. |
test/test_implicit_diffusion_diagnostic.jl |
Adds SSPRK3 coverage. |
src/TurbulenceClosures/.../time_step_catke_equation.jl |
Adds SSP CATKE stepping. |
src/TimeSteppers/TimeSteppers.jl |
Exports and registers new steppers. |
src/TimeSteppers/ssp_runge_kutta.jl |
Implements SSP Runge–Kutta. |
src/TimeSteppers/split_runge_kutta.jl |
Adds modified RK4 composition. |
src/Operators/topology_aware_operators.jl |
Adds tripolar-fold operators. |
src/MultiRegion/multi_region_models.jl |
Integrates new free-surface state. |
src/MultiRegion/multi_region_grid.jl |
Sizes multi-stage halos. |
src/MultiRegion/cubed_sphere_grid.jl |
Sizes cubed-sphere halos. |
src/Models/VarianceDissipationComputations/VarianceDissipationComputations.jl |
Adds scaling caches. |
src/Models/VarianceDissipationComputations/update_fluxes.jl |
Accumulates SSP fluxes. |
src/Models/VarianceDissipationComputations/diffusive_dissipation.jl |
Adds SSP diffusion accumulation. |
src/Models/VarianceDissipationComputations/compute_dissipation.jl |
Assembles SSP diagnostics. |
src/Models/VarianceDissipationComputations/advective_dissipation.jl |
Adds SSP advection accumulation. |
src/Models/HydrostaticFreeSurfaceModels/SplitExplicitFreeSurfaces/step_split_explicit_free_surface.jl |
Refactors barotropic subcycling. |
src/Models/HydrostaticFreeSurfaceModels/SplitExplicitFreeSurfaces/SplitExplicitFreeSurfaces.jl |
Exposes new solver APIs. |
src/Models/HydrostaticFreeSurfaceModels/SplitExplicitFreeSurfaces/split_explicit_timesteppers.jl |
Implements barotropic RK3. |
src/Models/HydrostaticFreeSurfaceModels/SplitExplicitFreeSurfaces/split_explicit_free_surface.jl |
Adds forcing and halo configuration. |
src/Models/HydrostaticFreeSurfaceModels/SplitExplicitFreeSurfaces/split_explicit_averaging_kernels.jl |
Implements higher-order filters. |
src/Models/HydrostaticFreeSurfaceModels/SplitExplicitFreeSurfaces/slow_forcing_reconstruction.jl |
Implements forcing interpolation. |
src/Models/HydrostaticFreeSurfaceModels/SplitExplicitFreeSurfaces/initialize_split_explicit_substepping.jl |
Generalizes stage initialization. |
src/Models/HydrostaticFreeSurfaceModels/SplitExplicitFreeSurfaces/compute_slow_tendencies.jl |
Caches stage forcing. |
src/Models/HydrostaticFreeSurfaceModels/prescribed_hydrostatic_velocity_fields.jl |
Adds SSP no-op dispatch. |
src/Models/HydrostaticFreeSurfaceModels/implicit_free_surface.jl |
Generalizes multi-stage dispatch. |
src/Models/HydrostaticFreeSurfaceModels/HydrostaticFreeSurfaceModels.jl |
Includes SSP implementation. |
src/Models/HydrostaticFreeSurfaceModels/hydrostatic_free_surface_ssp_step.jl |
Implements hydrostatic SSP stages. |
src/Models/HydrostaticFreeSurfaceModels/hydrostatic_free_surface_model.jl |
Registers and validates steppers. |
src/Models/HydrostaticFreeSurfaceModels/explicit_free_surface.jl |
Supports multi-stage stepping. |
src/ImmersedBoundaries/mutable_immersed_grid.jl |
Handles folded column depths. |
src/Advection/implicit_vertical_advection.jl |
Uses previous vertical spacing. |
src/Advection/adaptive_implicit_vertical_advection.jl |
Supports SSP stage durations. |
Suppressed comments (1)
src/Models/HydrostaticFreeSurfaceModels/SplitExplicitFreeSurfaces/slow_forcing_reconstruction.jl:123
- This method ignores both
ts.Nstagesand the supplied Shu–Osher coefficients. SinceSSPRungeKuttaTimeStepperpublicly accepts arbitrary coefficient tuples, a four-stage reconstruction indexes past this three-element tuple, while other custom schemes receive incorrect sample nodes. Derive the stage abscissae from the recursion, or reject non-SSPRK3 coefficients before exposing reconstruction for them.
@inline stage_sample_times(::SSPRungeKuttaTimeStepper) = (0.0, 1.0, 1/2)
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Gregory L. Wagner <wagner.greg@gmail.com>
Co-authored-by: Gregory L. Wagner <wagner.greg@gmail.com>
|
Hi Simone, I ran into a z★ tracer-constancy problem at open boundaries, and this PR fixes part of it, so flagging it here. Setup: c ≡ 1, Cause: σ is advanced with η, but w̃ comes from Ũ/Ṽ, and the two disagree at the boundary faces:
This PR fixes (1) for the faces inside the kernel range by accumulating U★/V★ in the η kernel. On its own, though, the result is bit-identical to main, because (2) overwrites the boundary faces anyway. With both fixed (also accumulate the N+1 face on a closed right side, and give Ũ/Ṽ boundary conditions that skip normal-flow sides), c − 1 drops to ~3e-15. I have a minimal version of both on top of main, with a test that fails on main (|c − 1| ≈ 7e-6) and passes with the fix. I'll open it as a draft PR once the GPU tests pass. Since it touches the same kernel, I'm happy to fold it into this PR instead if you'd rather. (Under AB2 there is a separate, larger z★ non-constancy, ~3e-4 in the same setup, that this doesn't address.) |
Co-authored-by: Tomás Chor <tomaschor@gmail.com>
…l into ss/open-state-steps
This PR includes some nice implementations to improve order and accuracy of the split explicit barotropic solver: