rdb_multilayer_state Module

Per-layer prognostic state for the ocean dynamical core. Layout mirrors the 2D barotropic_state_t, lifted to (i, j, k):

  • Scalars (h_layer, tracers) at cell centres, shape (nx_total, ny_total, nz_ml).
  • x-velocity / x-momentum on east faces, shape (nx_total+1, ny_total, nz_ml).
  • y-velocity / y-momentum on north faces, shape (nx_total, ny_total+1, nz_ml).
  • Per-face per-layer mass fluxes — the continuity-PPM output that the tracer kernels consume.

Lives at ocean_state%multilayer when sim_type='ocean'. Caller must set this%nz_ml before calling init — typically threaded through from cfg%nz_layers in state_init_from_config.


Uses

  • module~~rdb_multilayer_state~~UsesGraph module~rdb_multilayer_state rdb_multilayer_state iso_fortran_env iso_fortran_env module~rdb_multilayer_state->iso_fortran_env module~rdb_constants rdb_constants module~rdb_multilayer_state->module~rdb_constants module~rdb_efp rdb_efp module~rdb_multilayer_state->module~rdb_efp module~rdb_error_ring rdb_error_ring module~rdb_multilayer_state->module~rdb_error_ring module~rdb_grid rdb_grid module~rdb_multilayer_state->module~rdb_grid module~rdb_mem_report rdb_mem_report module~rdb_multilayer_state->module~rdb_mem_report module~rdb_tracer rdb_tracer module~rdb_multilayer_state->module~rdb_tracer pic_logger pic_logger module~rdb_multilayer_state->pic_logger pic_types pic_types module~rdb_constants->pic_types module~rdb_efp->iso_fortran_env ieee_arithmetic ieee_arithmetic module~rdb_efp->ieee_arithmetic module~rdb_error_ring->pic_logger module~rdb_grid->module~rdb_constants module~rdb_mem_report->iso_fortran_env module~rdb_mem_report->module~rdb_constants module~rdb_mem_report->pic_logger pic_strings pic_strings module~rdb_mem_report->pic_strings module~rdb_tracer->iso_fortran_env module~rdb_tracer->module~rdb_constants module~rdb_tracer->module~rdb_grid module~rdb_tracer->module~rdb_mem_report

Used by

  • module~~rdb_multilayer_state~~UsedByGraph module~rdb_multilayer_state rdb_multilayer_state module~rdb_barotropic_coupling rdb_barotropic_coupling module~rdb_barotropic_coupling->module~rdb_multilayer_state module~rdb_coriolis_adv rdb_coriolis_adv module~rdb_barotropic_coupling->module~rdb_coriolis_adv module~rdb_ocean_bottom_drag rdb_ocean_bottom_drag module~rdb_barotropic_coupling->module~rdb_ocean_bottom_drag module~rdb_ocean_horizontal_viscosity rdb_ocean_horizontal_viscosity module~rdb_barotropic_coupling->module~rdb_ocean_horizontal_viscosity module~rdb_ocean_pressure_force rdb_ocean_pressure_force module~rdb_barotropic_coupling->module~rdb_ocean_pressure_force module~rdb_ocean_surface_stress rdb_ocean_surface_stress module~rdb_barotropic_coupling->module~rdb_ocean_surface_stress module~rdb_ocean_top_drag rdb_ocean_top_drag module~rdb_barotropic_coupling->module~rdb_ocean_top_drag module~rdb_continuity rdb_continuity module~rdb_continuity->module~rdb_multilayer_state module~rdb_ocean_fold_apply rdb_ocean_fold_apply module~rdb_continuity->module~rdb_ocean_fold_apply module~rdb_ocean_gm rdb_ocean_gm module~rdb_continuity->module~rdb_ocean_gm module~rdb_ocean_mle rdb_ocean_mle module~rdb_continuity->module~rdb_ocean_mle module~rdb_ocean_periodic rdb_ocean_periodic module~rdb_continuity->module~rdb_ocean_periodic module~rdb_ocean_halo rdb_ocean_halo module~rdb_continuity->module~rdb_ocean_halo module~rdb_ocean_fold_exchange rdb_ocean_fold_exchange module~rdb_continuity->module~rdb_ocean_fold_exchange module~rdb_coriolis_adv->module~rdb_multilayer_state module~rdb_ice_basal_flux rdb_ice_basal_flux module~rdb_ice_basal_flux->module~rdb_multilayer_state module~rdb_ocean_surface_flux rdb_ocean_surface_flux module~rdb_ice_basal_flux->module~rdb_ocean_surface_flux module~rdb_ice_evp rdb_ice_evp module~rdb_ice_evp->module~rdb_multilayer_state module~rdb_ice_evp->module~rdb_ocean_periodic module~rdb_ice_evp->module~rdb_ocean_halo module~rdb_ice_frazil rdb_ice_frazil module~rdb_ice_frazil->module~rdb_multilayer_state module~rdb_ice_frazil->module~rdb_ocean_surface_flux module~rdb_ice_frazil_uptake rdb_ice_frazil_uptake module~rdb_ice_frazil_uptake->module~rdb_multilayer_state module~rdb_ice_init rdb_ice_init module~rdb_ice_init->module~rdb_multilayer_state module~rdb_ice_itd rdb_ice_itd module~rdb_ice_itd->module~rdb_multilayer_state module~rdb_ice_thermo_driver rdb_ice_thermo_driver module~rdb_ice_thermo_driver->module~rdb_multilayer_state module~rdb_ice_transport rdb_ice_transport module~rdb_ice_transport->module~rdb_multilayer_state module~rdb_ice_transport->module~rdb_continuity module~rdb_ice_transport->module~rdb_ice_itd module~rdb_ocean_halo_state rdb_ocean_halo_state module~rdb_ice_transport->module~rdb_ocean_halo_state module~rdb_ice_transport->module~rdb_ocean_halo module~rdb_halo rdb_halo module~rdb_ice_transport->module~rdb_halo module~rdb_ocean_bottom_drag->module~rdb_multilayer_state module~rdb_ocean_bt_budget_probe rdb_ocean_bt_budget_probe module~rdb_ocean_bt_budget_probe->module~rdb_multilayer_state module~rdb_ocean_bt_budget_probe->module~rdb_coriolis_adv module~rdb_ocean_bt_budget_probe->module~rdb_ocean_bottom_drag module~rdb_ocean_bt_budget_probe->module~rdb_ocean_horizontal_viscosity module~rdb_ocean_bt_budget_probe->module~rdb_ocean_pressure_force module~rdb_ocean_bt_budget_probe->module~rdb_ocean_surface_stress module~rdb_ocean_budgets rdb_ocean_budgets module~rdb_ocean_budgets->module~rdb_multilayer_state module~rdb_ocean_cavity_flux rdb_ocean_cavity_flux module~rdb_ocean_cavity_flux->module~rdb_multilayer_state module~rdb_ocean_cavity_flux->module~rdb_ocean_surface_flux module~rdb_ocean_chksum rdb_ocean_chksum module~rdb_ocean_chksum->module~rdb_multilayer_state module~rdb_ocean_chksum->module~rdb_halo module~rdb_ocean_console_stats rdb_ocean_console_stats module~rdb_ocean_console_stats->module~rdb_multilayer_state module~rdb_ocean_console_stats->module~rdb_halo module~rdb_ocean_dyn rdb_ocean_dyn module~rdb_ocean_dyn->module~rdb_multilayer_state module~rdb_ocean_dyn->module~rdb_barotropic_coupling module~rdb_ocean_dyn->module~rdb_continuity module~rdb_ocean_dyn->module~rdb_coriolis_adv module~rdb_ocean_dyn->module~rdb_ocean_bottom_drag module~rdb_ocean_dyn->module~rdb_ocean_bt_budget_probe module~rdb_ocean_dyn->module~rdb_ocean_cavity_flux module~rdb_ocean_dyn->module~rdb_ocean_chksum module~rdb_ocean_dyn->module~rdb_ocean_console_stats module~rdb_ocean_eos_compute rdb_ocean_eos_compute module~rdb_ocean_dyn->module~rdb_ocean_eos_compute module~rdb_ocean_epbl rdb_ocean_epbl module~rdb_ocean_dyn->module~rdb_ocean_epbl module~rdb_ocean_dyn->module~rdb_ocean_fold_apply module~rdb_ocean_geothermal rdb_ocean_geothermal module~rdb_ocean_dyn->module~rdb_ocean_geothermal module~rdb_ocean_ghost_poison rdb_ocean_ghost_poison module~rdb_ocean_dyn->module~rdb_ocean_ghost_poison module~rdb_ocean_dyn->module~rdb_ocean_gm module~rdb_ocean_dyn->module~rdb_ocean_halo_state module~rdb_ocean_hdiff_tracer rdb_ocean_hdiff_tracer module~rdb_ocean_dyn->module~rdb_ocean_hdiff_tracer module~rdb_ocean_dyn->module~rdb_ocean_horizontal_viscosity module~rdb_ocean_ideal_age rdb_ocean_ideal_age module~rdb_ocean_dyn->module~rdb_ocean_ideal_age module~rdb_ocean_isopycnal_slopes rdb_ocean_isopycnal_slopes module~rdb_ocean_dyn->module~rdb_ocean_isopycnal_slopes module~rdb_ocean_kappa_shear rdb_ocean_kappa_shear module~rdb_ocean_dyn->module~rdb_ocean_kappa_shear module~rdb_ocean_ke_probe rdb_ocean_ke_probe module~rdb_ocean_dyn->module~rdb_ocean_ke_probe module~rdb_ocean_lateral_mix rdb_ocean_lateral_mix module~rdb_ocean_dyn->module~rdb_ocean_lateral_mix module~rdb_ocean_meke rdb_ocean_meke module~rdb_ocean_dyn->module~rdb_ocean_meke module~rdb_ocean_min_thickness rdb_ocean_min_thickness module~rdb_ocean_dyn->module~rdb_ocean_min_thickness module~rdb_ocean_dyn->module~rdb_ocean_mle module~rdb_ocean_obc_baroclinic rdb_ocean_obc_baroclinic module~rdb_ocean_dyn->module~rdb_ocean_obc_baroclinic module~rdb_ocean_dyn->module~rdb_ocean_periodic module~rdb_ocean_dyn->module~rdb_ocean_pressure_force module~rdb_ocean_redi rdb_ocean_redi module~rdb_ocean_dyn->module~rdb_ocean_redi module~rdb_ocean_remap rdb_ocean_remap module~rdb_ocean_dyn->module~rdb_ocean_remap module~rdb_ocean_sponge rdb_ocean_sponge module~rdb_ocean_dyn->module~rdb_ocean_sponge module~rdb_ocean_dyn->module~rdb_ocean_surface_flux module~rdb_ocean_dyn->module~rdb_ocean_surface_stress module~rdb_ocean_tidal_mixing rdb_ocean_tidal_mixing module~rdb_ocean_dyn->module~rdb_ocean_tidal_mixing module~rdb_ocean_dyn->module~rdb_ocean_top_drag module~rdb_ocean_varmix rdb_ocean_varmix module~rdb_ocean_dyn->module~rdb_ocean_varmix module~rdb_ocean_vdiff rdb_ocean_vdiff module~rdb_ocean_dyn->module~rdb_ocean_vdiff module~rdb_ocean_vertical_advection rdb_ocean_vertical_advection module~rdb_ocean_dyn->module~rdb_ocean_vertical_advection module~rdb_ocean_vmix rdb_ocean_vmix module~rdb_ocean_dyn->module~rdb_ocean_vmix module~rdb_ocean_wave_speed rdb_ocean_wave_speed module~rdb_ocean_dyn->module~rdb_ocean_wave_speed module~rdb_ocean_dyn->module~rdb_ocean_halo module~rdb_barotropic_substep rdb_barotropic_substep module~rdb_ocean_dyn->module~rdb_barotropic_substep module~rdb_ocean_bt_wide rdb_ocean_bt_wide module~rdb_ocean_dyn->module~rdb_ocean_bt_wide module~rdb_ocean_eos_compute->module~rdb_multilayer_state module~rdb_ocean_epbl->module~rdb_multilayer_state module~rdb_ocean_epbl->module~rdb_ocean_surface_flux module~rdb_ocean_epbl->module~rdb_ocean_surface_stress module~rdb_ocean_fold_apply->module~rdb_multilayer_state module~rdb_ocean_fold_apply->module~rdb_ocean_fold_exchange module~rdb_ocean_geothermal->module~rdb_multilayer_state module~rdb_ocean_geothermal->module~rdb_ocean_surface_flux module~rdb_ocean_ghost_poison->module~rdb_multilayer_state module~rdb_ocean_ghost_poison->module~rdb_ocean_surface_stress module~rdb_ocean_gm->module~rdb_multilayer_state module~rdb_ocean_gm->module~rdb_ocean_isopycnal_slopes module~rdb_ocean_halo_state->module~rdb_multilayer_state module~rdb_ocean_halo_state->module~rdb_ocean_fold_apply module~rdb_ocean_halo_state->module~rdb_ocean_periodic module~rdb_ocean_halo_state->module~rdb_ocean_surface_stress module~rdb_ocean_halo_state->module~rdb_ocean_halo module~rdb_ocean_hdiff_tracer->module~rdb_multilayer_state module~rdb_ocean_horizontal_viscosity->module~rdb_multilayer_state module~rdb_ocean_horizontal_viscosity->module~rdb_ocean_lateral_mix module~rdb_ocean_ideal_age->module~rdb_multilayer_state module~rdb_ocean_isopycnal_slopes->module~rdb_multilayer_state module~rdb_ocean_kappa_shear->module~rdb_multilayer_state module~rdb_ocean_ke_probe->module~rdb_multilayer_state module~rdb_ocean_ke_probe->module~rdb_coriolis_adv module~rdb_ocean_lateral_mix->module~rdb_multilayer_state module~rdb_ocean_meke->module~rdb_multilayer_state module~rdb_ocean_meke->module~rdb_ocean_gm module~rdb_ocean_meke->module~rdb_ocean_varmix module~rdb_ocean_meke->module~rdb_ocean_wave_speed module~rdb_ocean_min_thickness->module~rdb_multilayer_state module~rdb_ocean_mle->module~rdb_multilayer_state module~rdb_ocean_mle->module~rdb_ocean_epbl module~rdb_ocean_mle->module~rdb_ocean_surface_stress module~rdb_ocean_obc_baroclinic->module~rdb_multilayer_state module~rdb_ocean_periodic->module~rdb_multilayer_state module~rdb_ocean_pressure_force->module~rdb_multilayer_state module~rdb_ocean_pseudo_salt rdb_ocean_pseudo_salt module~rdb_ocean_pseudo_salt->module~rdb_multilayer_state module~rdb_ocean_redi->module~rdb_multilayer_state module~rdb_ocean_remap->module~rdb_multilayer_state module~rdb_ocean_sponge->module~rdb_multilayer_state module~rdb_ocean_state rdb_ocean_state module~rdb_ocean_state->module~rdb_multilayer_state module~rdb_ocean_state->module~rdb_continuity module~rdb_ocean_state->module~rdb_coriolis_adv module~rdb_ocean_state->module~rdb_ocean_bottom_drag module~rdb_ocean_state->module~rdb_ocean_cavity_flux module~rdb_ocean_state->module~rdb_ocean_dyn module~rdb_ocean_state->module~rdb_ocean_epbl module~rdb_ocean_state->module~rdb_ocean_gm module~rdb_ocean_state->module~rdb_ocean_hdiff_tracer module~rdb_ocean_state->module~rdb_ocean_horizontal_viscosity module~rdb_ocean_state->module~rdb_ocean_isopycnal_slopes module~rdb_ocean_state->module~rdb_ocean_kappa_shear module~rdb_ocean_state->module~rdb_ocean_lateral_mix module~rdb_ocean_state->module~rdb_ocean_meke module~rdb_ocean_state->module~rdb_ocean_mle module~rdb_ocean_state->module~rdb_ocean_periodic module~rdb_ocean_state->module~rdb_ocean_pressure_force module~rdb_ocean_state->module~rdb_ocean_pseudo_salt module~rdb_ocean_state->module~rdb_ocean_redi module~rdb_ocean_state->module~rdb_ocean_sponge module~rdb_ocean_state->module~rdb_ocean_surface_flux module~rdb_ocean_state->module~rdb_ocean_surface_stress module~rdb_ocean_state->module~rdb_ocean_tidal_mixing module~rdb_ocean_state->module~rdb_ocean_top_drag module~rdb_ocean_state->module~rdb_ocean_varmix module~rdb_ocean_state->module~rdb_ocean_vdiff module~rdb_ocean_state->module~rdb_ocean_vertical_advection module~rdb_ocean_state->module~rdb_ocean_vmix module~rdb_ocean_state->module~rdb_ocean_wave_speed module~rdb_ocean_z_init rdb_ocean_z_init module~rdb_ocean_state->module~rdb_ocean_z_init module~rdb_config rdb_config module~rdb_ocean_state->module~rdb_config module~rdb_ocean_data_forcing rdb_ocean_data_forcing module~rdb_ocean_state->module~rdb_ocean_data_forcing module~rdb_decomp rdb_decomp module~rdb_ocean_state->module~rdb_decomp module~rdb_ocean_data_input rdb_ocean_data_input module~rdb_ocean_state->module~rdb_ocean_data_input module~rdb_ocean_restart_io rdb_ocean_restart_io module~rdb_ocean_state->module~rdb_ocean_restart_io module~rdb_ocean_surface_flux->module~rdb_multilayer_state module~rdb_ocean_surface_stress->module~rdb_multilayer_state module~rdb_ocean_tidal_mixing->module~rdb_multilayer_state module~rdb_ocean_top_drag->module~rdb_multilayer_state module~rdb_ocean_varmix->module~rdb_multilayer_state module~rdb_ocean_varmix->module~rdb_ocean_isopycnal_slopes module~rdb_ocean_varmix->module~rdb_ocean_wave_speed module~rdb_ocean_vdiff->module~rdb_multilayer_state module~rdb_ocean_vertical_advection->module~rdb_multilayer_state module~rdb_ocean_vmix->module~rdb_multilayer_state module~rdb_ocean_vmix->module~rdb_ocean_surface_flux module~rdb_ocean_vmix->module~rdb_ocean_surface_stress module~rdb_ocean_wave_speed->module~rdb_multilayer_state module~rdb_ocean_z_init->module~rdb_multilayer_state module~rdb_ocean_z_init->module~rdb_config module~rdb_config->module~rdb_ice_init module~rdb_driver rdb_driver module~rdb_driver->module~rdb_ocean_console_stats module~rdb_driver->module~rdb_ocean_dyn module~rdb_driver->module~rdb_ocean_state module~rdb_driver->module~rdb_config module~rdb_ocean_engine rdb_ocean_engine module~rdb_driver->module~rdb_ocean_engine module~rdb_driver->module~rdb_halo module~rdb_handle rdb_handle module~rdb_handle->module~rdb_ocean_state module~rdb_handle->module~rdb_config module~rdb_handle->module~rdb_ocean_engine module~rdb_ice_ocean_coupler rdb_ice_ocean_coupler module~rdb_ice_ocean_coupler->module~rdb_ocean_halo_state module~rdb_ice_ocean_coupler->module~rdb_ocean_surface_flux module~rdb_ice_ocean_coupler->module~rdb_ocean_surface_stress module~rdb_ocean_api rdb_ocean_api module~rdb_ocean_api->module~rdb_ocean_dyn module~rdb_ocean_api->module~rdb_ocean_eos_compute module~rdb_ocean_api->module~rdb_ocean_fold_apply module~rdb_ocean_api->module~rdb_ocean_periodic module~rdb_ocean_api->module~rdb_config module~rdb_ocean_api->module~rdb_handle module~rdb_ocean_diag_derived rdb_ocean_diag_derived module~rdb_ocean_api->module~rdb_ocean_diag_derived module~rdb_ocean_diag_fills rdb_ocean_diag_fills module~rdb_ocean_api->module~rdb_ocean_diag_fills module~rdb_ocean_api->module~rdb_ocean_engine module~rdb_ocean_halo_width rdb_ocean_halo_width module~rdb_ocean_api->module~rdb_ocean_halo_width module~rdb_ocean_data_forcing->module~rdb_ocean_halo_state module~rdb_ocean_data_forcing->module~rdb_ocean_surface_flux module~rdb_ocean_data_forcing->module~rdb_ocean_surface_stress module~rdb_ocean_data_forcing->module~rdb_config module~rdb_ocean_data_forcing->module~rdb_ocean_data_input module~rdb_ocean_diag_derived->module~rdb_ocean_state module~rdb_ocean_diag_derived->module~rdb_ocean_diag_fills module~rdb_ocean_diag_fills->module~rdb_ocean_pseudo_salt module~rdb_ocean_diag_fills->module~rdb_ocean_state module~rdb_ocean_engine->module~rdb_ice_basal_flux module~rdb_ocean_engine->module~rdb_ice_evp module~rdb_ocean_engine->module~rdb_ice_frazil module~rdb_ocean_engine->module~rdb_ice_frazil_uptake module~rdb_ocean_engine->module~rdb_ice_init module~rdb_ocean_engine->module~rdb_ice_itd module~rdb_ocean_engine->module~rdb_ice_thermo_driver module~rdb_ocean_engine->module~rdb_ice_transport module~rdb_ocean_engine->module~rdb_ocean_cavity_flux module~rdb_ocean_engine->module~rdb_ocean_dyn module~rdb_ocean_engine->module~rdb_ocean_fold_apply module~rdb_ocean_engine->module~rdb_ocean_geothermal module~rdb_ocean_engine->module~rdb_ocean_halo_state module~rdb_ocean_engine->module~rdb_ocean_periodic module~rdb_ocean_engine->module~rdb_ocean_sponge module~rdb_ocean_engine->module~rdb_ocean_state module~rdb_ocean_engine->module~rdb_ocean_surface_flux module~rdb_ocean_engine->module~rdb_ocean_surface_stress module~rdb_ocean_engine->module~rdb_config module~rdb_ocean_engine->module~rdb_ice_ocean_coupler module~rdb_ocean_engine->module~rdb_ocean_data_forcing module~rdb_ocean_engine->module~rdb_ocean_diag_derived module~rdb_ocean_engine->module~rdb_ocean_diag_fills module~rdb_ocean_engine->module~rdb_ocean_halo module~rdb_ocean_setup rdb_ocean_setup module~rdb_ocean_engine->module~rdb_ocean_setup module~rdb_ocean_engine->module~rdb_decomp module~rdb_ocean_engine->module~rdb_ocean_data_input module~rdb_ocean_stability_audit rdb_ocean_stability_audit module~rdb_ocean_engine->module~rdb_ocean_stability_audit module~rdb_state rdb_state module~rdb_ocean_engine->module~rdb_state module~rdb_ocean_engine->module~rdb_halo module~rdb_ocean_engine->module~rdb_ocean_fold_exchange module~rdb_ocean_halo->module~rdb_ocean_periodic module~rdb_ocean_halo->module~rdb_decomp module~rdb_ocean_halo_width->module~rdb_coriolis_adv module~rdb_ocean_setup->module~rdb_coriolis_adv module~rdb_ocean_setup->module~rdb_ocean_bottom_drag module~rdb_ocean_setup->module~rdb_ocean_dyn module~rdb_ocean_setup->module~rdb_ocean_epbl module~rdb_ocean_setup->module~rdb_ocean_fold_apply module~rdb_ocean_setup->module~rdb_ocean_geothermal module~rdb_ocean_setup->module~rdb_ocean_halo_state module~rdb_ocean_setup->module~rdb_ocean_horizontal_viscosity module~rdb_ocean_setup->module~rdb_ocean_lateral_mix module~rdb_ocean_setup->module~rdb_ocean_pressure_force module~rdb_ocean_setup->module~rdb_ocean_sponge module~rdb_ocean_setup->module~rdb_ocean_state module~rdb_ocean_setup->module~rdb_ocean_surface_flux module~rdb_ocean_setup->module~rdb_ocean_surface_stress module~rdb_ocean_setup->module~rdb_ocean_top_drag module~rdb_ocean_setup->module~rdb_ocean_vdiff module~rdb_ocean_setup->module~rdb_ocean_vmix module~rdb_ocean_setup->module~rdb_config module~rdb_ocean_setup->module~rdb_ocean_halo module~rdb_ocean_setup->module~rdb_decomp module~rdb_ocean_setup->module~rdb_halo module~rdb_ocean_setup->module~rdb_ocean_fold_exchange proc~validate_config validate_config proc~validate_config->module~rdb_coriolis_adv proc~validate_config->module~rdb_ocean_bottom_drag proc~validate_config->module~rdb_ocean_horizontal_viscosity proc~validate_config->module~rdb_ocean_lateral_mix proc~validate_config->module~rdb_ocean_pressure_force proc~validate_config->module~rdb_ocean_pseudo_salt proc~validate_config->module~rdb_ocean_surface_flux proc~validate_config->module~rdb_ocean_tidal_mixing proc~validate_config->module~rdb_ocean_top_drag proc~validate_config->module~rdb_ocean_vmix module~rdb_barotropic_substep->module~rdb_ocean_halo module~rdb_barotropic_substep->module~rdb_ocean_fold_exchange module~rdb_config_schema rdb_config_schema module~rdb_config_schema->module~rdb_config module~rdb_decomp->module~rdb_config module~rdb_ocean_bt_wide->module~rdb_ocean_halo module~rdb_ocean_bt_wide->module~rdb_barotropic_substep module~rdb_ocean_data_input->module~rdb_config module~rdb_ocean_stability_audit->module~rdb_config module~rdb_state->module~rdb_config module~rdb_halo->module~rdb_decomp module~rdb_ocean_fold_exchange->module~rdb_decomp module~rdb_ocean_restart_io->module~rdb_decomp proc~ocean_cavity_mass_step ocean_cavity_mass_step proc~ocean_cavity_mass_step->module~rdb_halo

Derived Types

type, public ::  multilayer_state_t

Per-layer multilayer C-grid state.

Components

Type Visibility Attributes Name Initial
real(kind=wp), public, allocatable :: flux_h_layer(:,:,:)
real(kind=wp), public, allocatable :: h_av_layer(:,:,:)

Step time-mean layer thickness, shape (nx, ny, nz_ml). MOM6 h_av.

real(kind=wp), public, allocatable :: h_layer(:,:,:)

Layer thickness at cell centres (m), shape (nx, ny, nz_ml).

real(kind=wp), public, allocatable :: h_layer0(:,:,:)

RK2 save of h_layer at start of outer step.

real(kind=wp), public, allocatable :: heat_budget_geothermal(:,:,:)

hTr (K·m) change per cell per step attributed to the geothermal bottom-heat-flux kernel. Populated only at the lowest massive layer (k=1 in the common case); zero elsewhere. Sign convention: positive = source into the ocean from below.

real(kind=wp), public, allocatable :: heat_budget_hdiff(:,:,:)

hTr (K·m) change per cell per layer per step attributed to the Laplacian horizontal-diffusion kernel for temperature. Closed walls (wall faces forced to zero) ⇒ spatial integral telescopes to zero.

real(kind=wp), public, allocatable :: heat_budget_horiz_adv(:,:,:)

hTr (°C·m) change per cell per layer, accumulated (summed) across BOTH RK2 stages from t=0 (+= each stage, never zeroed mid-step; no 0.5 weight here — the console applies it), attributed to the continuity-PPM HORIZONTAL tracer advection (zonal + meridional divergence of the tracer mass flux). Interior sum telescopes to the net advective flux across the open boundaries; zero in a closed basin. Only the fused (dt_tracer_advect_ratio=1) path fills it — see the console reporter for the >1 fallback.

real(kind=wp), public, allocatable :: heat_budget_remap(:,:,:)

Per-cell hTr_new − hTr_old from the ALE remap step for temperature. Same column-telescope property.

real(kind=wp), public, allocatable :: heat_budget_sponge(:,:,:)

hTr (K·m) change per cell per layer per step attributed to the map-driven sponge’s tracer relaxation (rdb_ocean_sponge::relax_tracer_budget_impl). Zero unless &ocean_sponge_nml enable=.true., relax_tracers=.true.. Sign convention: positive = source into the ocean (relaxing toward a warmer reference). Not drained by the sponge.

real(kind=wp), public, allocatable :: heat_budget_surface(:,:,:)

hTr (K·m) change per cell per step attributed to the surface heat-flux kernel. Populated only at k_top(i,j), the first LIVE layer — which is nz_ml on every column with no top-side filler, i.e. everywhere but an ice-covered column under a quasi-geopotential coordinate; zero elsewhere. Sign convention: positive = source into the ocean.

real(kind=wp), public, allocatable :: heat_budget_vdiff(:,:,:)

hTr (K·m) change per cell per layer per step attributed to the backward-Euler vertical-diffusion tridiag solve for temperature. Closed BCs (no flux through bed or surface) ⇒ column sum telescopes to zero.

real(kind=wp), public, allocatable :: heat_budget_vert_adv(:,:,:)

hTr (K·m) change per cell per layer per step attributed to the first-order-upwind vertical-advection kernel for temperature. Closed-BC kernel: column sum telescopes to zero, so the spatial integral is zero to FP.

real(kind=wp), public, allocatable :: hu_face_x_layer(:,:,:)

h*u at the same west-face stagger (m^2/s).

real(kind=wp), public, allocatable :: hv_face_y_layer(:,:,:)

h*v at the same south-face stagger.

integer, public :: idx_age = 0

Index into tracers(:) for the ideal-age tracer. 0 = not registered. When > 0, the dyn step ages at 1 s/s and zeros the surface layer (k = nz_ml) every step. No EOS coupling.

integer, public :: idx_pseudo_salt = 0

Index into tracers(:) for the pseudo-salt verification tracer. 0 = not registered.

integer, public :: idx_salinity = 0

Index into tracers(:) for salinity. 0 = not registered.

integer, public :: idx_temperature = 0

Index into tracers(:) for temperature. 0 = not registered.

logical, public :: is_init = .false.

True between init and destroy. Prefer this to allocated(...) — tracks GPU device attachment too.

integer, public, allocatable :: k_bot(:,:)

Deepest live layer at cell centres, shape (nx, ny).

integer, public, allocatable :: k_bot_u(:,:)

u-face twin, shape (nx+1, ny). max of the two bounding columns — the mirror of k_top_u’s min: a face carries water in layer k only where BOTH columns are live there (metrics%open_u), so the deepest layer the FACE has is the SHALLOWER of the two column bottoms, i.e. the larger index. min would put the bottom drag and the implicit-drag fold on a row that is a filler on one side (a closed face).

integer, public, allocatable :: k_bot_v(:,:)

v-face twin, shape (nx, ny+1). Same max rule.

integer, public, allocatable :: k_top(:,:)

Shallowest live layer at cell centres, shape (nx, ny).

integer, public, allocatable :: k_top_u(:,:)

u-face twin, shape (nx+1, ny). min of the two bounding columns, NOT max: a velocity face carries water in layer k only where BOTH abutting columns are live there — that is the same statement metrics%open_u makes — so the shallowest layer the FACE has is the DEEPER of the two column tops, i.e. the smaller index. Taking max would put the ice-ocean drag and the implicit stress fold on a row that is a filler on one side.

integer, public, allocatable :: k_top_v(:,:)

v-face twin, shape (nx, ny+1). Same min rule.

real(kind=wp), public, allocatable :: mass_budget_continuity(:,:,:)

Mass change per cell per step attributed to continuity-PPM divergence (m·dt units; the budget integral over volume recovers m³). Shape (nx, ny, nz_ml). Zero in a closed basin (perfect telescope).

real(kind=wp), public, allocatable :: mass_budget_remap(:,:,:)

Per-cell h_layer_new − h_layer_old from the ALE remap step. Column-conservative ⇒ Σ_k = 0 per (i, j). Non-zero residual flags a remap conservation leak.

real(kind=wp), public, allocatable :: mass_flux_x_layer(:,:,:)
real(kind=wp), public, allocatable :: mass_flux_y_layer(:,:,:)
real(kind=wp), public :: mass_out = 0.0_wp

Cumulative mass (kg) that has left the domain through its open boundaries since t=0 (positive = outflow), accumulated per RK2 stage from the continuity divergence (flux_h_layer) so the console mass Error closes to round-off even with open BCs.

integer(kind=int64), public :: mass_out_efp(EFP_DIGITS) = 0_int64

This rank’s mass_out as EFP bins (rdb_efp layout).

logical, public :: mass_out_efp_on = .false.

Also accumulate mass_out as an order-invariant extended-fixed- point sum (mass_out_efp), set from &ocean_diag_nml reproducing_sums: the FP running sum’s last digits depend on the decomposition (it is a telescoping sum of large cancelling terms), the EFP one does not, so the console out column is the same on every rank count.

integer(kind=int64), public :: mass_out_efp_poison = 0_int64

Non-finite counter for mass_out_efp, mirroring efp_t%poison (this accumulator is a raw bin array, not an efp_t, since it is a standalone module-level running total rather than a collective-combined value – see efp_t’s docstring in rdb_efp). ocean_accumulate_mass_out adds a slab’s poison count here the same way it adds the slab’s carried bins; ocean_console_stats_report folds it into efp_local(IX_MOUT)%poison so a NaN/Inf flux_h_layer poisons the console’s Mass out column instead of laundering into a plausible finite number.

logical, public :: mass_out_tracked = .false.

Set once the dyn step has accumulated mass_out, so the console only activates the mass budget on a path that feeds it.

real(kind=wp), public :: mass_src = 0.0_wp

Cumulative mass (kg) ADDED to the domain since t=0 by a tracked volume SOURCE (positive = added), the mass twin of salt_budget_surface / heat_budget_surface. Accumulated with the same per-stage weight as mass_out, so the console residual (M - M0) + mass_out - mass_src stays at round-off while the total legitimately grows.

Read more…
integer, public :: nz_ml = 0

Number of multilayer levels (k=1 bed, k=nz_ml surface).

real(kind=wp), public, allocatable :: p_top(:,:)
logical, public :: registry_locked = .false.

Set by enter_data, cleared by exit_data. While locked, register_passive_tracer REFUSES: the device map snapshots tracers(:) element-by-element, so a slot appended after the map has no device hTr and the first kernel touching it faults on the mem:separate build.

real(kind=wp), public, allocatable :: rho_layer(:,:,:)
real(kind=wp), public, allocatable :: salt_budget_hdiff(:,:,:)

Salinity analogue of heat_budget_hdiff.

real(kind=wp), public, allocatable :: salt_budget_horiz_adv(:,:,:)

Salinity analogue (PSU·m) of heat_budget_horiz_adv.

real(kind=wp), public, allocatable :: salt_budget_remap(:,:,:)

Salinity analogue.

real(kind=wp), public, allocatable :: salt_budget_sponge(:,:,:)

hTr (PSU·m) change per cell per layer per step attributed to the map-driven sponge’s tracer relaxation. Same shape + indexing convention as heat_budget_sponge.

real(kind=wp), public, allocatable :: salt_budget_surface(:,:,:)

hTr (PSU·m) change per cell per step attributed to the surface salt-flux kernel. Same shape + indexing convention as heat_budget_surface (k_top, not a literal nz_ml).

real(kind=wp), public, allocatable :: salt_budget_vdiff(:,:,:)

Salinity analogue of heat_budget_vdiff.

real(kind=wp), public, allocatable :: salt_budget_vert_adv(:,:,:)

hTr (PSU·m) change per cell per layer per step for salinity. Same closed-BC telescope property.

type(tracer_t), public, allocatable :: tracers(:)

Registered prognostic tracers.

real(kind=wp), public, allocatable :: u_av_layer(:,:,:)

Step time-mean x face velocity, shape (nx+1, ny, nz_ml). MOM6 u_av.

real(kind=wp), public, allocatable :: u_face_x_layer(:,:,:)

x-velocity at the WEST face of cell (i,j,k), shape (nx+1, ny, nz_ml): face i sits between cells i-1 and i, so a cell’s divergence reads faces (i, i+1) — the convention every consumer (continuity flux(i+1)-flux(i), metrics%wet_u, the kappa-shear centre average) actually uses. (“east face” here previously was a stale docstring.)

real(kind=wp), public, allocatable :: u_face_x_layer0(:,:,:)
real(kind=wp), public, allocatable :: v_av_layer(:,:,:)

Step time-mean y face velocity, shape (nx, ny+1, nz_ml). MOM6 v_av.

real(kind=wp), public, allocatable :: v_face_y_layer(:,:,:)

y-velocity at the SOUTH face of cell (i,j,k), shape (nx, ny+1, nz_ml): face j sits between cells j-1 and j (same stagger rule as u_face_x_layer).

real(kind=wp), public, allocatable :: v_face_y_layer0(:,:,:)
real(kind=wp), public, allocatable :: w_interface(:,:,:)
real(kind=wp), public, allocatable :: wet_mask(:,:)

Type-Bound Procedures

procedure, public, non_overridable :: bytes => multilayer_state_bytes
procedure, public, non_overridable :: destroy => multilayer_state_destroy
procedure, public, non_overridable :: enforce_vanished_content => multilayer_enforce_vanished_content
procedure, public, non_overridable :: enforce_vanished_content_host => multilayer_enforce_vanished_content_host
procedure, public, non_overridable :: enter_data => multilayer_state_enter_data
procedure, public, non_overridable :: exit_data => multilayer_state_exit_data
procedure, public, non_overridable :: init => multilayer_state_init
procedure, public, non_overridable :: register_passive_tracer => multilayer_register_passive_tracer
procedure, public, non_overridable :: scan_vanished_content => multilayer_scan_vanished_content

Functions

private pure function multilayer_state_bytes(this) result(nbytes)

Counted allocatable footprint of the ocean C-grid layer slot: the layer prognostics + face transports + RK2 saves + density/vertical diagnostics, the per-tracer registry (each tracer sums its own arrays; ideal-age rides the registry when on), and the device-resident conservation-budget accumulators.

Arguments

Type IntentOptional Attributes Name
class(multilayer_state_t), intent(in) :: this

Return Value integer(kind=int64)


Subroutines

private pure subroutine enforce_vanished_one_impl(nx, ny, nz, h_layer, hTr)

Flat-impl of the I1′ sweep for ONE tracer. Explicit-shape dummies so NVHPC does not walk a descriptor per launch.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nx
integer, intent(in) :: ny
integer, intent(in) :: nz
real(kind=wp), intent(in) :: h_layer(nx,ny,nz)
real(kind=wp), intent(inout) :: hTr(nx,ny,nz)

private subroutine multilayer_enforce_vanished_content(this, nx, ny)

THE enforcement point for invariant I1′.

Read more…

Arguments

Type IntentOptional Attributes Name
class(multilayer_state_t), intent(inout) :: this
integer, intent(in) :: nx

i-extent of h_layer / hTr (total, incl. halos).

integer, intent(in) :: ny

j-extent (total, incl. halos).

private subroutine multilayer_enforce_vanished_content_host(this, nx, ny)

HOST twin of enforce_vanished_content, for SETUP only. The seed (ocean_state_seed_land_cells) runs before enter_data, where a do concurrent on the offload build would work on device memory that is not mapped yet (mem:separate: no implicit copies). Plain host loops over the SAME included rdb_vl_merge_content, so the seeded state satisfies I1′ by the one definition. Never call it on a device-resident state.

Arguments

Type IntentOptional Attributes Name
class(multilayer_state_t), intent(inout) :: this
integer, intent(in) :: nx

i-extent (total, incl. halos).

integer, intent(in) :: ny

j-extent (total, incl. halos).

private subroutine multilayer_register_passive_tracer(this, grid, name, units, long_name, idx)

Append a passive tracer (eos_coeff = 0, budget_id = NONE) to the registry, growing tracers(:) past the default S/T[/age] set. Returns its slot in idx, or idx = 0 on refusal (registry not init’d, or locked by enter_data). MUST be called after init and BEFORE enter_data — and, on the ocean path, before ocean_bc_state_init sizes bc%n_tracers. Caller populates hTr once layer thicknesses exist, and may set tracers(idx)%standard_name / the pipeline opt-outs directly (public components). S/T/age keep their indices.

Arguments

Type IntentOptional Attributes Name
class(multilayer_state_t), intent(inout) :: this
type(hgrid_t), intent(in) :: grid
character(len=*), intent(in) :: name
character(len=*), intent(in) :: units
character(len=*), intent(in) :: long_name
integer, intent(out) :: idx

private pure subroutine multilayer_scan_vanished_content(this, nx, ny, n_bad, worst)

Pure I1′ TRIPWIRE scan — counts the vanished cells that do NOT hold their donor’s concentration (rdb_vl_holds_live_conc: |hTr − h·c_live| > 1e-12·|h·c_live|, i.e. hTr ≠ 0 in a column with no live layer) and reports the largest offending |hTr − h·c_live|, without touching anything. Two device reductions per tracer, two scalars out; no H←D copy on the healthy path.

Read more…

Arguments

Type IntentOptional Attributes Name
class(multilayer_state_t), intent(in) :: this
integer, intent(in) :: nx
integer, intent(in) :: ny
integer, intent(out) :: n_bad

Number of (i,j,k,tracer) cells violating I1′.

real(kind=wp), intent(out) :: worst

Largest |hTr − h·c_live| found in a vanished layer (0 when clean).

private subroutine multilayer_state_destroy(this)

Arguments

Type IntentOptional Attributes Name
class(multilayer_state_t), intent(inout) :: this

private subroutine multilayer_state_enter_data(this)

Attach the C-grid multilayer allocatables to the device. The tracer registry uses the two-step pattern: array descriptor first, then each element’s hTr / hTr0 — NVHPC stdpar can’t dereference tracers(it)%hTr from a do-concurrent body otherwise.

Arguments

Type IntentOptional Attributes Name
class(multilayer_state_t), intent(inout) :: this

private subroutine multilayer_state_enter_data_impl(this)

Arguments

Type IntentOptional Attributes Name
type(multilayer_state_t), intent(inout) :: this

private subroutine multilayer_state_exit_data(this)

Reverse of enter_data. Copy out the prognostic fields and the tracer hTr arrays (so post-run host inspection works), drop scratch + RK saves. Tracer registry tears down per- element first, then the array descriptor — mirror of enter_data order.

Arguments

Type IntentOptional Attributes Name
class(multilayer_state_t), intent(inout) :: this

private subroutine multilayer_state_exit_data_impl(this)

Arguments

Type IntentOptional Attributes Name
type(multilayer_state_t), intent(inout) :: this

private subroutine multilayer_state_init(this, grid, with_ideal_age)

Allocate per-layer C-grid arrays at the grid size and the configured layer count (caller must set this%nz_ml first). Registers salinity + temperature with default identity strings. When with_ideal_age is present and true, also registers an ideal-age tracer at index 3 (see rdb_ocean_ideal_age).

Arguments

Type IntentOptional Attributes Name
class(multilayer_state_t), intent(inout) :: this
type(hgrid_t), intent(in) :: grid
logical, intent(in), optional :: with_ideal_age

private pure subroutine scan_vanished_one_impl(nx, ny, nz, h_layer, hTr, n_bad, worst)

Flat-impl of the I1′ scan for ONE tracer. Per column: find the topmost live layer, then walk DOWN carrying the nearest live layer above — the donor map rdb_vl_merge_content / rdb_vl_column_conc use — and test each filler against its donor’s hTr/h.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nx
integer, intent(in) :: ny
integer, intent(in) :: nz
real(kind=wp), intent(in) :: h_layer(nx,ny,nz)
real(kind=wp), intent(in) :: hTr(nx,ny,nz)
integer, intent(out) :: n_bad
real(kind=wp), intent(out) :: worst