Skip to content

Commit

Permalink
(*)Fixes implementation of minimum viscosity
Browse files Browse the repository at this point in the history
- The minimum viscsoity was only being applied in the strain component.
  The minimum with KH_BG_MIN was not applied to the tension component.
  This broke isotropy of the stress tensor.
- The parameter KH_BG_MIN defaults to 0.0 which would be harmless if
  viscosities are always non-negative. However, when using backscatter
  the viscosity is intentionally negative and this limiter was zeroing
  out the backscatter, but only in the strain component.
  - I've moved the min() function to before adding in the MEKE component
    which is where negative viscosities might come from.
- This does not change answers in any tests BUT will change answers for
  any backscatter experiments OR where KH_BG_MIN is non-zero.
  • Loading branch information
adcroft committed Jun 25, 2018
1 parent 91399f0 commit 3b5657b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/parameterizations/lateral/MOM_hor_visc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,7 @@ subroutine horizontal_viscosity(u, v, h, diffu, diffv, MEKE, VarMix, G, GV, CS,
if (rescale_Kh) Kh = VarMix%Res_fn_h(i,j) * Kh
! Older method of bounding for stability
if (legacy_bound) Kh = min(Kh, CS%Kh_Max_xx(i,j))
Kh = max( Kh ,CS%Kh_bg_min ) ! Place a floor on the viscosity, if desired.
if (use_MEKE_Ku) Kh = Kh + MEKE%Ku(i,j) ! *Add* the MEKE contribution (might be negative)

! Newer method of bounding for stability
Expand Down Expand Up @@ -716,11 +717,11 @@ subroutine horizontal_viscosity(u, v, h, diffu, diffv, MEKE, VarMix, G, GV, CS,
if (legacy_bound) Kh = min(Kh, CS%Kh_Max_xy(i,j))
! All viscosity contributions above are subject to resolution scaling
if (rescale_Kh) Kh = VarMix%Res_fn_q(i,j) * Kh
Kh = max( Kh ,CS%Kh_bg_min ) ! Place a floor on the viscosity, if desired.
if (use_MEKE_Ku) then ! *Add* the MEKE contribution (might be negative)
Kh = Kh + 0.25*( (MEKE%Ku(I,J)+MEKE%Ku(I+1,J+1)) &
+(MEKE%Ku(I+1,J)+MEKE%Ku(I,J+1)) )
endif
Kh = max(Kh,CS%Kh_bg_min) ! Place a floor on the viscosity, if desired.

! Newer method of bounding for stability
if (CS%better_bound_Kh) then
Expand Down

0 comments on commit 3b5657b

Please sign in to comment.