Skip to content

Commit cebc973

Browse files
committed
Added the gravitational constant to cvmix_global_params_type, renamed the ratio parameters in function cvmix_kpp_efactor_model()
1 parent 27db461 commit cebc973

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

src/shared/cvmix_kinds_and_types.F90

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ module cvmix_kinds_and_types
189189
integer :: max_nlev
190190
! units: unitless
191191

192+
! QL, 160708, gravity, m s^-2
193+
real(cvmix_r8) :: Gravity = 9.80616_cvmix_r8
194+
192195
! Prandtl number
193196
real(cvmix_r8) :: prandtl
194197
! units: unitless

src/shared/cvmix_kpp.F90

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ module cvmix_kpp
3030
cvmix_one, &
3131
cvmix_PI, &
3232
cvmix_data_type, &
33+
cvmix_global_params_type, &
3334
CVMIX_OVERWRITE_OLD_VAL, &
3435
CVMIX_SUM_OLD_AND_NEW_VALS, &
3536
CVMIX_MAX_OLD_AND_NEW_VALS
@@ -2492,7 +2493,7 @@ end function cvmix_kpp_compute_nu_at_OBL_depth_LMD94
24922493

24932494
! QL, 160606, new function that models the enhancement factor
24942495

2495-
function cvmix_kpp_efactor_model(u10, ustar, hbl)
2496+
function cvmix_kpp_efactor_model(u10, ustar, hbl, CVmix_params_in)
24962497

24972498
! This function returns the enhancement factor, given the 10-meter
24982499
! wind (m/s), friction velocity (m/s) and the boundary layer depth (m).
@@ -2507,18 +2508,17 @@ function cvmix_kpp_efactor_model(u10, ustar, hbl)
25072508
ustar, &
25082509
! boundary layer depth (m)
25092510
hbl
2511+
type(cvmix_global_params_type), intent(in) :: CVmix_params_in
25102512
! Local variables
25112513
! parameters
25122514
real(cvmix_r8), parameter :: &
2513-
! gravity
2514-
g = 9.81_cvmix_r8, &
25152515
! ratio of U19.5 to U10 (Holthuijsen, 2007)
2516-
u10_to_u19p5 = 1.075_cvmix_r8, &
2516+
u19p5_to_u10 = 1.075_cvmix_r8, &
25172517
! ratio of mean frequency to peak frequency for
25182518
! Pierson-Moskowitz spectrum (Webb, 2011)
2519-
fp_to_fm = 1.296_cvmix_r8, &
2519+
fm_to_fp = 1.296_cvmix_r8, &
25202520
! ratio of surface Stokes drift to U10
2521-
u10_to_us = 0.0162_cvmix_r8, &
2521+
us_to_u10 = 0.0162_cvmix_r8, &
25222522
! loss ratio of Stokes transport
25232523
r_loss = 0.667_cvmix_r8
25242524

@@ -2528,18 +2528,18 @@ function cvmix_kpp_efactor_model(u10, ustar, hbl)
25282528

25292529
if (u10 .gt. cvmix_zero .and. ustar .gt. cvmix_zero) then
25302530
! surface Stokes drift
2531-
us = u10_to_us*u10
2531+
us = us_to_u10*u10
25322532
!
25332533
! significant wave height from Pierson-Moskowitz
25342534
! spectrum (Bouws, 1998)
25352535
hm0 = 0.0246_cvmix_r8*u10**2
25362536
!
25372537
! peak frequency (PM, Bouws, 1998)
2538-
tmp = 2.0_cvmix_r8*cvmix_PI*u10_to_u19p5*u10
2539-
fp = 0.877_cvmix_r8*g/tmp
2538+
tmp = 2.0_cvmix_r8*cvmix_PI*u19p5_to_u10*u10
2539+
fp = 0.877_cvmix_r8*CVmix_params_in%Gravity/tmp
25402540
!
25412541
! mean frequency
2542-
fm = fp*fp_to_fm
2542+
fm = fm_to_fp*fp
25432543
!
25442544
! total Stokes transport (a factor r_loss is applied to account
25452545
! for the effect of directional spreading, multidirectional waves

src/shared/cvmix_put_get.F90

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,10 @@ subroutine cvmix_put_global_params_real(CVmix_params, varname, val)
510510
case ('fw_rho','FreshWaterDensity')
511511
CVmix_params%FreshWaterDensity = val
512512
case ('sw_rho','SaltWaterDensity')
513-
CVmix_params%SaltWaterDensity= val
514-
513+
CVmix_params%SaltWaterDensity = val
514+
! QL, 160708, add gravity
515+
case ('g','Gravity')
516+
CVmix_params%Gravity = val
515517
case default
516518
print*, "ERROR: ", trim(varname), " not a valid choice!"
517519
stop 1

0 commit comments

Comments
 (0)