The three heat fluxes of (E2), W/m^2:
q_ocean = rho_w*c_w*gamma_t*(T_w - T_b) ocean → interface
q_ice = kh*(T_b - T_ice) + m_mass*c_i_eff*(T_b - T_ice)
q_latent = m_mass*L_f
The closure q_ocean - q_ice - q_latent = 0 is what the unit
tests assert to round-off, independently of any golden number.
The melt/freeze branch is taken here from sign(m_mass), which
for both shipped ice modes is identical to the sign(T_star)
branch the solve used (see the derivation block) — the two agree
by construction, including at exactly zero melt.
This is a DIAGNOSTIC re-evaluation, so it carries no status: a
reserved or invalid ice mode leaves c_i_eff = kh = 0, i.e. the
insulating fluxes, and the refusal is reported by the SOLVER
that produced m_mass in the first place.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | T_w |
Far-field temperature (degC). |
||
| real(kind=wp), | intent(in) | :: | T_b |
Interface temperature (degC). |
||
| real(kind=wp), | intent(in) | :: | m_mass |
Melt mass flux (kg/m^2/s). |
||
| real(kind=wp), | intent(in) | :: | gamma_t |
Heat exchange velocity (m/s). |
||
| type(ocean_cavity_ice_t), | intent(in) | :: | ice |
Ice-conduction bundle. |
||
| type(ocean_cavity_const_t), | intent(in) | :: | const |
Constants bundle. |
||
| real(kind=wp), | intent(out) | :: | q_ocean |
Turbulent heat flux ocean → interface (W/m^2). |
||
| real(kind=wp), | intent(out) | :: | q_ice |
Conductive + ice-warming flux interface → ice (W/m^2). |
||
| real(kind=wp), | intent(out) | :: | q_latent |
Latent heat consumed by the phase change (W/m^2). |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | private | :: | T_ice | ||||
| real(kind=wp), | private | :: | c_i_eff | ||||
| integer, | private | :: | ice_stat | ||||
| real(kind=wp), | private | :: | kh |
pure subroutine cavity_heat_fluxes(T_w, T_b, m_mass, gamma_t, ice, const, & q_ocean, q_ice, q_latent) !! The three heat fluxes of (E2), W/m^2: !! !! `q_ocean = rho_w*c_w*gamma_t*(T_w - T_b)` ocean → interface !! `q_ice = kh*(T_b - T_ice) + m_mass*c_i_eff*(T_b - T_ice)` !! `q_latent = m_mass*L_f` !! !! The closure `q_ocean - q_ice - q_latent = 0` is what the unit !! tests assert to round-off, independently of any golden number. !! !! The melt/freeze branch is taken here from `sign(m_mass)`, which !! for both shipped ice modes is identical to the `sign(T_star)` !! branch the solve used (see the derivation block) — the two agree !! by construction, including at exactly zero melt. !! !! This is a DIAGNOSTIC re-evaluation, so it carries no status: a !! reserved or invalid ice mode leaves `c_i_eff = kh = 0`, i.e. the !! insulating fluxes, and the refusal is reported by the SOLVER !! that produced `m_mass` in the first place. !$acc routine seq real(wp), intent(in) :: T_w !! Far-field temperature (degC). real(wp), intent(in) :: T_b !! Interface temperature (degC). real(wp), intent(in) :: m_mass !! Melt mass flux (kg/m^2/s). real(wp), intent(in) :: gamma_t !! Heat exchange velocity (m/s). type(ocean_cavity_ice_t), intent(in) :: ice !! Ice-conduction bundle. type(ocean_cavity_const_t), intent(in) :: const !! Constants bundle. real(wp), intent(out) :: q_ocean !! Turbulent heat flux ocean → interface (W/m^2). real(wp), intent(out) :: q_ice !! Conductive + ice-warming flux interface → ice (W/m^2). real(wp), intent(out) :: q_latent !! Latent heat consumed by the phase change (W/m^2). real(wp) :: T_ice, c_i_eff, kh integer :: ice_stat T_ice = cavity_t_ice(ice) call cavity_ice_terms(ice, m_mass > 0.0_wp, const, c_i_eff, kh, ice_stat) q_ocean = const%rho_w*const%c_w*gamma_t*(T_w - T_b) q_ice = kh*(T_b - T_ice) + m_mass*c_i_eff*(T_b - T_ice) q_latent = m_mass*const%L_f end subroutine cavity_heat_fluxes