Skip to content

Commit

Permalink
Debugging checksum on full range of Kh_h and Kh_q
Browse files Browse the repository at this point in the history
  Expand range of halos for checksums for Kh_h, Kh_q, Ah_h and Ah_q to cover the
full range of values that are actually used.  This includes expanding the range
of values where the viscosities are calculated to those used in symmetric memory
mode when DEBUG is true, even though these are not used for efficiency.  One set
of vorticity-point loop ranges was also corrected when the recently added
parameter EY24_EBT_BS is true to avoid setting an extra unused value, perhaps
correcting non-symmetric memory mode cases that would not reproduce across PE
count and layout.  All answers are bitwise identical in any case that
reproduces across PE count.
  • Loading branch information
Hallberg-NOAA committed Feb 2, 2025
1 parent b239629 commit 2af4d32
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/parameterizations/lateral/MOM_hor_visc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ subroutine horizontal_viscosity(u, v, h, uh, vh, diffu, diffv, MEKE, VarMix, G,
endif

! Set the halo sizes used for the thickness-point viscosities.
if (CS%use_Leithy) then
if (CS%use_Leithy .or. CS%debug) then
js_Kh = js-1 ; je_Kh = je+1 ; is_Kh = is-1 ; ie_Kh = ie+1
else
js_Kh = Jsq ; je_Kh = je+1 ; is_Kh = Isq ; ie_Kh = ie+1
Expand Down Expand Up @@ -1812,7 +1812,7 @@ subroutine horizontal_viscosity(u, v, h, uh, vh, diffu, diffv, MEKE, VarMix, G,

! Backscatter using MEKE
if (CS%EY24_EBT_BS) then
do j=Jsq,Jeq+1 ; do i=Isq,Ieq+1
do J=js-1,Jeq ; do I=is-1,Ieq
if (visc_limit_q_flag(I,J,k) > 0) then
Kh_BS(I,J) = 0.
else
Expand Down Expand Up @@ -2226,11 +2226,11 @@ subroutine horizontal_viscosity(u, v, h, uh, vh, diffu, diffv, MEKE, VarMix, G,

if (CS%debug) then
if (CS%Laplacian) then
call hchksum(Kh_h, "Kh_h", G%HI, haloshift=0, unscale=US%L_to_m**2*US%s_to_T)
call Bchksum(Kh_q, "Kh_q", G%HI, haloshift=0, unscale=US%L_to_m**2*US%s_to_T)
call hchksum(Kh_h, "Kh_h", G%HI, haloshift=1, unscale=US%L_to_m**2*US%s_to_T)
call Bchksum(Kh_q, "Kh_q", G%HI, haloshift=0, symmetric=.true., unscale=US%L_to_m**2*US%s_to_T)
endif
if (CS%biharmonic) call hchksum(Ah_h, "Ah_h", G%HI, haloshift=0, unscale=US%L_to_m**4*US%s_to_T)
if (CS%biharmonic) call Bchksum(Ah_q, "Ah_q", G%HI, haloshift=0, unscale=US%L_to_m**4*US%s_to_T)
if (CS%biharmonic) call hchksum(Ah_h, "Ah_h", G%HI, haloshift=1, unscale=US%L_to_m**4*US%s_to_T)
if (CS%biharmonic) call Bchksum(Ah_q, "Ah_q", G%HI, haloshift=0, symmetric=.true., unscale=US%L_to_m**4*US%s_to_T)
endif

if (CS%id_FrictWorkIntz > 0) then
Expand Down

0 comments on commit 2af4d32

Please sign in to comment.