Skip to content

Commit

Permalink
Enhanced diffusivity no longer tied to MatchBoth
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
mnlevy1981 committed Apr 10, 2015
1 parent b1f892c commit 8c78816
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/shared/cvmix_kpp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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 :: &
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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, &
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8c78816

Please sign in to comment.