-
Notifications
You must be signed in to change notification settings - Fork 242
(0.97.6) Move the computation of flux BC before the time-stepping #4696
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
Conversation
src/Models/HydrostaticFreeSurfaceModels/HydrostaticFreeSurfaceModels.jl
Outdated
Show resolved
Hide resolved
src/Models/HydrostaticFreeSurfaceModels/hydrostatic_free_surface_ab2_step.jl
Outdated
Show resolved
Hide resolved
So, how was this working for multi-step timestepping schemes? Before this PR the flux bcs were added at the end of the Δt or at the end of each substep? |
@navidcy This is the difference between main and this PR in a one-step method like AB2 blue boxes are computed in ClimaOcean, black boxes in Oceanananigans. ![]() |
This PR is moving the computation of the boundary conditions just before the time-stepping of the prognostic variables, rather than at the end of the time-stepping procedure.
This is because, in Oceananigans, we add the flux bcs to the tendencies, which are computed at the end of a time step. However, if we need to couple a model, the exchange between components is typically computed at the end of the stepping of all the components, meaning that, if we do this, we do not add the updated fluxes to the tendency in an Oceananigans model; rather, the fluxes corresponding to the previous time-step.
This might become an issue when coupling on large time steps, where the fluxes lag behind and the model can overshoot.
This change will not affect oceananigans-only models, but will affect coupled models like the
OceanSeaIceModel
in ClimaOcean.jl.