Coupled Ocean Model

The Ocean module wraps the entire velocity-and-tracer pipeline. It is the high-level entry point for time-stepping a Pelagos simulation.

OceanModel holds:

  • the shared ImmersedBoundaryGrid (the single source of grid geometry),
  • the Oceananigans HydrostaticFreeSurfaceModel that owns $T$ and $S$ and the prescribed velocity Fields,
  • the pre-assembled sparse barotropic streamfunction solver, and
  • the pressure Field{Center, Center, Center}.

step_ocean! advances the model one timestep using the pipeline:

  1. compute_pressure! — hydrostatic $p$ from $T,S$.
  2. solve_baroclinic! — frictional-geostrophic $u, v$ on the C-grid.
  3. Barotropic correction — solve ψ at T-points, average to corners, derive divergence-free face transports, replace the FG depth-mean with the ψ-derived barotropic flow.
  4. diagnose_w! — vertical velocity from the rigid-lid continuity constraint.
  5. Oceananigans.time_step! — advance $T$ and $S$.

The corner-ψ correction makes $w_{\text{top}}$ discretely zero to machine precision, so over one year of integration $T$ and $S$ drift only at the diffusive rate (no spurious source/sink from a non-zero rigid-lid residual).

Pelagos.Ocean.OceanModelType
OceanModel

Holds all state for one timestep of the coupled velocity + tracer ocean model.

Fields:

  • grid : shared ImmersedBoundaryGrid (the single source of grid geometry)
  • tracer_model : Oceananigans HydrostaticFreeSurfaceModel (owns T, S and their prescribed velocity fields u, v, w)
  • bar_solver : pre-assembled sparse barotropic streamfunction solver
  • p : hydrostatic pressure field (Center, Center, Center), bar
source
Pelagos.Ocean.build_ocean_modelMethod
build_ocean_model(restart_dir; T_restore, S_restore, tau_T, tau_S)

Build an OceanModel initialised from a CLIMBER-X restart directory. The grid is constructed from the restart file; initial T and S are loaded into the Oceananigans tracer fields via set!.

source
Pelagos.Ocean.step_ocean!Method
step_ocean!(model, tau_x, tau_y, dt)

Advance the ocean model by one timestep dt seconds.

tau_x, tau_y are (Nx, Ny) matrices of wind stress in N m⁻² on T-points.

source