Skip to content

Commit

Permalink
Background Ah
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
iangrooms committed Jul 19, 2023
1 parent 53c293e commit bd13ba6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/parameterizations/lateral/MOM_hor_visc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit bd13ba6

Please sign in to comment.