Skip to content

Commit

Permalink
Remove more cvmix_get_kpp_real calls
Browse files Browse the repository at this point in the history
  • Loading branch information
mnlevy1981 committed Sep 26, 2018
1 parent e19e0be commit 185f027
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions src/shared/cvmix_kpp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1375,8 +1375,7 @@ subroutine cvmix_kpp_compute_OBL_depth_low(Ri_bulk, zw_iface, OBL_depth, &
lstable = (surf_buoy.gt.cvmix_zero)

if (lstable) then
MoninObukhov = surf_fric**3/(surf_buoy*cvmix_get_kpp_real('vonkarman',&
CVmix_kpp_params_in))
MoninObukhov = surf_fric**3/(surf_buoy*CVmix_kpp_params_in%vonkarman)
else
MoninObukhov = abs(zt_cntr(nlev))
end if
Expand Down Expand Up @@ -1985,7 +1984,7 @@ subroutine cvmix_kpp_compute_turbulent_scales_1d_sigma(sigma_coord, &
do kw=1,n_sigma
! Compute (u*/phi_m)^3 [this is where the zeros in numerator and
! denominator cancel when u* = 0]
w_m(kw) = -cvmix_get_kpp_real('c_m', CVmix_kpp_params_in) * &
w_m(kw) = -CVmix_kpp_params_in%c_m * &
min(surf_layer_ext, sigma_coord(kw)) * OBL_depth * &
vonkar * surf_buoy_force
! w_m = vonkar * u* / phi_m
Expand All @@ -2004,7 +2003,7 @@ subroutine cvmix_kpp_compute_turbulent_scales_1d_sigma(sigma_coord, &
do kw=1,n_sigma
! Compute (u*/phi_s)^3 [this is where the zeros in numerator and
! denominator cancel when u* = 0]
w_s(kw) = -cvmix_get_kpp_real('c_s', CVmix_kpp_params_in) * &
w_s(kw) = -CVmix_kpp_params_in%c_s * &
min(surf_layer_ext, sigma_coord(kw)) * OBL_depth * &
vonkar * surf_buoy_force
! w_s = vonkar * u* / phi_s
Expand Down Expand Up @@ -2155,7 +2154,7 @@ subroutine cvmix_kpp_compute_turbulent_scales_1d_OBL(sigma_coord, &
else
! Compute (u*/phi_m)^3 [this is where the zeros in numerator and
! denominator cancel when u* = 0]
w_m(kw) = -cvmix_get_kpp_real('c_m', CVmix_kpp_params_in) * &
w_m(kw) = -CVmix_kpp_params_in%c_m * &
min(surf_layer_ext, sigma_coord) * OBL_depth(kw) * &
vonkar * surf_buoy_force(kw)
! w_m = vonkar * u* / phi_m
Expand All @@ -2175,7 +2174,7 @@ subroutine cvmix_kpp_compute_turbulent_scales_1d_OBL(sigma_coord, &
! Unstable forcing, Eqs. (13) and (B1e) reduce to following
! Compute (u*/phi_s)^3 [this is where the zeros in numerator and
! denominator cancel when u* = 0]
w_s(kw) = -cvmix_get_kpp_real('c_s', CVmix_kpp_params_in) * &
w_s(kw) = -CVmix_kpp_params_in%c_s * &
min(surf_layer_ext, sigma_coord) * OBL_depth(kw) * &
vonkar * surf_buoy_force(kw)
! w_s = vonkar * u* / phi_s
Expand Down Expand Up @@ -2343,11 +2342,11 @@ function compute_phi_inv(zeta, CVmix_kpp_params_in, lphi_m, lphi_s)
if (zeta.ge.cvmix_zero) then
! Stable region
compute_phi_inv = cvmix_one/(cvmix_one + real(5,cvmix_r8)*zeta)
else if (zeta.ge.cvmix_get_kpp_real('zeta_m', CVmix_kpp_params_in)) then
else if (zeta.ge.CVmix_kpp_params_in%zeta_m) then
compute_phi_inv = (cvmix_one - real(16,cvmix_r8)*zeta)**0.25_cvmix_r8
else
compute_phi_inv = (cvmix_get_kpp_real('a_m', CVmix_kpp_params_in) - &
cvmix_get_kpp_real('c_m', CVmix_kpp_params_in)*zeta)** &
compute_phi_inv = (CVmix_kpp_params_in%a_m - &
CVmix_kpp_params_in%c_m*zeta)** &
(cvmix_one/real(3,cvmix_r8))
end if
end if
Expand All @@ -2356,11 +2355,11 @@ function compute_phi_inv(zeta, CVmix_kpp_params_in, lphi_m, lphi_s)
if (zeta.ge.cvmix_zero) then
! Stable region
compute_phi_inv = cvmix_one/(cvmix_one + real(5,cvmix_r8)*zeta)
else if (zeta.ge.cvmix_get_kpp_real('zeta_s', CVmix_kpp_params_in)) then
else if (zeta.ge.CVmix_kpp_params_in%zeta_s) then
compute_phi_inv = (cvmix_one - real(16,cvmix_r8)*zeta)**0.5_cvmix_r8
else
compute_phi_inv = (cvmix_get_kpp_real('a_s', CVmix_kpp_params_in) - &
cvmix_get_kpp_real('c_s', CVmix_kpp_params_in)*zeta)** &
compute_phi_inv = (CVmix_kpp_params_in%a_s - &
CVmix_kpp_params_in%c_s*zeta)** &
(cvmix_one/real(3,cvmix_r8))
end if
end if
Expand Down

0 comments on commit 185f027

Please sign in to comment.