Mandatory end-of-segment flush of the windowed tracer-advect
accumulators (spec §(c) — MOM6’s n == n_max). Drains any OPEN
accumulation window (t_dyn_rel_adv > 0) so no Lagrangian-advanced
h_layer is ever paired with FROZEN hTr at an output write, a
restart checkpoint, or the end of a run segment whose length is not
an exact multiple of dt_tracer_advect_ratio.
Hard no-op at dt_tracer_advect_ratio <= 1 (ratio = 1 never
accumulates ⇒ t_dyn_rel_adv stays 0 ⇒ bit-identical). Idempotent:
the drain resets the accumulators + clock, so a redundant flush over
an already-empty window reconstructs hprev = h_end (div of the
zeroed accumulators) and drains zero transport — an exact no-op.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(hgrid_t), | intent(in) | :: | grid | |||
| type(ocean_metrics_t), | intent(in) | :: | metrics | |||
| type(ocean_dyn_t), | intent(in) | :: | dyn | |||
| type(continuity_t), | intent(inout) | :: | ct | |||
| type(multilayer_state_t), | intent(inout) | :: | ms | |||
| type(ocean_bc_state_t), | intent(in), | optional | :: | bc |
subroutine ocean_dyn_flush_tracer_window(grid, metrics, dyn, ct, ms, bc) !! Mandatory end-of-segment flush of the windowed tracer-advect !! accumulators (spec §(c) — MOM6's `n == n_max`). Drains any OPEN !! accumulation window (`t_dyn_rel_adv > 0`) so no Lagrangian-advanced !! `h_layer` is ever paired with FROZEN `hTr` at an output write, a !! restart checkpoint, or the end of a run segment whose length is not !! an exact multiple of `dt_tracer_advect_ratio`. !! !! Hard no-op at `dt_tracer_advect_ratio <= 1` (ratio = 1 never !! accumulates ⇒ `t_dyn_rel_adv` stays 0 ⇒ bit-identical). Idempotent: !! the drain resets the accumulators + clock, so a redundant flush over !! an already-empty window reconstructs `hprev = h_end` (div of the !! zeroed accumulators) and drains zero transport — an exact no-op. type(hgrid_t), intent(in) :: grid type(ocean_metrics_t), intent(in) :: metrics type(ocean_dyn_t), intent(in) :: dyn type(continuity_t), intent(inout) :: ct type(multilayer_state_t), intent(inout) :: ms type(ocean_bc_state_t), intent(in), optional :: bc if (dyn%dt_tracer_advect_ratio <= 1) return if (ct%t_dyn_rel_adv <= 0.0_wp) return if (present(bc)) then call continuity_tracer_drain(grid, metrics, ct, ms, dyn%dt_tracer_advect_ratio, bc=bc) else call continuity_tracer_drain(grid, metrics, ct, ms, dyn%dt_tracer_advect_ratio) end if end subroutine ocean_dyn_flush_tracer_window