Transient barotropic state the split driver reads/writes between
the slow baroclinic step and the fast barotropic substep loop.
Transient (not restartable), unlike the prognostic
barotropic_state_t. C-grid stagger: scalars at centres,
u at east faces, v at north faces, ζ at corners. F_slow_*,
F_bt_*, ubt_at_n, vbt_at_n, etc. are allocated only when
init is passed nz_ml (barotropic-only unit tests skip them).
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(local_BT_cont_u_type), | public, | allocatable | :: | BTCL_u(:,:) |
Per-u-face flux-closure coefficients, shape (nx+1, ny).
Allocated only when |
||
| type(local_BT_cont_v_type), | public, | allocatable | :: | BTCL_v(:,:) |
Per-v-face counterpart, shape (nx, ny+1). |
||
| real(kind=wp), | public, | allocatable | :: | F_bt_u(:,:) |
Depth-mean of |
||
| real(kind=wp), | public, | allocatable | :: | F_bt_u_fast(:,:) |
|
||
| real(kind=wp), | public, | allocatable | :: | F_bt_v(:,:) |
Depth-mean of |
||
| real(kind=wp), | public, | allocatable | :: | F_bt_v_fast(:,:) |
v counterpart, shape (nx, ny+1). |
||
| real(kind=wp), | public, | allocatable | :: | F_slow_u(:,:,:) |
Per-face slow u-acceleration sum, shape (nx+1, ny, nz_ml). |
||
| real(kind=wp), | public, | allocatable | :: | F_slow_v(:,:,:) |
Per-face slow v-acceleration sum, shape (nx, ny+1, nz_ml). |
||
| real(kind=wp), | public, | allocatable | :: | av_rem_u(:,:) |
u-face visc_rem depth mean, shape (nx+1, ny). |
||
| real(kind=wp), | public, | allocatable | :: | av_rem_v(:,:) |
v-face counterpart, shape (nx, ny+1). |
||
| real(kind=wp), | public | :: | bebt | = | 0.1_wp |
MOM6 |
|
| real(kind=wp), | public, | allocatable | :: | bt_H_ref(:,:) |
Reference column thickness (m) at cell centres, shape
(nx, ny). Constant for Eulerian-z; set by the driver
from the initial multilayer state. Used as |
||
| logical, | public | :: | bt_bc_pgf_forcing | = | .true. |
|
|
| logical, | public | :: | bt_correction_bc_pgf | = | .false. |
When |
|
| logical, | public | :: | bt_correction_visc_rem | = | .false. |
RETIRED-by-D1 (2026-10, PR-3 follow-up): when |
|
| real(kind=wp), | public, | allocatable | :: | bt_eta(:,:) |
Barotropic SSH at cell centres, shape (nx, ny). Defined
as |
||
| real(kind=wp), | public, | allocatable | :: | bt_eta_end(:,:) | |||
| real(kind=wp), | public, | allocatable | :: | bt_eta_new(:,:) |
Per-substep η^{n+1} scratch, shape (nx, ny). Jacobi
buffer so the face-thickness reads in Pass 1 stay race-
free under the Fortran 2018 |
||
| logical, | public | :: | bt_forcing_visc_rem | = | .false. |
MOM6 |
|
| real(kind=wp), | public, | allocatable | :: | bt_ke_centre(:,:) |
Barotropic kinetic energy at cell centres, shape (nx, ny). |
||
| logical, | public | :: | bt_rem_from_visc_rem | = | .false. |
PR-2 (bt-rem-from-av-rem, |
|
| real(kind=wp), | public, | allocatable | :: | bt_rem_u(:,:) |
u-face damping factor, shape (nx+1, ny). |
||
| real(kind=wp), | public, | allocatable | :: | bt_rem_v(:,:) |
v-face counterpart, shape (nx, ny+1). |
||
| logical, | public | :: | bt_renorm_visc_rem | = | .false. |
MOM6 continuity-inversion parity (SPEC S2b): γ-weighted
transport-matching renormaliser ( |
|
| logical, | public | :: | bt_rescale_strong_drag | = | .false. |
MOM6 |
|
| logical, | public | :: | bt_strong_drag | = | .false. |
MOM6 |
|
| logical, | public | :: | bt_substep_drag | = | .false. |
When |
|
| real(kind=wp), | public, | allocatable | :: | bt_ubt(:,:) |
Depth-mean u at east faces, shape (nx+1, ny). |
||
| real(kind=wp), | public, | allocatable | :: | bt_ubt_end(:,:) | |||
| real(kind=wp), | public, | allocatable | :: | bt_ubt_prev(:,:) |
u-face velocity from the previous substep, shape (nx+1, ny). |
||
| real(kind=wp), | public, | allocatable | :: | bt_uhbt(:,:) |
Time-mean east-face transport (m²/s), shape |
||
| real(kind=wp), | public, | allocatable | :: | bt_vbt(:,:) |
Depth-mean v at north faces, shape (nx, ny+1). |
||
| real(kind=wp), | public, | allocatable | :: | bt_vbt_end(:,:) | |||
| real(kind=wp), | public, | allocatable | :: | bt_vbt_prev(:,:) |
v-face counterpart, shape (nx, ny+1). |
||
| real(kind=wp), | public, | allocatable | :: | bt_vhbt(:,:) |
Time-mean north-face transport (m²/s), shape |
||
| logical, | public | :: | bt_visc_rem_producer | = | .false. |
D1 follow-up: gates the visc_rem PRODUCER fused into
|
|
| real(kind=wp), | public, | allocatable | :: | bt_zeta_corner(:,:) |
Barotropic relative vorticity at corners, shape (nx+1, ny+1). |
||
| real(kind=wp), | public, | allocatable | :: | cor_ref_u(:,:) |
u-face Coriolis/advection reference velocity, shape (nx+1, ny). |
||
| real(kind=wp), | public, | allocatable | :: | cor_ref_v(:,:) |
v-face counterpart, shape (nx, ny+1). |
||
| real(kind=wp), | public, | allocatable | :: | e_anom(:,:) |
SSH anomaly relative to |
||
| real(kind=wp), | public, | allocatable | :: | eta_PF(:,:) |
Snapshot of |
||
| real(kind=wp), | public, | allocatable | :: | eta_sum(:,:) | |||
| integer, | public | :: | frhat_scheme | = | FRHAT_ARITHMETIC |
|
|
| real(kind=wp), | public | :: | g_bt | = | 9.81_wp |
Acceleration in the barotropic-substep η-gradient PGF
( |
|
| real(kind=wp), | public, | allocatable | :: | gtot_E(:,:) |
Depth-weighted column average of |
||
| real(kind=wp), | public, | allocatable | :: | gtot_N(:,:) |
North-face counterpart, shape (nx, ny). |
||
| real(kind=wp), | public, | allocatable | :: | gtot_S(:,:) |
South-face counterpart, shape (nx, ny). |
||
| real(kind=wp), | public, | allocatable | :: | gtot_W(:,:) |
West-face counterpart, shape (nx, ny). |
||
| real(kind=wp), | public, | allocatable | :: | h_face_up_x(:,:) |
East-face upstream-h column sum (m), shape (nx+1, ny).
|
||
| real(kind=wp), | public, | allocatable | :: | h_face_up_y(:,:) |
North-face counterpart, shape (nx, ny+1). Built from
|
||
| logical, | public | :: | is_init | = | .false. |
True between |
|
| real(kind=wp), | public, | allocatable | :: | lwd_drag_u(:,:) |
u-face piston velocity |
||
| real(kind=wp), | public, | allocatable | :: | lwd_drag_v(:,:) |
v-face counterpart, shape (nx, ny+1). |
||
| logical, | public | :: | lwd_enable | = | .false. |
Driver writes from |
|
| real(kind=wp), | public, | allocatable | :: | pbce(:,:,:) |
Per-layer pressure-anomaly gravity coefficient (m/s²),
shape (nx, ny, nz_ml). Column-mean equals |
||
| logical, | public | :: | substep_zeta_ke | = | .true. |
Live |
|
| real(kind=wp), | public, | allocatable | :: | ubt_at_n(:,:) |
Depth-mean u at the start of the outer step, shape (nx+1, ny). Used in the recombine step: u^{n+1}(k) = u^*(k) + (⟨u_bt⟩ - ubt_at_n - dt·F_bt_u) |
||
| real(kind=wp), | public, | allocatable | :: | ubt_sum(:,:) | |||
| real(kind=wp), | public, | allocatable | :: | uhbt_sum(:,:) |
East-face transport accumulator, shape |
||
| logical, | public | :: | use_bt_cont_type | = | .false. |
Driver writes from the |
|
| logical, | public | :: | use_upstream_h_face | = | .false. |
Driver writes from the |
|
| real(kind=wp), | public, | allocatable | :: | vbt_at_n(:,:) |
v counterpart, shape (nx, ny+1). |
||
| real(kind=wp), | public, | allocatable | :: | vbt_sum(:,:) | |||
| real(kind=wp), | public, | allocatable | :: | vhbt_sum(:,:) |
North-face transport accumulator, shape |
||
| real(kind=wp), | public, | allocatable | :: | visc_rem_u(:,:,:) |
u-face per-layer visc_rem, shape (nx+1, ny, nz_ml). |
||
| real(kind=wp), | public, | allocatable | :: | visc_rem_v(:,:,:) |
v-face per-layer visc_rem, shape (nx, ny+1, nz_ml). |
||
| real(kind=wp), | public | :: | wd_dry_depth | = | 0.05_wp |
Total-depth dry threshold (m); cells with |
|
| real(kind=wp), | public, | allocatable | :: | wd_flux_x(:,:) |
East-face provisional-then-limited volume flux (m³/s), shape
(nx+1, ny). Pass A fills |
||
| real(kind=wp), | public, | allocatable | :: | wd_flux_y(:,:) |
North-face counterpart, shape (nx, ny+1). |
||
| real(kind=wp), | public, | allocatable | :: | wd_open_u(:,:) |
Dynamic u-face open mask (1 = open, 0 = blocked), shape (nx+1, ny). Bed-blocking (C-grid analogue of the coastal hydrostatic reconstruction): a face into a dry cell is a wall unless the wet side’s surface stands above the dry side’s bed elevation + dry_depth. Rewetting starts from rest at the face. Consumed by the substep Pass 2 gate and by the driver’s layer-velocity masking. |
||
| real(kind=wp), | public, | allocatable | :: | wd_open_v(:,:) |
v-face counterpart, shape (nx, ny+1). |
||
| real(kind=wp), | public | :: | wd_rewet_depth | = | 0.10_wp |
Hysteresis re-wet threshold (m), > |
|
| real(kind=wp), | public, | allocatable | :: | wd_theta(:,:) |
Per-cell positive-definite outflow limiter factor in [0, 1],
shape (nx, ny). |
||
| real(kind=wp), | public, | allocatable | :: | wd_wet_dyn(:,:) |
Dynamic cell wet mask (1 = wet, 0 = dry), shape (nx, ny).
PERSISTENT hysteresis state: updated every BT substep from
|
||
| logical, | public | :: | wetdry_enable | = | .false. |
Driver writes from |
| procedure, public, non_overridable :: bytes => barotropic_workstate_bytes | |
| procedure, public, non_overridable :: destroy => barotropic_workstate_destroy | |
| procedure, public, non_overridable :: enter_data => barotropic_workstate_enter_data | |
| procedure, public, non_overridable :: exit_data => barotropic_workstate_exit_data | |
| procedure, public, non_overridable :: init => barotropic_workstate_init |
Per-u-face coefficient pack for the piecewise-cubic
barotropic-continuity flux closure (find_uhbt four-branch
transport function consumes these).
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | public | :: | FA_u_E0 | = | 0.0_wp |
Effective face area for near-zero u with u < 0 [m]. |
|
| real(kind=wp), | public | :: | FA_u_EE | = | 0.0_wp |
Marginal face area in the saturated far-east-draw
regime |
|
| real(kind=wp), | public | :: | FA_u_W0 | = | 0.0_wp |
Effective face area for near-zero u with u > 0 [m]. |
|
| real(kind=wp), | public | :: | FA_u_WW | = | 0.0_wp |
Marginal face area in the saturated far-west-draw
regime |
|
| real(kind=wp), | public | :: | uBT_EE | = | 0.0_wp |
Negative velocity threshold beyond which |
|
| real(kind=wp), | public | :: | uBT_WW | = | 0.0_wp |
Positive velocity threshold beyond which |
|
| real(kind=wp), | public | :: | uh_EE | = | 0.0_wp |
Mass transport at |
|
| real(kind=wp), | public | :: | uh_WW | = | 0.0_wp |
Mass transport at |
|
| real(kind=wp), | public | :: | uh_crvE | = | 0.0_wp |
Cubic correction in the near-zero negative branch
providing C¹ continuity at |
|
| real(kind=wp), | public | :: | uh_crvW | = | 0.0_wp |
Cubic correction in the near-zero positive branch
providing C¹ continuity at |
Meridional mirror of local_BT_cont_u_type — north-draw
and south-draw branches around v=0.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | public | :: | FA_v_N0 | = | 0.0_wp | ||
| real(kind=wp), | public | :: | FA_v_NN | = | 0.0_wp | ||
| real(kind=wp), | public | :: | FA_v_S0 | = | 0.0_wp | ||
| real(kind=wp), | public | :: | FA_v_SS | = | 0.0_wp | ||
| real(kind=wp), | public | :: | vBT_NN | = | 0.0_wp |
Negative (northward-draw) threshold [m/s]; must be ≤ 0. |
|
| real(kind=wp), | public | :: | vBT_SS | = | 0.0_wp |
Positive (southward-draw) threshold [m/s]; must be ≥ 0. |
|
| real(kind=wp), | public | :: | vh_NN | = | 0.0_wp | ||
| real(kind=wp), | public | :: | vh_SS | = | 0.0_wp | ||
| real(kind=wp), | public | :: | vh_crvN | = | 0.0_wp | ||
| real(kind=wp), | public | :: | vh_crvS | = | 0.0_wp |
Counted allocatable footprint of the barotropic fast-loop work state (BTCL_u/v derived-type coeffs excluded) slot (0 when unallocated).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(barotropic_workstate_t), | intent(in) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(barotropic_workstate_t), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(barotropic_workstate_t), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(barotropic_workstate_t), | intent(inout) | :: | this |
Attaches component arrays only — no bare copyin(this) (the
polymorphic stack descriptor caused AMD libomptarget cross-slot
overlap). The workstate descriptor reaches the device via the
root copyin(state%ocean) (bt_work is inline all the way up);
the per-slot copyin was a competing second mapping that cost
~36% of the fast loop.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(barotropic_workstate_t), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(barotropic_workstate_t), | intent(inout) | :: | this |
Allocate the 2D barotropic-substep arrays. Pass nz_ml to also
allocate the split-driver slow-tendency accumulators; omit
when only the 2D barotropic substep is needed (unit tests).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(barotropic_workstate_t), | intent(inout) | :: | this | |||
| type(hgrid_t), | intent(in) | :: | grid | |||
| integer, | intent(in), | optional | :: | nz_ml |