diff --git a/MOM6/CMakeLists.txt b/MOM6/CMakeLists.txt index 5a87d00..b041e45 100644 --- a/MOM6/CMakeLists.txt +++ b/MOM6/CMakeLists.txt @@ -229,7 +229,7 @@ target_sources(OM3_mom6 PRIVATE MOM6/src/parameterizations/vertical/MOM_full_convection.F90 MOM6/src/parameterizations/vertical/MOM_geothermal.F90 MOM6/src/parameterizations/vertical/MOM_internal_tide_input.F90 - MOM6/src/parameterizations/vertical/MOM_kappa_shear.F90 + # MOM6/src/parameterizations/vertical/MOM_kappa_shear.F90 MOM6/src/parameterizations/vertical/MOM_opacity.F90 MOM6/src/parameterizations/vertical/MOM_regularize_layers.F90 MOM6/src/parameterizations/vertical/MOM_set_diffusivity.F90 @@ -381,6 +381,7 @@ add_patched_source(OM3_mom6 MOM6/src/tracer/MOM_generic_tracer.F90) add_patched_source(OM3_mom6 MOM6/src/core/MOM_forcing_type.F90) add_patched_source(OM3_mom6 MOM6/config_src/infra/FMS2/MOM_io_infra.F90) add_patched_source(OM3_mom6 MOM6/src/diagnostics/MOM_PointAccel.F90) +add_patched_source(OM3_mom6 MOM6/src/parameterizations/vertical/MOM_kappa_shear.F90) ### Install and Export ## Library diff --git a/MOM6/patches/MOM_kappa_shear.F90.patch b/MOM6/patches/MOM_kappa_shear.F90.patch new file mode 100644 index 0000000..525b74d --- /dev/null +++ b/MOM6/patches/MOM_kappa_shear.F90.patch @@ -0,0 +1,46 @@ +diff --git a/src/parameterizations/vertical/MOM_kappa_shear.F90 b/src/parameterizations/vertical/MOM_kappa_shear.F90.new +index f2c47ab21..ce10c84cf 100644 +--- a/src/parameterizations/vertical/MOM_kappa_shear.F90 ++++ b/src/parameterizations/vertical/MOM_kappa_shear.F90 +@@ -97,6 +97,8 @@ type, public :: Kappa_shear_CS ; private + !! time average TKE when there is mass in all layers. Otherwise always + !! report the time-averaged TKE, as is currently done when there + !! are some massless layers. ++ logical :: VS_viscosity_bug !< If true, use a bug in the calculation of the viscosity that sets ++ !! it to zero for all vertices that are on a coastline. + logical :: restrictive_tolerance_check !< If false, uses the less restrictive tolerance check to + !! determine if a timestep is acceptable for the KS_it outer iteration + !! loop, as the code was originally written. True uses the more +@@ -607,10 +609,17 @@ subroutine Calc_kappa_shear_vertex(u_in, v_in, h, T_in, S_in, tv, p_surf, kappa_ + enddo + endif ; enddo ! i-loop + +- do K=1,nz+1 ; do I=IsB,IeB +- tke_io(I,J,K) = G%mask2dBu(I,J) * tke_2d(I,K) +- kv_io(I,J,K) = ( G%mask2dBu(I,J) * kappa_2d(I,K,J2) ) * CS%Prandtl_turb +- enddo ; enddo ++ if (CS%VS_viscosity_bug) then ++ do K=1,nz+1 ; do I=IsB,IeB ++ tke_io(I,J,K) = G%mask2dBu(I,J) * tke_2d(I,K) ++ kv_io(I,J,K) = ( G%mask2dBu(I,J) * kappa_2d(I,K,J2) ) * CS%Prandtl_turb ++ enddo; enddo ++ else ++ do K=1,nz+1 ; do I=IsB,IeB ++ tke_io(I,J,K) = tke_2d(I,K) ++ kv_io(I,J,K) = kappa_2d(I,K,J2) * CS%Prandtl_turb ++ enddo; enddo ++ endif + if (J>=G%jsc) then ; do K=1,nz+1 ; do i=G%isc,G%iec + ! Set the diffusivities in tracer columns from the values at vertices. + kappa_io(i,j,K) = G%mask2dT(i,j) * 0.25 * & +@@ -1873,6 +1882,10 @@ function kappa_shear_init(Time, G, GV, US, param_file, diag, CS) + "If true, do the calculations of the shear-driven mixing "//& + "at the cell vertices (i.e., the vorticity points).", & + default=.false., do_not_log=just_read) ++ call get_param(param_file, mdl, "VERTEX_SHEAR_VISCOSITY_BUG", CS%VS_viscosity_bug, & ++ "If true, use a bug in vertex shear that zeros out viscosities at "//& ++ "vertices on coastlines.", & ++ default=.true., do_not_log=just_read.or.(.not.CS%KS_at_vertex)) + call get_param(param_file, mdl, "RINO_CRIT", CS%RiNo_crit, & + "The critical Richardson number for shear mixing.", & + units="nondim", default=0.25, do_not_log=just_read)