Skip to content

Commit ee686c8

Browse files
committed
Improve MOM_surface_chksum
Added checksum calls for the melt_potential, ocean_mass, ocean_heat and ocean_salt elements of the surface state in MOM_surface_chksum if these fields are allocated for more comprehensive debugging. Also added the symmetric optional argument to the call to MOM_surface_chksum form extract_surface_state so that all of the surface velocity values that could contribute to the ocean surface velocities that are seen by the coupler are checksummed. All solutions are bitwise identical, but there are enhancements to the MOM6 debugging capabilities.
1 parent 40f4721 commit ee686c8

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/core/MOM.F90

+1-1
Original file line numberDiff line numberDiff line change
@@ -4028,7 +4028,7 @@ subroutine extract_surface_state(CS, sfc_state_in)
40284028
endif
40294029
endif
40304030

4031-
if (CS%debug) call MOM_surface_chksum("Post extract_sfc", sfc_state, G, US, haloshift=0)
4031+
if (CS%debug) call MOM_surface_chksum("Post extract_sfc", sfc_state, G, US, haloshift=0, symmetric=.true.)
40324032

40334033
! Rotate sfc_state back onto the input grid, sfc_state_in
40344034
if (CS%rotate_index) then

src/core/MOM_checksum_packages.F90

+9-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ subroutine MOM_surface_chksum(mesg, sfc_state, G, US, haloshift, symmetric)
167167
logical :: sym
168168

169169
sym = .false. ; if (present(symmetric)) sym = symmetric
170-
hs = 1 ; if (present(haloshift)) hs = haloshift
170+
hs = 0 ; if (present(haloshift)) hs = haloshift
171171

172172
if (allocated(sfc_state%SST)) call hchksum(sfc_state%SST, mesg//" SST", G%HI, haloshift=hs, &
173173
scale=US%C_to_degC)
@@ -182,6 +182,14 @@ subroutine MOM_surface_chksum(mesg, sfc_state, G, US, haloshift, symmetric)
182182
scale=US%L_T_to_m_s)
183183
if (allocated(sfc_state%frazil)) call hchksum(sfc_state%frazil, mesg//" frazil", G%HI, &
184184
haloshift=hs, scale=US%Q_to_J_kg*US%RZ_to_kg_m2)
185+
if (allocated(sfc_state%melt_potential)) call hchksum(sfc_state%melt_potential, mesg//" melt_potential", &
186+
G%HI, haloshift=hs, scale=US%Q_to_J_kg*US%RZ_to_kg_m2)
187+
if (allocated(sfc_state%ocean_mass)) call hchksum(sfc_state%ocean_mass, mesg//" ocean_mass", &
188+
G%HI, haloshift=hs, scale=US%RZ_to_kg_m2)
189+
if (allocated(sfc_state%ocean_heat)) call hchksum(sfc_state%ocean_heat, mesg//" ocean_heat", &
190+
G%HI, haloshift=hs, scale=US%C_to_degC*US%RZ_to_kg_m2)
191+
if (allocated(sfc_state%ocean_salt)) call hchksum(sfc_state%ocean_salt, mesg//" ocean_salt", &
192+
G%HI, haloshift=hs, scale=US%S_to_ppt*US%RZ_to_kg_m2)
185193

186194
end subroutine MOM_surface_chksum
187195

0 commit comments

Comments
 (0)