From 8c78816c7c6fb396375859048422bf89408bdf13 Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Fri, 10 Apr 2015 15:31:51 -0600 Subject: [PATCH] Enhanced diffusivity no longer tied to MatchBoth Previously CVMix only computed enhanced diffusivity if MatchTechnique = 'MatchBoth'; now it is computed if lenhanced_diff = .true. (default value, but it can be changed in cvmix_kpp_init) --- src/shared/cvmix_kpp.F90 | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/shared/cvmix_kpp.F90 b/src/shared/cvmix_kpp.F90 index 9ef71e25b..642f6caa6 100644 --- a/src/shared/cvmix_kpp.F90 +++ b/src/shared/cvmix_kpp.F90 @@ -171,6 +171,7 @@ module cvmix_kpp ! False => N (or Nsqr) at cell center is ! set to value at interface below ! (only used in compute_unresolved_shear) + logical :: lenhanced_diff ! True => enhance diffusivity at OBL end type cvmix_kpp_params_type !EOP @@ -188,7 +189,8 @@ subroutine cvmix_init_kpp(ri_crit, minOBLdepth, maxOBLdepth, minVtsqr, & vonkarman, Cstar, zeta_m, zeta_s, surf_layer_ext, & Cv, interp_type, interp_type2, MatchTechnique, & old_vals, lEkman, lMonOb, lnoDGat1, & - lavg_N_or_Nsqr, CVmix_kpp_params_user) + lavg_N_or_Nsqr, lenhanced_diff, & + CVmix_kpp_params_user) ! !DESCRIPTION: ! Initialization routine for KPP mixing. @@ -216,7 +218,8 @@ subroutine cvmix_init_kpp(ri_crit, minOBLdepth, maxOBLdepth, minVtsqr, & logical, optional, intent(in) :: lEkman, & lMonOb, & lnoDGat1, & - lavg_N_or_Nsqr + lavg_N_or_Nsqr, & + lenhanced_diff ! !OUTPUT PARAMETERS: type(cvmix_kpp_params_type), intent(inout), target, optional :: & @@ -459,6 +462,13 @@ subroutine cvmix_init_kpp(ri_crit, minOBLdepth, maxOBLdepth, minVtsqr, & call cvmix_put_kpp('lavg_N_or_Nsqr', .true., CVmix_kpp_params_user) end if + if (present(lenhanced_diff)) then + call cvmix_put_kpp('lenhanced_diff', lenhanced_diff, & + CVmix_kpp_params_user) + else + call cvmix_put_kpp('lenhanced_diff', .true., CVmix_kpp_params_user) + end if + !EOC end subroutine cvmix_init_kpp @@ -914,7 +924,7 @@ subroutine cvmix_coeffs_kpp_low(Mdiff_out, Tdiff_out, Sdiff_out, zw, zt, & Tdiff_ktup = OBL_depth * ws_ktup * TshapeAtS Sdiff_ktup = OBL_depth * ws_ktup * SshapeAtS - if (MatchTechnique.eq.CVMIX_KPP_MATCH_BOTH) then + if (CVmix_kpp_params_in%lenhanced_diff) then if ((ktup.eq.kwup).or.(ktup.eq.kwup-1)) then call cvmix_kpp_compute_enhanced_diff(Mdiff_ktup, & Tdiff_ktup, & @@ -1108,6 +1118,8 @@ subroutine cvmix_put_kpp_logical(varname, val, CVmix_kpp_params_user) CVmix_kpp_params_out%lnoDGat1 = val case ('lavg_N_or_Nsqr') CVmix_kpp_params_out%lavg_N_or_Nsqr = val + case ('lenhanced_diff') + CVmix_kpp_params_out%lenhanced_diff = val case DEFAULT print*, "ERROR: ", trim(varname), " is not a boolean variable!" stop 1