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. |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | private | :: | avail | ||||
| real(kind=wp), | private | :: | enth_fr(0:ICE_NK_MAX) | ||||
| integer, | private | :: | k | ||||
| real(kind=wp), | private | :: | m_melt | ||||
| real(kind=wp), | private | :: | melt_left |
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). !$acc routine seq integer, intent(in) :: nk !! Number of ice layers (declared first — decl-order). real(wp), intent(inout) :: m_lay(0:nk) !! Layer masses (kg/m²), 0 = snow, 1..nk = ice. real(wp), intent(inout) :: enthalpy(0:nk) !! Layer specific enthalpies (J/kg). real(wp), intent(in) :: salin(0:nk) !! Layer bulk salinities (PSU) — index 0 (snow) unused. real(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(wp), intent(inout) :: heat_to_ocn !! Leftover melt energy after all layers exhausted (J/m²) — !! accumulator, caller zeroes once per step. real(wp), intent(inout) :: h2o_ice_to_ocn !! Meltwater mass flux to the ocean (kg/m²) — accumulator. real(wp) :: enth_fr(0:ICE_NK_MAX) real(wp) :: melt_left, avail, m_melt integer :: k enth_fr(0) = ice_enthalpy_liquid_freeze(0.0_wp) do k = 1, nk enth_fr(k) = ice_enthalpy_liquid_freeze(salin(k)) end do melt_left = bmelt if (melt_left > 0.0_wp) then do k = nk, 0, -1 if (m_lay(k) <= 0.0_wp) cycle avail = m_lay(k)*(enth_fr(k) - enthalpy(k)) if (melt_left < avail) then m_melt = melt_left/(enth_fr(k) - enthalpy(k)) melt_left = 0.0_wp else m_melt = m_lay(k) melt_left = melt_left - avail end if m_lay(k) = m_lay(k) - m_melt h2o_ice_to_ocn = h2o_ice_to_ocn + m_melt if (melt_left <= 0.0_wp) exit end do heat_to_ocn = heat_to_ocn + melt_left end if end subroutine ice_bottom_melt_peel