cavity_gamma_yung25 Subroutine

private pure subroutine cavity_gamma_yung25(u_star, l_plus, gamma_t, gamma_s, ierr)

Yung et al. (2025) “StratFeedback”, eqs. (7)-(8) p. 5832:

Gamma_T = min( 10^A_T*(L+)^n_T , Gamma_T,CC ) Gamma_S = min( 10^A_S*(L+)^n_S , Gamma_S,CC )

with gamma = Gamma*u*. The caps are the Vreugdenhil & Taylor (2019) passive-scalar maxima, and the fit is forced toward them at L+ = 1e4 so that the law reduces to a constant-Gamma law in the well-mixed / shear-dominated limit (p. 5834, “StratFeedback limits to ConstCoeff at high friction velocities and lower thermal driving”).

BRANCH: L+ <= 0 (freezing / destabilising) takes the caps — the paper’s own prescription, pp. 5832-5833, because the LES studies it follows do not explore freezing.

NOTE this law IGNORES par%gamma_t_coeff by design: its neutral limit is its own published cap, not the configured Gamma_T. A gate that asserts “reduces to the configured constant-Gamma law” is therefore the wrong gate; “reduces to its own documented neutral limit” is the right one.

GUARD: the two min() caps are reached only after the power laws have been proven finite.

Arguments

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

Friction velocity (m/s), > 0.

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

Trial viscous Obukhov scale, or CAVITY_L_PLUS_NEUTRAL.

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

Heat exchange velocity (m/s).

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

Salt exchange velocity (m/s).

integer, intent(out) :: ierr

CAVITY_MELT_* status.


Calls

proc~~cavity_gamma_yung25~~CallsGraph proc~cavity_gamma_yung25 cavity_gamma_yung25 proc~cavity_l_plus_is_neutral cavity_l_plus_is_neutral proc~cavity_gamma_yung25->proc~cavity_l_plus_is_neutral

Called by

proc~~cavity_gamma_yung25~~CalledByGraph proc~cavity_gamma_yung25 cavity_gamma_yung25 proc~cavity_exchange_velocities_f cavity_exchange_velocities_f proc~cavity_exchange_velocities_f->proc~cavity_gamma_yung25 proc~cavity_exchange_velocities cavity_exchange_velocities proc~cavity_exchange_velocities->proc~cavity_exchange_velocities_f proc~cavity_state_at_x cavity_state_at_x proc~cavity_state_at_x->proc~cavity_exchange_velocities_f proc~cavity_solve_melt_f cavity_solve_melt_f proc~cavity_solve_melt_f->proc~cavity_state_at_x 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

Variables

Type Visibility Attributes Name Initial
real(kind=wp), private :: big_gamma_s
real(kind=wp), private :: big_gamma_t

Source Code

   pure subroutine cavity_gamma_yung25(u_star, l_plus, gamma_t, gamma_s, ierr)
      !! Yung et al. (2025) "StratFeedback", eqs. (7)-(8) p. 5832:
      !!
      !!   `Gamma_T = min( 10^A_T*(L+)^n_T , Gamma_T,CC )`
      !!   `Gamma_S = min( 10^A_S*(L+)^n_S , Gamma_S,CC )`
      !!
      !! with `gamma = Gamma*u*`.  The caps are the Vreugdenhil & Taylor
      !! (2019) passive-scalar maxima, and the fit is forced toward them
      !! at `L+ = 1e4` so that the law reduces to a constant-Gamma law in
      !! the well-mixed / shear-dominated limit (p. 5834, "StratFeedback
      !! limits to ConstCoeff at high friction velocities and lower
      !! thermal driving").
      !!
      !! BRANCH: `L+ <= 0` (freezing / destabilising) takes the caps —
      !! the paper's own prescription, pp. 5832-5833, because the LES
      !! studies it follows do not explore freezing.
      !!
      !! NOTE this law IGNORES `par%gamma_t_coeff` by design: its neutral
      !! limit is its own published cap, not the configured `Gamma_T`.  A
      !! gate that asserts "reduces to the configured constant-Gamma law"
      !! is therefore the wrong gate; "reduces to its own documented
      !! neutral limit" is the right one.
      !!
      !! GUARD: the two `min()` caps are reached only after the power laws
      !! have been proven finite.
      !$acc routine seq
      real(wp), intent(in) :: u_star
         !! Friction velocity (m/s), > 0.
      real(wp), intent(in) :: l_plus
         !! Trial viscous Obukhov scale, or `CAVITY_L_PLUS_NEUTRAL`.
      real(wp), intent(out) :: gamma_t
         !! Heat exchange velocity (m/s).
      real(wp), intent(out) :: gamma_s
         !! Salt exchange velocity (m/s).
      integer, intent(out) :: ierr
         !! `CAVITY_MELT_*` status.
      real(wp) :: big_gamma_t, big_gamma_s

      ierr = CAVITY_MELT_OK
      if (cavity_l_plus_is_neutral(l_plus)) then
         gamma_t = Y25_GAMMA_T_CC*u_star
         gamma_s = Y25_GAMMA_S_CC*u_star
         return
      end if
      big_gamma_t = 10.0_wp**Y25_A_T*l_plus**Y25_N_T
      big_gamma_s = 10.0_wp**Y25_A_S*l_plus**Y25_N_S
      if (.not. (ieee_is_finite(big_gamma_t) .and. ieee_is_finite(big_gamma_s))) then
         gamma_t = 0.0_wp
         gamma_s = 0.0_wp
         ierr = CAVITY_MELT_NONFINITE_STATE
         return
      end if
      if (big_gamma_t >= Y25_GAMMA_T_CC) big_gamma_t = Y25_GAMMA_T_CC
      if (big_gamma_s >= Y25_GAMMA_S_CC) big_gamma_s = Y25_GAMMA_S_CC
      gamma_t = big_gamma_t*u_star
      gamma_s = big_gamma_s*u_star
   end subroutine cavity_gamma_yung25