Skip to content

Commit 9187de9

Browse files
authored
Merge pull request #109 from mnlevy1981/move_kpp_parameters
Move Cb, Cs, and Cu to kpp_params_type
2 parents a4a6fb0 + 862f927 commit 9187de9

1 file changed

Lines changed: 41 additions & 6 deletions

File tree

src/shared/cvmix_kpp.F90

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,9 @@ module cvmix_kpp
210210

211211
real(cvmix_r8) :: CVt2 ! Tunable parameter for convection entrainment
212212
! (Only used with StokesMOST)
213+
real(cvmix_r8) :: ER_Cb ! Entrainment Rule TKE buoyancy production weight [nondim]
214+
real(cvmix_r8) :: ER_Cs ! Entrainment Rule TKE Stokes production weight [nondim]
215+
real(cvmix_r8) :: ER_Cu ! Entrainment Rule TKE shear production weight [nondim]
213216

214217
end type cvmix_kpp_params_type
215218

@@ -229,7 +232,7 @@ subroutine cvmix_init_kpp(ri_crit, minOBLdepth, maxOBLdepth, minVtsqr, &
229232
old_vals, lEkman, lStokesMOST, lMonOb, lnoDGat1, &
230233
lenhanced_diff, lnonzero_surf_nonlocal, &
231234
Langmuir_mixing_str, Langmuir_entrainment_str, &
232-
l_LMD_ws, CVmix_kpp_params_user)
235+
l_LMD_ws, ER_Cb, ER_Cs, ER_Cu, CVmix_kpp_params_user)
233236

234237
! !DESCRIPTION:
235238
! Initialization routine for KPP mixing.
@@ -247,7 +250,10 @@ subroutine cvmix_init_kpp(ri_crit, minOBLdepth, maxOBLdepth, minVtsqr, &
247250
zeta_s, &
248251
surf_layer_ext, &
249252
CVt2, &
250-
Cv
253+
Cv, &
254+
ER_Cb, &
255+
ER_Cs, &
256+
ER_Cu
251257
character(len=*), optional, intent(in) :: interp_type, &
252258
interp_type2, &
253259
MatchTechnique, &
@@ -271,6 +277,7 @@ subroutine cvmix_init_kpp(ri_crit, minOBLdepth, maxOBLdepth, minVtsqr, &
271277

272278
real(cvmix_r8) :: zm, zs, a_m, a_s, c_m, c_s
273279
real(cvmix_r8) :: Cstar_loc, vonkar_loc, surf_layer_ext_loc
280+
real(cvmix_r8) :: ER_Cb_loc, ER_Cs_loc, ER_Cu_loc
274281
real(cvmix_r8) :: nonlocal_coeff
275282

276283
if (present(ri_crit)) then
@@ -586,6 +593,24 @@ subroutine cvmix_init_kpp(ri_crit, minOBLdepth, maxOBLdepth, minVtsqr, &
586593
end if
587594

588595
! Initialize parameters for enhanced entrainment
596+
if (present(ER_Cb)) then
597+
ER_Cb_loc = ER_Cb
598+
else
599+
ER_Cb_loc = 0.96_cvmix_r8
600+
end if
601+
call cvmix_put_kpp('ER_Cb', ER_Cb_loc, CVmix_kpp_params_user)
602+
if (present(ER_Cs)) then
603+
ER_Cs_loc = ER_Cs
604+
else
605+
ER_Cs_loc = 0.038_cvmix_r8
606+
end if
607+
call cvmix_put_kpp('ER_Cs', ER_Cs_loc, CVmix_kpp_params_user)
608+
if (present(ER_Cu)) then
609+
ER_Cu_loc = ER_Cu
610+
else
611+
ER_Cu_loc = 0.023_cvmix_r8
612+
end if
613+
call cvmix_put_kpp('ER_Cu', ER_Cu_loc, CVmix_kpp_params_user)
589614
call cvmix_put_kpp('c_ST', 0.17_cvmix_r8, CVmix_kpp_params_user)
590615
call cvmix_put_kpp('c_CT', 0.15_cvmix_r8, CVmix_kpp_params_user)
591616
call cvmix_put_kpp('c_LT', 0.083_cvmix_r8, CVmix_kpp_params_user)
@@ -1335,6 +1360,12 @@ subroutine cvmix_put_kpp_real(varname, val, CVmix_kpp_params_user)
13351360
CVmix_kpp_params_out%CVt2 = val
13361361
case ('nonlocal_coeff')
13371362
CVmix_kpp_params_out%nonlocal_coeff = val
1363+
case ('ER_Cb')
1364+
CVmix_kpp_params_out%ER_Cb = val
1365+
case ('ER_Cs')
1366+
CVmix_kpp_params_out%ER_Cs = val
1367+
case ('ER_Cu')
1368+
CVmix_kpp_params_out%ER_Cu = val
13381369
case ('c_CT')
13391370
CVmix_kpp_params_out%c_CT = val
13401371
case ('c_ST')
@@ -1519,6 +1550,12 @@ function cvmix_get_kpp_real(varname, CVmix_kpp_params_user)
15191550
cvmix_get_kpp_real = CVmix_kpp_params_get%Cv
15201551
case ('CVt2')
15211552
cvmix_get_kpp_real = CVmix_kpp_params_get%CVt2
1553+
case ('ER_Cb')
1554+
cvmix_get_kpp_real = CVmix_kpp_params_get%ER_Cb
1555+
case ('ER_Cs')
1556+
cvmix_get_kpp_real = CVmix_kpp_params_get%ER_Cs
1557+
case ('ER_Cu')
1558+
cvmix_get_kpp_real = CVmix_kpp_params_get%ER_Cu
15221559
case ('c_CT')
15231560
cvmix_get_kpp_real = CVmix_kpp_params_get%c_CT
15241561
case ('c_ST')
@@ -3411,9 +3448,6 @@ subroutine cvmix_kpp_compute_StokesXi (zi, zk, kSL, SLDepth, surf_buoy_force,
34113448
type(cvmix_kpp_params_type), pointer :: CVmix_kpp_params_in
34123449
real(cvmix_r8), parameter :: CempCGm = 3.5_cvmix_r8 ! Coeff. relating cross-shear mtm flux to sfc stress [nondim]
34133450
real(cvmix_r8), parameter :: CempCGs = 4.7_cvmix_r8 ! Coeff. relating non-local scalar flux to sfc flux [nondim]
3414-
real(cvmix_r8), parameter :: Cu = 0.023_cvmix_r8 ! TKE shear production weight [nondim]
3415-
real(cvmix_r8), parameter :: Cs = 0.038_cvmix_r8 ! TKE Stokes production weight [nondim]
3416-
real(cvmix_r8), parameter :: Cb = 0.96_cvmix_r8 ! TKE buoyancy production weight [nondim]
34173451
real(cvmix_r8) :: PBfact ! Ratio of TKE surface layer production to w*^3 [nondim]
34183452
real(cvmix_r8) :: PU, PS , PB ! Surface layer TKE production terms increments [m3 s-3]
34193453
real(cvmix_r8) :: ustar, delH, delU, delV, omega_E2x, cosOmega, sinOmega
@@ -3512,7 +3546,8 @@ subroutine cvmix_kpp_compute_StokesXi (zi, zk, kSL, SLDepth, surf_buoy_force,
35123546
else
35133547
StokesXI = cvmix_zero
35143548
endif
3515-
BEdE_ER = MAX( ( Cu*PU + Cs*PS + Cb*PB ) , cvmix_zero )
3549+
BEdE_ER = MAX( ( CVmix_kpp_params_in%ER_Cu*PU + CVmix_kpp_params_in%ER_Cs*PS + &
3550+
CVmix_kpp_params_in%ER_Cb*PB ) , cvmix_zero )
35163551
PU_TKE = PU
35173552
PS_TKE = PS
35183553
PB_TKE = PB

0 commit comments

Comments
 (0)