From 75d34313b4591a6916e2bb70bdf64f896e64c7f7 Mon Sep 17 00:00:00 2001 From: Theresa Morrison Date: Mon, 20 May 2024 13:46:17 -0400 Subject: [PATCH 1/2] Add rescaling paramter to KD Shear Add a parameted (beta) to rescale the distance to the nearest solid boundary that is used within calculation of kappa shear. While rescaling this value is unphysical, this adjustment can be thought of as not allowing shear instabilities to grow up to the full distance to the nearest boundary because of other turbulent processes which would disrupt their growth. --- src/parameterizations/vertical/MOM_kappa_shear.F90 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/parameterizations/vertical/MOM_kappa_shear.F90 b/src/parameterizations/vertical/MOM_kappa_shear.F90 index 8a1974d8ea..a6b0484a22 100644 --- a/src/parameterizations/vertical/MOM_kappa_shear.F90 +++ b/src/parameterizations/vertical/MOM_kappa_shear.F90 @@ -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 :: beta !< 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 @@ -794,7 +798,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) = 1/(CS%beta*CS%beta)*((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 @@ -1918,6 +1924,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%beta, & + "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 "//& From 0651fbbfc05643bab0a5883e7099f6012f017ae5 Mon Sep 17 00:00:00 2001 From: Theresa Morrison Date: Fri, 24 May 2024 09:50:44 -0400 Subject: [PATCH 2/2] Rename parameter and swtich to multiplication Rename the parameter beta to lz_rescale to be more descriptive. To avoid two divisions in a single line, the inverse of lz_rescale is calculated and stored as I_lz_rescale_sqr. Where the calculation is done logic has been added to check that lz_rescale is greater than zero to avoid dividing by zero or making lz_rescale negative. --- src/parameterizations/vertical/MOM_kappa_shear.F90 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/parameterizations/vertical/MOM_kappa_shear.F90 b/src/parameterizations/vertical/MOM_kappa_shear.F90 index a6b0484a22..b62387a29b 100644 --- a/src/parameterizations/vertical/MOM_kappa_shear.F90 +++ b/src/parameterizations/vertical/MOM_kappa_shear.F90 @@ -54,7 +54,7 @@ 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 :: beta !< A coefficient to rescale the distance to the nearest + 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]. @@ -750,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. @@ -768,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. @@ -800,7 +803,7 @@ subroutine kappa_shear_column(kappa, tke, dt, nzc, f2, surface_pres, hlay, dz_la 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)) / & ! ((dist_from_top(K) * dist_from_bot) * (h_from_top(K) * h_from_bot)) - I_L2_bdry(K) = 1/(CS%beta*CS%beta)*((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 @@ -1924,7 +1927,7 @@ 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%beta, & + 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].", &