Skip to content

Commit e644de2

Browse files
committed
made some edits to subroutines for optimizing the operations
1 parent e0ab1d7 commit e644de2

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/parameterizations/vertical/MOM_energetic_PBL.F90

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2758,7 +2758,7 @@ subroutine kappa_eqdisc(shape_func, CS, GV, dz, absf, B_flux, u_star, MLD_guess)
27582758
! Lh < 0 --> surface stabilizing i.e. heating, and Lh > 0 --> surface destabilizing i.e. cooling
27592759
! This capping does not matter because these equations have asymptotes. Not sensitive beyond the caps.
27602760
Eh = min(Eh, 2.0) ! capping p1 to less than 2.0. It is always >0.0.
2761-
Lh = min( max(Lh, -8.0), 8.0 ) ! capping Lh between -8 and 8
2761+
Lh = min(max(Lh, -8.0), 8.0) ! capping Lh between -8 and 8
27622762

27632763
! Empirical model to predict sm:
27642764
! F is Equation 16 in Sane et al. 2025, and needs to be computed before sigma_m:
@@ -2771,8 +2771,7 @@ subroutine kappa_eqdisc(shape_func, CS, GV, dz, absf, B_flux, u_star, MLD_guess)
27712771
F_Eh = F * Eh
27722772
sm = F_Eh / (CS%ML_c(1)*F_Eh +CS%ML_c(2))
27732773

2774-
sm = min(sm,0.7) ! makes sure sm is less than 0.7, true sm range is from (approx) 0.2 to 0.60
2775-
sm = max(sm,0.1) ! makes sure sm is more than 0.1
2774+
sm = min(max(sm,0.1),0.7) ! makes sure 0.1<sm<0.7, true sm range is (approx) 0.2 to 0.60
27762775

27772776
sm_h = sm * hbl
27782777
sm_h_I = 1.0/sm_h ! inverse of (sm x hbl)
@@ -2806,8 +2805,8 @@ subroutine kappa_eqdisc(shape_func, CS, GV, dz, absf, B_flux, u_star, MLD_guess)
28062805
elseif (hz_n <= hbl) then
28072806

28082807
z_minus_sm_h = (hz_n - sm_h)
2809-
z_minus_sm_h2 =((hz_n - sm_h) * (hz_n - sm_h))
2810-
z_minus_sm_h3 = (hz_n - sm_h) * z_minus_sm_h2
2808+
z_minus_sm_h2 = z_minus_sm_h * z_minus_sm_h
2809+
z_minus_sm_h3 = z_minus_sm_h * z_minus_sm_h2
28112810

28122811
shape_func(n) = (coef_c3 * z_minus_sm_h3 + coef_c2 * z_minus_sm_h2) + 1.0
28132812

@@ -2904,8 +2903,8 @@ subroutine get_eqdisc_v0h(CS, B_flux, u_star, MLD_guess, v0_dummy)
29042903
real :: u_star_2 ! u_star squared, [Z2 T-2 ~> m2 s-2]
29052904
real :: u_star_3 ! u_star cubed, [Z3 T-3 ~> m3 s-3]
29062905

2907-
u_star_2 = u_star * u_star ! pre-multiplying u*
2908-
u_star_3 = u_star_2 * u_star ! obtained u_star ^ 3.0
2906+
u_star_2 = u_star * u_star ! pre-multiplying to get ustar ^ 2
2907+
u_star_3 = u_star_2 * u_star ! ustar ^ 3.0
29092908

29102909
if (B_flux <= CS%bflux_lower_cap) then
29112910
bflux_c = CS%bflux_lower_cap
@@ -4174,7 +4173,7 @@ subroutine energetic_PBL_init(Time, G, GV, US, param_file, diag, CS)
41744173
call get_param(param_file, mdl, "ML_diffusivity_coeffs", CS%ML_c, &
41754174
"Coefficient used for ML diffusivity 1 to 24 ", units="nondim", &
41764175
defaults=(/1.7908 , 0.6904, 0.0712, 0.4380, 2.6821, 1.5845, 0.1550, 1.1120, 0.8616, 0.0984, &
4177-
45.0, 2.8570, 3.290, 0.0764, 8.2854, 1.2026, 12.7677, 6.0277, 15.7292, 0.0785 /))
4176+
45.0, 2.8570, 3.290, 0.0785, 8.2854, 1.2026, 12.7388, 6.0277, 15.7292, 0.0785 /))
41784177

41794178
call get_param(param_file, mdl, "Shape_Function_Epsilon", CS%shape_function_epsilon, &
41804179
"Constant value of OSBL shape function below the boundary layer", units="nondim", default=0.01 )

0 commit comments

Comments
 (0)