From cebc9734c9530cf3a5adc12f76cfa66a25c0b874 Mon Sep 17 00:00:00 2001 From: Qing Li Date: Fri, 8 Jul 2016 14:14:21 -0400 Subject: [PATCH] Added the gravitational constant to cvmix_global_params_type, renamed the ratio parameters in function cvmix_kpp_efactor_model() --- src/shared/cvmix_kinds_and_types.F90 | 3 +++ src/shared/cvmix_kpp.F90 | 20 ++++++++++---------- src/shared/cvmix_put_get.F90 | 6 ++++-- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/shared/cvmix_kinds_and_types.F90 b/src/shared/cvmix_kinds_and_types.F90 index feaae57a5..86bceab07 100644 --- a/src/shared/cvmix_kinds_and_types.F90 +++ b/src/shared/cvmix_kinds_and_types.F90 @@ -189,6 +189,9 @@ module cvmix_kinds_and_types integer :: max_nlev ! units: unitless + ! QL, 160708, gravity, m s^-2 + real(cvmix_r8) :: Gravity = 9.80616_cvmix_r8 + ! Prandtl number real(cvmix_r8) :: prandtl ! units: unitless diff --git a/src/shared/cvmix_kpp.F90 b/src/shared/cvmix_kpp.F90 index 710c793c9..981f6ac0f 100644 --- a/src/shared/cvmix_kpp.F90 +++ b/src/shared/cvmix_kpp.F90 @@ -30,6 +30,7 @@ module cvmix_kpp cvmix_one, & cvmix_PI, & cvmix_data_type, & + cvmix_global_params_type, & CVMIX_OVERWRITE_OLD_VAL, & CVMIX_SUM_OLD_AND_NEW_VALS, & CVMIX_MAX_OLD_AND_NEW_VALS @@ -2492,7 +2493,7 @@ end function cvmix_kpp_compute_nu_at_OBL_depth_LMD94 ! QL, 160606, new function that models the enhancement factor - function cvmix_kpp_efactor_model(u10, ustar, hbl) + function cvmix_kpp_efactor_model(u10, ustar, hbl, CVmix_params_in) ! This function returns the enhancement factor, given the 10-meter ! 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) ustar, & ! boundary layer depth (m) hbl + type(cvmix_global_params_type), intent(in) :: CVmix_params_in ! Local variables ! parameters real(cvmix_r8), parameter :: & - ! gravity - g = 9.81_cvmix_r8, & ! ratio of U19.5 to U10 (Holthuijsen, 2007) - u10_to_u19p5 = 1.075_cvmix_r8, & + u19p5_to_u10 = 1.075_cvmix_r8, & ! ratio of mean frequency to peak frequency for ! Pierson-Moskowitz spectrum (Webb, 2011) - fp_to_fm = 1.296_cvmix_r8, & + fm_to_fp = 1.296_cvmix_r8, & ! ratio of surface Stokes drift to U10 - u10_to_us = 0.0162_cvmix_r8, & + us_to_u10 = 0.0162_cvmix_r8, & ! loss ratio of Stokes transport r_loss = 0.667_cvmix_r8 @@ -2528,18 +2528,18 @@ function cvmix_kpp_efactor_model(u10, ustar, hbl) if (u10 .gt. cvmix_zero .and. ustar .gt. cvmix_zero) then ! surface Stokes drift - us = u10_to_us*u10 + us = us_to_u10*u10 ! ! significant wave height from Pierson-Moskowitz ! spectrum (Bouws, 1998) hm0 = 0.0246_cvmix_r8*u10**2 ! ! peak frequency (PM, Bouws, 1998) - tmp = 2.0_cvmix_r8*cvmix_PI*u10_to_u19p5*u10 - fp = 0.877_cvmix_r8*g/tmp + tmp = 2.0_cvmix_r8*cvmix_PI*u19p5_to_u10*u10 + fp = 0.877_cvmix_r8*CVmix_params_in%Gravity/tmp ! ! mean frequency - fm = fp*fp_to_fm + fm = fm_to_fp*fp ! ! total Stokes transport (a factor r_loss is applied to account ! for the effect of directional spreading, multidirectional waves diff --git a/src/shared/cvmix_put_get.F90 b/src/shared/cvmix_put_get.F90 index 9c96585c0..bc643c607 100644 --- a/src/shared/cvmix_put_get.F90 +++ b/src/shared/cvmix_put_get.F90 @@ -510,8 +510,10 @@ subroutine cvmix_put_global_params_real(CVmix_params, varname, val) case ('fw_rho','FreshWaterDensity') CVmix_params%FreshWaterDensity = val case ('sw_rho','SaltWaterDensity') - CVmix_params%SaltWaterDensity= val - + CVmix_params%SaltWaterDensity = val + ! QL, 160708, add gravity + case ('g','Gravity') + CVmix_params%Gravity = val case default print*, "ERROR: ", trim(varname), " not a valid choice!" stop 1