ice_temp_from_en_s Function

public 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_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.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: en

Ice specific enthalpy (J/kg).

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

Ice bulk salinity (PSU).

Return Value real(kind=wp)


Called by

proc~~ice_temp_from_en_s~~CalledByGraph proc~ice_temp_from_en_s ice_temp_from_en_s proc~ice_column_step ice_column_step proc~ice_column_step->proc~ice_temp_from_en_s proc~ice_temp_sis2 ice_temp_sis2 proc~ice_column_step->proc~ice_temp_sis2 proc~ice_temp_sis2->proc~ice_temp_from_en_s proc~ice_thermo_columns ice_thermo_columns proc~ice_thermo_columns->proc~ice_column_step proc~ice_thermo_driver_step ice_thermo_driver_step proc~ice_thermo_driver_step->proc~ice_thermo_columns proc~engine_step_ice engine_step_ice proc~engine_step_ice->proc~ice_thermo_driver_step proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_step_ice proc~rdb_ocean_step rdb_ocean_step proc~rdb_ocean_step->proc~engine_step_ice

Variables

Type Visibility Attributes Name Initial
real(kind=wp), private :: bb
real(kind=wp), private :: en_j
real(kind=wp), private :: t_fr

Source Code

   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