Skip to content

Commit

Permalink
Cv -> CVt2 (and settable parameter)
Browse files Browse the repository at this point in the history
I created a new CVt2 component to the kpp parameter type, it is set to 2.6 by
default during initialization but users can change it by calling

cvmix_put_kpp('CVt2', new_val)

after calling cvmix_init_kpp()
  • Loading branch information
mnlevy1981 committed Oct 11, 2024
1 parent ca365e3 commit da50e0b
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/shared/cvmix_kpp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ module cvmix_kpp
real(cvmix_r8) :: RWHGK_ENTR_COEF,& ! Coefficient and exponent from
RWHGK_ENTR_EXP ! RWHGK16 Langmuir parameterization

real(cvmix_r8) :: CVt2 ! Tunable parameter for convection entrainment
! (Only used with StokesMOST)

end type cvmix_kpp_params_type

!EOP
Expand Down Expand Up @@ -480,10 +483,11 @@ subroutine cvmix_init_kpp(ri_crit, minOBLdepth, maxOBLdepth, minVtsqr, &
end if

if (present(lStokesMOST)) then
call cvmix_put_kpp('lStokesMOST',lStokesMOST , CVmix_kpp_params_user)
call cvmix_put_kpp('lStokesMOST', lStokesMOST, CVmix_kpp_params_user)
else
call cvmix_put_kpp('lStokesMOST', .false., CVmix_kpp_params_user)
end if
call cvmix_put_kpp('CVt2', 2.6_cvmix_r8, CVmix_kpp_params_user)

if (present(lEkman)) then
call cvmix_put_kpp('lEkman', lEkman, CVmix_kpp_params_user)
Expand Down Expand Up @@ -1316,6 +1320,8 @@ subroutine cvmix_put_kpp_real(varname, val, CVmix_kpp_params_user)
CVmix_kpp_params_out%surf_layer_ext = val
case ('Cv')
CVmix_kpp_params_out%Cv = val
case ('CVt2')
CVmix_kpp_params_out%CVt2 = val
case ('nonlocal_coeff')
CVmix_kpp_params_out%nonlocal_coeff = val
case ('c_CT')
Expand Down Expand Up @@ -1500,6 +1506,8 @@ function cvmix_get_kpp_real(varname, CVmix_kpp_params_user)
cvmix_get_kpp_real = CVmix_kpp_params_get%surf_layer_ext
case ('Cv')
cvmix_get_kpp_real = CVmix_kpp_params_get%Cv
case ('CVt2')
cvmix_get_kpp_real = CVmix_kpp_params_get%CVt2
case ('c_CT')
cvmix_get_kpp_real = CVmix_kpp_params_get%c_CT
case ('c_ST')
Expand Down Expand Up @@ -2593,7 +2601,7 @@ function cvmix_kpp_compute_unresolved_shear(zt_cntr, ws_cntr, N_iface, &

! Local variables
integer :: kt, nlev
real(cvmix_r8) :: Cv, Vtc , beta, xbeta, ybeta ! pure convection entrainment rule
real(cvmix_r8) :: Cv, Vtc, beta, xbeta, ybeta ! pure convection entrainment rule
logical :: lwstar ! use wstar rather than w_s
real(cvmix_r8) :: wstar ! convective velocity scale
real(cvmix_r8) :: ws_wstar ! ratio in limit of pure convection
Expand Down Expand Up @@ -2654,8 +2662,6 @@ function cvmix_kpp_compute_unresolved_shear(zt_cntr, ws_cntr, N_iface, &
lwstar = .false. ! .true.
ws_wstar = CVmix_kpp_params_in%vonkarman * cvmix_one * real(25,cvmix_r8) ! * &
ws_wstar = CVmix_kpp_params_in%vonkarman * ws_wstar**(cvmix_one/real(3,cvmix_r8))
! for Mike: please make this a param
Cv = 2.6_cvmix_r8 ! call this CVt2

do kt=1,nlev
xbeta = MAX( cvmix_zero , MIN( (300._cvmix_r8-100._cvmix_r8) , (-zt_cntr(kt) - 100._cvmix_r8) ) )
Expand All @@ -2666,10 +2672,10 @@ function cvmix_kpp_compute_unresolved_shear(zt_cntr, ws_cntr, N_iface, &
if (lwstar ) then
wstar = (MAX(0.0 , zt_cntr(kt) * bfsfc(kt) ))**(cvmix_one/real(3,cvmix_r8))
cvmix_kpp_compute_unresolved_shear(kt) = &
-zt_cntr(kt) * N_cntr(kt) * Cv * Vtc * wstar
-zt_cntr(kt) * N_cntr(kt) * CVmix_kpp_params_in%CVt2 * Vtc * wstar
else
cvmix_kpp_compute_unresolved_shear(kt) = &
-zt_cntr(kt) * N_cntr(kt) * Cv * Vtc * ws_cntr(kt) / ws_wstar
-zt_cntr(kt) * N_cntr(kt) * CVmix_kpp_params_in%CVt2 * Vtc * ws_cntr(kt) / ws_wstar
end if

if (cvmix_kpp_compute_unresolved_shear(kt).lt. &
Expand Down

0 comments on commit da50e0b

Please sign in to comment.