cavity_ice_terms Subroutine

private pure subroutine cavity_ice_terms(ice, melting, const, c_i_eff, kh, ierr)

(c_i_eff, kh) for the requested ice-conduction mode — the two numbers through which every mode enters the quadratic.

CAVITY_ICE_ADV_DIFF is Holland & Jenkins (1999) eq. (31) p. 1794: the heat-advection term is present for MELTING and exactly zero for FREEZING, which is what the paper prescribes rather than an approximation made here.

Arguments

Type IntentOptional Attributes Name
type(ocean_cavity_ice_t), intent(in) :: ice

Ice-conduction bundle.

logical, intent(in) :: melting

Melt/freeze branch, decided from the thermal driving.

type(ocean_cavity_const_t), intent(in) :: const

Constants bundle.

real(kind=wp), intent(out) :: c_i_eff

Effective ice heat capacity (J/kg/K) in L_eff = L_f + c_i_eff*(T_b - T_ice).

real(kind=wp), intent(out) :: kh

Conductance k_ice/h_ice (W/m^2/K). Exactly zero for both shipped modes; carried so the derivation above and the code stay the same expression when the reserved DIFFUSIVE mode lands.

integer, intent(out) :: ierr

CAVITY_MELT_* status.


Called by

proc~~cavity_ice_terms~~CalledByGraph proc~cavity_ice_terms cavity_ice_terms proc~cavity_heat_fluxes cavity_heat_fluxes proc~cavity_heat_fluxes->proc~cavity_ice_terms proc~cavity_three_equation cavity_three_equation proc~cavity_three_equation->proc~cavity_ice_terms proc~cavity_two_equation cavity_two_equation proc~cavity_two_equation->proc~cavity_ice_terms proc~cavity_solve_melt_f cavity_solve_melt_f proc~cavity_solve_melt_f->proc~cavity_heat_fluxes proc~cavity_state_at_x cavity_state_at_x proc~cavity_solve_melt_f->proc~cavity_state_at_x proc~cavity_state_at_x->proc~cavity_three_equation proc~cavity_melt_point_gamma_f cavity_melt_point_gamma_f proc~cavity_melt_point_gamma_f->proc~cavity_solve_melt_f proc~cavity_solve_melt cavity_solve_melt proc~cavity_solve_melt->proc~cavity_solve_melt_f proc~cavity_melt_columns_2d cavity_melt_columns_2d proc~cavity_melt_columns_2d->proc~cavity_melt_point_gamma_f proc~cavity_melt_point cavity_melt_point proc~cavity_melt_point->proc~cavity_solve_melt proc~cavity_melt_point_gamma cavity_melt_point_gamma proc~cavity_melt_point_gamma->proc~cavity_melt_point_gamma_f proc~cavity_melt_columns cavity_melt_columns proc~cavity_melt_columns->proc~cavity_melt_point proc~ocean_cavity_flux_step ocean_cavity_flux_step proc~ocean_cavity_flux_step->proc~cavity_melt_columns_2d

Source Code

   pure subroutine cavity_ice_terms(ice, melting, const, c_i_eff, kh, ierr)
      !! `(c_i_eff, kh)` for the requested ice-conduction mode — the two
      !! numbers through which every mode enters the quadratic.
      !!
      !! `CAVITY_ICE_ADV_DIFF` is Holland & Jenkins (1999) eq. (31)
      !! p. 1794: the heat-advection term is present for MELTING and
      !! exactly zero for FREEZING, which is what the paper prescribes
      !! rather than an approximation made here.
      !$acc routine seq
      type(ocean_cavity_ice_t), intent(in) :: ice
         !! Ice-conduction bundle.
      logical, intent(in) :: melting
         !! Melt/freeze branch, decided from the thermal driving.
      type(ocean_cavity_const_t), intent(in) :: const
         !! Constants bundle.
      real(wp), intent(out) :: c_i_eff
         !! Effective ice heat capacity (J/kg/K) in `L_eff = L_f +
         !! c_i_eff*(T_b - T_ice)`.
      real(wp), intent(out) :: kh
         !! Conductance `k_ice/h_ice` (W/m^2/K).  Exactly zero for both
         !! shipped modes; carried so the derivation above and the code
         !! stay the same expression when the reserved DIFFUSIVE mode
         !! lands.
      integer, intent(out) :: ierr
         !! `CAVITY_MELT_*` status.

      ierr = CAVITY_MELT_OK
      c_i_eff = 0.0_wp
      kh = 0.0_wp
      select case (ice%mode)
      case (CAVITY_ICE_INSULATING)
         ! q_ice == 0 identically.
      case (CAVITY_ICE_ADV_DIFF)
         if (melting) c_i_eff = const%c_i
      case (CAVITY_ICE_DIFFUSIVE)
         ierr = CAVITY_MELT_NOT_IMPLEMENTED
      case default
         ierr = CAVITY_MELT_LAW_INVALID
      end select
   end subroutine cavity_ice_terms