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.
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.
| Type | Intent | Optional | 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 |
||
| real(kind=wp), | intent(in) | :: | salin_freeze |
Salinity of newly frozen ice (PSU) — bulk-salinity mode:
|
||
| real(kind=wp), | intent(out) | :: | h2o_ocn_to_ice |
Mass flux frozen from the ocean onto the ice base (kg/m²). |
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).
| Type | Intent | Optional | 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 |
||
| 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. |
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.
| Type | Intent | Optional | 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²), |
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).
| Type | Intent | Optional | 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), |
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.
| Type | Intent | Optional | 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 |
|
||
| real(kind=wp), | intent(out) | :: | snow_to_ice |
Mass converted from snow to the top ice layer this call
(kg/m²), >= 0 — SIS2 |
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).
| Type | Intent | Optional | 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. |