Ice temperature (degC) from specific enthalpy + bulk salinity —
SIS2 Temp_from_En_S (SIS2_ice_thm.F90:1830), Cp_ice ==
Cp_brine path only: the quadratic
ICE_CP_ICET2 - 2BBT + ICE_LAT_FUSt_fr = 0
solved for its smaller root. The SIS2 Newton/false-position
refinement (:1876-1933) is only needed when Cp_brine /= Cp_ice
and is deliberately NOT ported. Uses RAW s for t_fr (no max),
faithful to SIS2.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | en |
Ice specific enthalpy (J/kg). |
||
| real(kind=wp), | intent(in) | :: | s |
Ice bulk salinity (PSU). |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | private | :: | bb | ||||
| real(kind=wp), | private | :: | en_j | ||||
| real(kind=wp), | private | :: | t_fr |
pure elemental function ice_temp_from_en_s(en, s) result(t) !! Ice temperature (degC) from specific enthalpy + bulk salinity — !! SIS2 `Temp_from_En_S` (SIS2_ice_thm.F90:1830), Cp_ice == !! Cp_brine path only: the quadratic !! ICE_CP_ICE*T**2 - 2*BB*T + ICE_LAT_FUS*t_fr = 0 !! solved for its smaller root. The SIS2 Newton/false-position !! refinement (:1876-1933) is only needed when Cp_brine /= Cp_ice !! and is deliberately NOT ported. Uses RAW `s` for t_fr (no max), !! faithful to SIS2. !$acc routine seq real(wp), intent(in) :: en !! Ice specific enthalpy (J/kg). real(wp), intent(in) :: s !! Ice bulk salinity (PSU). real(wp) :: t real(wp) :: t_fr, en_j, bb t_fr = ICE_DTF_DS*s en_j = en - ICE_ENTH_LIQ_0 if (s <= 0.0_wp) then ! Step function for fresh water: liquid / mushy plateau / solid. if (en_j >= 0.0_wp) then t = en_j/ICE_CP_WATER else if (en_j >= -ICE_LAT_FUS) then t = 0.0_wp else t = (en_j + ICE_LAT_FUS)/ICE_CP_ICE end if else if (en_j >= t_fr*ICE_CP_WATER) then ! Completely melted layer. t = en_j/ICE_CP_WATER else ! Closed-form quadratic root (SIS2 :1868-1874). bb = 0.5_wp*((en_j - t_fr*(ICE_CP_WATER - ICE_CP_ICE)) + ICE_LAT_FUS) t = (bb - sqrt(bb*bb - t_fr*ICE_CP_ICE*ICE_LAT_FUS))/ICE_CP_ICE end if end function ice_temp_from_en_s