From 7ab2c3df595f3651292684ed5c500c58beb9e660 Mon Sep 17 00:00:00 2001 From: Robert Hallberg Date: Fri, 27 Dec 2024 17:06:32 -0500 Subject: [PATCH] Debugging checksum on full range of Kh_h and Kh_q 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. --- src/parameterizations/lateral/MOM_hor_visc.F90 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/parameterizations/lateral/MOM_hor_visc.F90 b/src/parameterizations/lateral/MOM_hor_visc.F90 index eaf2102136..340f6e5308 100644 --- a/src/parameterizations/lateral/MOM_hor_visc.F90 +++ b/src/parameterizations/lateral/MOM_hor_visc.F90 @@ -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 @@ -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 @@ -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