rdb_ice_mass Module

Ports of the subset of ice_resize_SIS2 (SIS2_ice_thm.F90:1010-1338) needed by the Winton column step: bottom freezing, top/bottom melt peel, and equal-mass layer rebalancing (rebalance_ice_layers, SIS2_ice_thm.F90:1448-1512). Ported from the validated prototype sis2_resize.py (Apache-2.0 source attribution as above).

PR 26 ports the snow source term (ice_snow_accumulate, below) — the first branch SIS2 runs in ice_resize_SIS2 (SIS2_ice_thm.F90:1122), so it sits first in this module too. PR 27 ports the Archimedes freeboard snow-ice flooding conversion (ice_snow_ice_flood, below) — the FINAL substantive block of ice_resize_SIS2 (SIS2_ice_thm.F90:1303-1320), so it sits last in this module too. Pond/evap/rain mass paths remain deliberately NOT ported. TODO(PR-35): pond mass paths. Evap/rain need atmospheric fields Roundabout does not carry (PR-55 at the earliest).

All procedures pure, !$acc routine seq, explicit-shape, TOP-DOWN columns (index 0 = snow, 1..nk = ice top->bottom) — identical convention to rdb_ice_column.


Uses

  • module~~rdb_ice_mass~~UsesGraph module~rdb_ice_mass rdb_ice_mass module~rdb_constants rdb_constants module~rdb_ice_mass->module~rdb_constants module~rdb_ice_enthalpy rdb_ice_enthalpy module~rdb_ice_mass->module~rdb_ice_enthalpy pic_types pic_types module~rdb_constants->pic_types module~rdb_ice_enthalpy->module~rdb_constants

Used by

  • module~~rdb_ice_mass~~UsedByGraph module~rdb_ice_mass rdb_ice_mass module~rdb_ice_column rdb_ice_column module~rdb_ice_column->module~rdb_ice_mass module~rdb_ice_frazil_uptake rdb_ice_frazil_uptake module~rdb_ice_frazil_uptake->module~rdb_ice_mass module~rdb_ice_frazil_uptake->module~rdb_ice_column module~rdb_ice_state rdb_ice_state module~rdb_ice_frazil_uptake->module~rdb_ice_state module~rdb_ice_basal_flux rdb_ice_basal_flux module~rdb_ice_basal_flux->module~rdb_ice_column module~rdb_ice_basal_flux->module~rdb_ice_state module~rdb_ice_evp rdb_ice_evp module~rdb_ice_evp->module~rdb_ice_column module~rdb_ice_evp->module~rdb_ice_state module~rdb_ice_init rdb_ice_init module~rdb_ice_init->module~rdb_ice_column module~rdb_ice_init->module~rdb_ice_state module~rdb_ice_state->module~rdb_ice_column module~rdb_ice_thermo_driver rdb_ice_thermo_driver module~rdb_ice_thermo_driver->module~rdb_ice_column module~rdb_ice_thermo_driver->module~rdb_ice_state module~rdb_ice_transport rdb_ice_transport module~rdb_ice_transport->module~rdb_ice_column module~rdb_ice_transport->module~rdb_ice_state module~rdb_ice_itd rdb_ice_itd 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_ocean_console_stats rdb_ocean_console_stats module~rdb_ocean_console_stats->module~rdb_ice_column module~rdb_ocean_diag_fills rdb_ocean_diag_fills module~rdb_ocean_diag_fills->module~rdb_ice_column module~rdb_ocean_state rdb_ocean_state module~rdb_ocean_diag_fills->module~rdb_ocean_state module~rdb_ocean_engine rdb_ocean_engine module~rdb_ocean_engine->module~rdb_ice_frazil_uptake module~rdb_ocean_engine->module~rdb_ice_basal_flux module~rdb_ocean_engine->module~rdb_ice_evp module~rdb_ocean_engine->module~rdb_ice_init module~rdb_ocean_engine->module~rdb_ice_thermo_driver module~rdb_ocean_engine->module~rdb_ice_transport module~rdb_ocean_engine->module~rdb_ocean_diag_fills module~rdb_config rdb_config module~rdb_ocean_engine->module~rdb_config module~rdb_ice_atm_forcing rdb_ice_atm_forcing module~rdb_ocean_engine->module~rdb_ice_atm_forcing module~rdb_ocean_engine->module~rdb_ice_itd module~rdb_ice_ocean_coupler rdb_ice_ocean_coupler module~rdb_ocean_engine->module~rdb_ice_ocean_coupler module~rdb_ice_snow rdb_ice_snow module~rdb_ocean_engine->module~rdb_ice_snow module~rdb_ocean_diag_derived rdb_ocean_diag_derived module~rdb_ocean_engine->module~rdb_ocean_diag_derived module~rdb_ocean_dyn rdb_ocean_dyn module~rdb_ocean_engine->module~rdb_ocean_dyn module~rdb_ocean_engine->module~rdb_ocean_halo_state module~rdb_ocean_engine->module~rdb_ocean_state module~rdb_decomp rdb_decomp module~rdb_ocean_engine->module~rdb_decomp module~rdb_ocean_data_forcing rdb_ocean_data_forcing module~rdb_ocean_engine->module~rdb_ocean_data_forcing module~rdb_ocean_data_input rdb_ocean_data_input module~rdb_ocean_engine->module~rdb_ocean_data_input module~rdb_ocean_setup rdb_ocean_setup module~rdb_ocean_engine->module~rdb_ocean_setup 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_config->module~rdb_ice_init module~rdb_driver rdb_driver module~rdb_driver->module~rdb_ocean_console_stats module~rdb_driver->module~rdb_ocean_engine module~rdb_driver->module~rdb_config module~rdb_driver->module~rdb_ocean_dyn module~rdb_driver->module~rdb_ocean_state module~rdb_handle rdb_handle module~rdb_handle->module~rdb_ocean_engine module~rdb_handle->module~rdb_config module~rdb_handle->module~rdb_ocean_state module~rdb_ice_atm_forcing->module~rdb_ice_state module~rdb_ice_itd->module~rdb_ice_state module~rdb_ice_ocean_coupler->module~rdb_ice_state module~rdb_ice_ocean_coupler->module~rdb_ocean_halo_state module~rdb_ice_snow->module~rdb_ice_state module~rdb_ocean_api rdb_ocean_api module~rdb_ocean_api->module~rdb_ocean_diag_fills module~rdb_ocean_api->module~rdb_ocean_engine module~rdb_ocean_api->module~rdb_config module~rdb_ocean_api->module~rdb_handle module~rdb_ocean_api->module~rdb_ocean_diag_derived module~rdb_ocean_api->module~rdb_ocean_dyn module~rdb_ocean_diag_derived->module~rdb_ocean_diag_fills module~rdb_ocean_diag_derived->module~rdb_ocean_state module~rdb_ocean_dyn->module~rdb_ocean_console_stats module~rdb_ocean_dyn->module~rdb_ocean_halo_state module~rdb_ocean_halo_state->module~rdb_ice_state module~rdb_ocean_state->module~rdb_ice_state module~rdb_ocean_state->module~rdb_config module~rdb_ocean_state->module~rdb_ocean_dyn module~rdb_ocean_state->module~rdb_decomp module~rdb_ocean_state->module~rdb_ocean_data_forcing module~rdb_ocean_state->module~rdb_ocean_data_input module~rdb_ocean_z_init rdb_ocean_z_init module~rdb_ocean_state->module~rdb_ocean_z_init module~rdb_config_schema rdb_config_schema module~rdb_config_schema->module~rdb_config module~rdb_decomp->module~rdb_config module~rdb_ocean_data_forcing->module~rdb_config module~rdb_ocean_data_forcing->module~rdb_ocean_halo_state module~rdb_ocean_data_forcing->module~rdb_ocean_data_input module~rdb_ocean_data_input->module~rdb_config module~rdb_ocean_setup->module~rdb_config module~rdb_ocean_setup->module~rdb_ocean_dyn module~rdb_ocean_setup->module~rdb_ocean_halo_state module~rdb_ocean_setup->module~rdb_ocean_state module~rdb_ocean_setup->module~rdb_decomp module~rdb_ocean_stability_audit->module~rdb_config module~rdb_ocean_z_init->module~rdb_config module~rdb_state->module~rdb_config module~rdb_halo rdb_halo module~rdb_halo->module~rdb_decomp module~rdb_ocean_fold_exchange rdb_ocean_fold_exchange module~rdb_ocean_fold_exchange->module~rdb_decomp module~rdb_ocean_halo rdb_ocean_halo module~rdb_ocean_halo->module~rdb_decomp module~rdb_ocean_restart_io rdb_ocean_restart_io module~rdb_ocean_restart_io->module~rdb_decomp

Subroutines

public pure subroutine ice_bottom_freeze(nk, m_lay, enthalpy, salin, bmelt, enth_ocean, salin_freeze, h2o_ocn_to_ice)

Bottom-freezing branch of ice_resize_SIS2 (SIS2_ice_thm.F90:1164-1188; prototype sis2_resize.py:20-45). When bmelt < 0 (net upward heat deficit at the base), freeze ocean water onto the bottom ice layer: enth_freeze = min(enthalpy(nk), enth_ocean - min_denth_freeze), m_freeze = -bmelt/(enth_ocean - enth_freeze), mass-weighted mix of the bottom layer’s enthalpy + salinity, bmelt reset to 0.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nk

Number of ice layers (declared first — decl-order).

real(kind=wp), intent(inout) :: m_lay(0:nk)

Layer masses (kg/m²), 0 = snow, 1..nk = ice.

real(kind=wp), intent(inout) :: enthalpy(0:nk)

Layer specific enthalpies (J/kg).

real(kind=wp), intent(inout) :: salin(0:nk)

Layer bulk salinities (PSU).

real(kind=wp), intent(inout) :: bmelt

Accumulated bottom melting/freezing energy (J/m²); reset to 0 on exit when freezing occurred.

real(kind=wp), intent(in) :: enth_ocean

Ocean-water specific enthalpy at the ice base (J/kg) — TRAP #1: the LIQUID formula ice_enthalpy_liquid(sst, s_surf), never the frozen/mushy ice_enth_from_ts.

real(kind=wp), intent(in) :: salin_freeze

Salinity of newly frozen ice (PSU) — bulk-salinity mode: ICE_BULK_SALINITY.

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

Mass flux frozen from the ocean onto the ice base (kg/m²).

public pure subroutine ice_bottom_melt_peel(nk, m_lay, enthalpy, salin, bmelt, heat_to_ocn, h2o_ice_to_ocn)

Bottom melt peel (SIS2_ice_thm.F90:1246-1271; prototype sis2_resize.py:83-111). Same peel as ice_top_melt_peel but from k=nk down to k=0. The prototype’s separate ablation return is dropped (it is h2o_ice_to_ocn restricted to this call; PR 3b can re-derive it if needed).

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nk

Number of ice layers (declared first — decl-order).

real(kind=wp), intent(inout) :: m_lay(0:nk)

Layer masses (kg/m²), 0 = snow, 1..nk = ice.

real(kind=wp), intent(inout) :: enthalpy(0:nk)

Layer specific enthalpies (J/kg).

real(kind=wp), intent(in) :: salin(0:nk)

Layer bulk salinities (PSU) — index 0 (snow) unused.

real(kind=wp), intent(inout) :: bmelt

Accumulated bottom melting energy (J/m²), consumed by the peel; NOTE unlike ice_bottom_freeze this is intent inout only for interface symmetry — the peel does not reset it (caller passes the post-freeze residual).

real(kind=wp), intent(inout) :: heat_to_ocn

Leftover melt energy after all layers exhausted (J/m²) — accumulator, caller zeroes once per step.

real(kind=wp), intent(inout) :: h2o_ice_to_ocn

Meltwater mass flux to the ocean (kg/m²) — accumulator.

public pure subroutine ice_rebalance_layers(nk, m_lay, enthalpy, salin, mtot_ice)

Equal-mass repartition of ice layers 1..nk, mass-weighting enthalpy and salinity (SIS2_ice_thm.F90:1448-1512; prototype sis2_resize.py:114-161). The snow slot (m_lay(0), enthalpy(0)) is untouched. mtot_ice = sum(m_lay(1:nk)) is returned; mtot_ice == 0 is an early exit leaving the ice layers untouched (there is no ice to rebalance). The k1/k2 two-pointer drain loop follows the SIS2/prototype branch order exactly, including the (m_ice_avg - mlay_new(k2) > src_m(k1)) .or. (k2 == nk) test.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nk

Number of ice layers (declared first — decl-order).

real(kind=wp), intent(inout) :: m_lay(0:nk)

Layer masses (kg/m²), 0 = snow (untouched), 1..nk = ice.

real(kind=wp), intent(inout) :: enthalpy(0:nk)

Layer specific enthalpies (J/kg).

real(kind=wp), intent(inout) :: salin(0:nk)

Layer bulk salinities (PSU).

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

Summed ice mass (kg/m²), sum(m_lay(1:nk)) on entry.

public pure subroutine ice_snow_accumulate(nk, m_lay, snow)

Snow source-term branch of ice_resize_SIS2 (SIS2_ice_thm.F90:1122): m_lay(0) = m_lay(0) + snow. The snow layer’s specific enthalpy enthalpy(0) is UNCHANGED by snowfall – SIS2 is explicit that this “should do nothing” (SIS_slow_thermo.F90:1032-1033) and books the implied energy against the atmosphere (enth_snowfall = snow*enthalpy(0) -> Enth_Mass_in_atm). Roundabout’s atmosphere is a prescribed slab with no energy budget to charge, so that bookkeeping is not ported – a documented v1 divergence (PLAN_PR26_snowfall.md, S3).

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nk

Number of ice layers (declared first – decl-order).

real(kind=wp), intent(inout) :: m_lay(0:nk)

Layer masses (kg/m^2), 0 = snow, 1..nk = ice.

real(kind=wp), intent(in) :: snow

New snow mass this thermo window (kg/m^2), fprec*dt_therm. snowfall=0 => snow==0.0_wp => the guard below makes this call bit-identical to a no-op by inspection, not IEEE luck.

public pure subroutine ice_snow_ice_flood(nk, m_lay, enthalpy, salin, rho_ratio, snow_to_ice)

Archimedes freeboard snow-ice flooding — the FINAL substantive block of ice_resize_SIS2 (SIS2_ice_thm.F90:1303-1320; PR 27). Standard closure: Leppäranta (1983), A growth model for black ice, snow ice and snow thickness in subarctic basins, Nordic Hydrology 14, 59-70; Fichefet & Morales Maqueda (1997), JGR 102, 12609-12646 §2.3.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nk

Number of ice layers (declared first — decl-order).

real(kind=wp), intent(inout) :: m_lay(0:nk)

Layer masses (kg/m²), 0 = snow, 1..nk = ice.

real(kind=wp), intent(inout) :: enthalpy(0:nk)

Layer specific enthalpies (J/kg).

real(kind=wp), intent(inout) :: salin(0:nk)

Layer bulk salinities (PSU).

real(kind=wp), intent(in) :: rho_ratio

ICE_RHO_ICE/ICE_RHO_OCEAN (nondim, < 1) — computed by the caller (rdb_ice_column), which already has both density parameters in scope; keeps this module free of a circular use rdb_ice_column (that module uses this one).

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

Mass converted from snow to the top ice layer this call (kg/m²), >= 0 — SIS2 SN2IC.

public pure subroutine ice_top_melt_peel(nk, m_lay, enthalpy, salin, tmelt, heat_to_ocn, h2o_ice_to_ocn)

Top melt peel (SIS2_ice_thm.F90:1217-1242; prototype sis2_resize.py:48-80). Peels mass from k=0 (snow) upward through k=nk until tmelt is spent; a massless layer is skipped; the partial layer takes m_melt = melt_left/(enth_fr - enthalpy); any leftover melt energy (all layers exhausted) drains to heat_to_ocn. Snow/pond-free path — tmelt is assumed already >= 0 on entry (the caller folds any negative top-melt into bmelt upstream, SIS2:1159-1163).

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nk

Number of ice layers (declared first — decl-order).

real(kind=wp), intent(inout) :: m_lay(0:nk)

Layer masses (kg/m²), 0 = snow, 1..nk = ice.

real(kind=wp), intent(inout) :: enthalpy(0:nk)

Layer specific enthalpies (J/kg).

real(kind=wp), intent(in) :: salin(0:nk)

Layer bulk salinities (PSU) — index 0 (snow) unused.

real(kind=wp), intent(in) :: tmelt

Accumulated top melting energy (J/m²), assumed >= 0.

real(kind=wp), intent(inout) :: heat_to_ocn

Leftover melt energy after all layers exhausted (J/m²) — accumulator, caller zeroes once per step.

real(kind=wp), intent(inout) :: h2o_ice_to_ocn

Meltwater mass flux to the ocean (kg/m²) — accumulator.