From bd13ba6024213bdd83789d2fb4c2c6844ff4217a Mon Sep 17 00:00:00 2001 From: Ian Grooms Date: Tue, 18 Jul 2023 18:38:49 -0600 Subject: [PATCH] Background Ah This commit updates the code so that it uses the background Ah as a minimum. Previously, if `SMAGORINSKY_AH = True`, Leith+E would use the Smag value of Ah as the minimum, which is incorrect. --- src/parameterizations/lateral/MOM_hor_visc.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parameterizations/lateral/MOM_hor_visc.F90 b/src/parameterizations/lateral/MOM_hor_visc.F90 index 2af86488eb..40a12c7598 100644 --- a/src/parameterizations/lateral/MOM_hor_visc.F90 +++ b/src/parameterizations/lateral/MOM_hor_visc.F90 @@ -1172,7 +1172,7 @@ subroutine horizontal_viscosity(u, v, h, diffu, diffv, MEKE, VarMix, G, GV, US, Del2vort_h = 0.25 * ((Del2vort_q(I,J) + Del2vort_q(I-1,J-1)) + & (Del2vort_q(I-1,J) + Del2vort_q(I,J-1))) AhLth = CS%Biharm6_const_xx(i,j) * inv_PI6 * abs(Del2vort_h) - if (AhLth .le. Ah(i,j)) then + if (AhLth .le. CS%Ah_bg_xx(i,j)) then m_leithy(i,j) = 0.0 else if ((CS%m_const_leithy(i,j)*vert_vort_mag(i,j)) .lt. abs(vort_xy_smooth(i,j))) then @@ -1190,7 +1190,7 @@ subroutine horizontal_viscosity(u, v, h, diffu, diffv, MEKE, VarMix, G, GV, US, (Del2vort_q(I-1,J) + Del2vort_q(I,J-1))) AhLthy = CS%Biharm6_const_xx(i,j) * inv_PI6 * & sqrt(max(0.,Del2vort_h**2 - m_leithy(i,j)*vert_vort_mag_smooth(i,j)**2)) - Ah(i,j) = max(Ah(i,j), AhLthy) + Ah(i,j) = max(CS%Ah_bg_xx(i,j), AhLthy) enddo ; enddo ! Smooth Ah before applying upper bound ! square, then smooth, then square root