Skip to content

Commit

Permalink
Merge remote-tracking branch 'theresa/add_beta_to_kappa_shear' into e…
Browse files Browse the repository at this point in the history
…smg_work
  • Loading branch information
kshedstrom committed May 24, 2024
2 parents 3dc4a90 + 0651fbb commit 8df593d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/parameterizations/vertical/MOM_kappa_shear.F90
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ module MOM_kappa_shear
real :: lambda2_N_S !< The square of the ratio of the coefficients of
!! the buoyancy and shear scales in the diffusivity
!! equation, 0 to eliminate the shear scale [nondim].
real :: lz_rescale !< A coefficient to rescale the distance to the nearest
!! solid boundary. This adjustment is to account for
!! regions where 3 dimensional turbulence prevents the
!! growth of shear instabilies [nondim].
real :: TKE_bg !< The background level of TKE [Z2 T-2 ~> m2 s-2].
real :: kappa_0 !< The background diapycnal diffusivity [H Z T-1 ~> m2 s-1 or Pa s]
real :: kappa_seed !< A moderately large seed value of diapycnal diffusivity that
Expand Down Expand Up @@ -746,6 +750,7 @@ subroutine kappa_shear_column(kappa, tke, dt, nzc, f2, surface_pres, hlay, dz_la
real :: wt_b ! The fraction of a layer thickness identified with the interface
! below a layer [nondim]
real :: k0dt ! The background diffusivity times the timestep [H Z ~> m2 or kg m-1].
real :: I_lz_rescale_sqr ! The inverse of a rescaling factor for L2_bdry (Lz) squared [nondim].
logical :: valid_dt ! If true, all levels so far exhibit acceptably small changes in k_src.
logical :: use_temperature ! If true, temperature and salinity have been
! allocated and are being used as state variables.
Expand All @@ -764,6 +769,8 @@ subroutine kappa_shear_column(kappa, tke, dt, nzc, f2, surface_pres, hlay, dz_la
g_R0 = (US%L_to_Z**2 * GV%g_Earth) / GV%Rho0
k0dt = dt*CS%kappa_0

I_lz_rescale_sqr = 1.0; if (CS%lz_rescale > 0) I_lz_rescale_sqr = 1/(CS%lz_rescale*CS%lz_rescale)

tol_dksrc = CS%kappa_src_max_chg
if (tol_dksrc == 10.0) then
! This is equivalent to the expression below, but avoids changes at roundoff for the default value.
Expand Down Expand Up @@ -794,7 +801,9 @@ subroutine kappa_shear_column(kappa, tke, dt, nzc, f2, surface_pres, hlay, dz_la
do K=nzc,2,-1
dist_from_bot = dist_from_bot + dz_lay(k)
h_from_bot = h_from_bot + hlay(k)
I_L2_bdry(K) = ((dist_from_top(K) + dist_from_bot) * (h_from_top(K) + h_from_bot)) / &
!I_L2_bdry(K) = ((dist_from_top(K) + dist_from_bot) * (h_from_top(K) + h_from_bot)) / &
! ((dist_from_top(K) * dist_from_bot) * (h_from_top(K) * h_from_bot))
I_L2_bdry(K) = I_lz_rescale_sqr*((dist_from_top(K) + dist_from_bot) * (h_from_top(K) + h_from_bot)) / &
((dist_from_top(K) * dist_from_bot) * (h_from_top(K) * h_from_bot))
enddo

Expand Down Expand Up @@ -1918,6 +1927,11 @@ function kappa_shear_init(Time, G, GV, US, param_file, diag, CS)
"Set this to 0 (the default) to eliminate the shear scale. "//&
"This is only used if USE_JACKSON_PARAM is true.", &
units="nondim", default=0.0, do_not_log=just_read)
call get_param(param_file, mdl, "LZ_RESCALE", CS%lz_rescale, &
"A coefficient to rescale the distance to the nearest solid boundary. "//&
"This adjustment is to account for regions where 3 dimensional turbulence "//&
"prevents the growth of shear instabilies [nondim].", &
units="nondim", default=1.0)
call get_param(param_file, mdl, "KAPPA_SHEAR_TOL_ERR", CS%kappa_tol_err, &
"The fractional error in kappa that is tolerated. "//&
"Iteration stops when changes between subsequent "//&
Expand Down

0 comments on commit 8df593d

Please sign in to comment.