Skip to content

Commit

Permalink
Remove lavg_N_or_Nsqr option
Browse files Browse the repository at this point in the history
After discussion with Bill Large, the unresolved shear computation really needs
the buoyancy frequency to be at the bottom interface of the cell so I removed
the option to interpolate it to the cell center.
  • Loading branch information
mnlevy1981 committed May 10, 2015
1 parent da007a6 commit 9ff6cd5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 36 deletions.
1 change: 0 additions & 1 deletion reg_tests/kpp/input.nl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ mix_type = 'kpp'
hmix5 = 17.0d0
! Parameter settings to match LMD94 (linear interp, average Nsqr)
interp_type_t5 = "linear"
lavg_N_or_Nsqr = .true.
/

! Test 6 params
Expand Down
8 changes: 2 additions & 6 deletions src/drivers/cvmix_kpp_drv.F90
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,13 @@ Subroutine cvmix_kpp_driver()
! True => run specified test
logical :: ltest1, ltest2, ltest3, ltest4, ltest5, ltest6
logical :: lnoDGat1 ! True => G'(1) = 0 (in test 4)
logical :: lavg_N_or_Nsqr ! True => N_cntr = avg(N_iface[above,below])

namelist/kpp_col1_nml/ltest1, nlev1, layer_thick1, interp_type_t1, hmix1, &
ri_crit
namelist/kpp_col2_nml/ltest2
namelist/kpp_col3_nml/ltest3, nlev3
namelist/kpp_col4_nml/ltest4, interp_type_t4, OBL_levid4, lnoDGat1
namelist/kpp_col5_nml/ltest5, nlev5, layer_thick5, hmix5, interp_type_t5, &
lavg_N_or_Nsqr
namelist/kpp_col5_nml/ltest5, nlev5, layer_thick5, hmix5, interp_type_t5
namelist/kpp_col6_nml/ltest6, vonkarman6, tao, rho0, grav, alpha, Qnonpen, &
Cp0, OBL_depth6

Expand Down Expand Up @@ -107,7 +105,6 @@ Subroutine cvmix_kpp_driver()
layer_thick5 = real(5, cvmix_r8)
hmix5 = real(17, cvmix_r8)
interp_type_t5 = "linear"
lavg_N_or_Nsqr = .true.

! Defaults for test 6
ltest6 = .false.
Expand Down Expand Up @@ -403,8 +400,7 @@ Subroutine cvmix_kpp_driver()

! using linear interpolation, averaging Nsqr, and setting Cv = 1.5 to
! match LMD result
call cvmix_init_kpp(Cv = 1.5_cvmix_r8, interp_type=interp_type_t5, &
lavg_N_or_Nsqr = lavg_N_or_Nsqr)
call cvmix_init_kpp(Cv = 1.5_cvmix_r8, interp_type=interp_type_t5)

! Set up vertical levels (centers and interfaces) and compute bulk
! Richardson number
Expand Down
33 changes: 4 additions & 29 deletions src/shared/cvmix_kpp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,6 @@ module cvmix_kpp
logical :: lMonOb ! True => compute Monin-Obukhov limit
logical :: lnoDGat1 ! True => G'(1) = 0 (shape function)
! False => compute G'(1) as in LMD94
logical :: lavg_N_or_Nsqr ! True => N (or Nsqr) at cell center is
! average of values at interfaces above
! and below.
! 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

Expand All @@ -191,8 +185,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, lenhanced_diff, &
lnonzero_surf_nonlocal, CVmix_kpp_params_user)
lenhanced_diff, lnonzero_surf_nonlocal, &
CVmix_kpp_params_user)

! !DESCRIPTION:
! Initialization routine for KPP mixing.
Expand Down Expand Up @@ -220,7 +214,6 @@ subroutine cvmix_init_kpp(ri_crit, minOBLdepth, maxOBLdepth, minVtsqr, &
logical, optional, intent(in) :: lEkman, &
lMonOb, &
lnoDGat1, &
lavg_N_or_Nsqr, &
lenhanced_diff, &
lnonzero_surf_nonlocal

Expand Down Expand Up @@ -464,13 +457,6 @@ subroutine cvmix_init_kpp(ri_crit, minOBLdepth, maxOBLdepth, minVtsqr, &
call cvmix_put_kpp('lnoDGat1', .true., CVmix_kpp_params_user)
end if

if (present(lavg_N_or_Nsqr)) then
call cvmix_put_kpp('lavg_N_or_Nsqr', lavg_N_or_Nsqr, &
CVmix_kpp_params_user)
else
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)
Expand Down Expand Up @@ -1138,8 +1124,6 @@ subroutine cvmix_put_kpp_logical(varname, val, CVmix_kpp_params_user)
CVmix_kpp_params_out%lMonOb = val
case ('lnoDGat1')
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
Expand Down Expand Up @@ -2105,11 +2089,7 @@ function cvmix_kpp_compute_unresolved_shear(zt_cntr, ws_cntr, N_iface, &
stop 1
end if
do kt=1,nlev
if (CVmix_kpp_params_in%lavg_N_or_Nsqr) then
N_cntr(kt) = 0.5_cvmix_r8*(N_iface(kt)+N_iface(kt+1))
else
N_cntr(kt) = N_iface(kt+1)
end if
N_cntr(kt) = N_iface(kt+1)
end do
else
if (present(Nsqr_iface)) then
Expand All @@ -2118,12 +2098,7 @@ function cvmix_kpp_compute_unresolved_shear(zt_cntr, ws_cntr, N_iface, &
stop 1
end if
do kt=1,nlev
if (CVmix_kpp_params_in%lavg_N_or_Nsqr) then
N_cntr(kt)=0.5_cvmix_r8*(sqrt(max(Nsqr_iface(kt),cvmix_zero)) + &
sqrt(max(Nsqr_iface(kt+1),cvmix_zero)))
else
N_cntr(kt)=sqrt(max(Nsqr_iface(kt+1),cvmix_zero))
end if
N_cntr(kt)=sqrt(max(Nsqr_iface(kt+1),cvmix_zero))
end do
else
print*, "ERROR: you must provide N_iface OR Nsqr_iface"
Expand Down

0 comments on commit 9ff6cd5

Please sign in to comment.