Skip to content

Commit

Permalink
Introduce uvchksum_pair and replace most calls to uchskum, vchksum. m…
Browse files Browse the repository at this point in the history
  • Loading branch information
nichannah committed Mar 24, 2017
1 parent 94a8864 commit 1b70831
Show file tree
Hide file tree
Showing 19 changed files with 353 additions and 243 deletions.
54 changes: 27 additions & 27 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module MOM
use MOM_variables, only: thermo_var_ptrs

! Infrastructure modules
use MOM_debugging, only : MOM_debugging_init, hchksum, uchksum, vchksum
use MOM_debugging, only : MOM_debugging_init, hchksum, uvchksum_pair
use MOM_checksum_packages, only : MOM_thermo_chksum, MOM_state_chksum, MOM_accel_chksum
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
use MOM_cpu_clock, only : CLOCK_COMPONENT, CLOCK_SUBCOMPONENT
Expand Down Expand Up @@ -692,8 +692,8 @@ subroutine step_MOM(fluxes, state, Time_start, time_interval, CS)
! and set_viscous_BBL is called as a part of the dynamic stepping.

if (CS%debug) then
call uchksum(u,"Pre set_viscous_BBL u", G%HI, haloshift=1)
call vchksum(v,"Pre set_viscous_BBL v", G%HI, haloshift=1)
call uvchksum_pair(u,"Pre set_viscous_BBL u", &
v,"Pre set_viscous_BBL v", G%HI, haloshift=1)
call hchksum(h*GV%H_to_m,"Pre set_viscous_BBL h", G%HI, haloshift=1)
if (associated(CS%tv%T)) call hchksum(CS%tv%T, "Pre set_viscous_BBL T", G%HI, haloshift=1)
if (associated(CS%tv%S)) call hchksum(CS%tv%S, "Pre set_viscous_BBL S", G%HI, haloshift=1)
Expand Down Expand Up @@ -790,11 +790,11 @@ subroutine step_MOM(fluxes, state, Time_start, time_interval, CS)
call post_diags_TS_vardec(G, CS, dtdia)

if (CS%debug) then
call uchksum(u,"Post-dia first u", G%HI, haloshift=2)
call vchksum(v,"Post-dia first v", G%HI, haloshift=2)
call uvchksum_pair(u,"Post-dia first u", &
v,"Post-dia first v", G%HI, haloshift=2)
call hchksum(h,"Post-dia first h", G%HI, haloshift=1)
call uchksum(CS%uhtr,"Post-dia first uh", G%HI, haloshift=0)
call vchksum(CS%vhtr,"Post-dia first vh", G%HI, haloshift=0)
call uvchksum_pair(CS%uhtr,"Post-dia first uh", &
CS%vhtr,"Post-dia first vh", G%HI, haloshift=0)
! call MOM_state_chksum("Post-dia first ", u, v, &
! h, CS%uhtr, CS%vhtr, G, GV, haloshift=1)
if (associated(CS%tv%T)) call hchksum(CS%tv%T, "Post-dia first T", G%HI, haloshift=1)
Expand Down Expand Up @@ -969,8 +969,8 @@ subroutine step_MOM(fluxes, state, Time_start, time_interval, CS)
if (CS%mixedlayer_restrat) then
if (CS%debug) then
call hchksum(h,"Pre-mixedlayer_restrat h", G%HI, haloshift=1)
call uchksum(CS%uhtr,"Pre-mixedlayer_restrat uhtr", G%HI, haloshift=0)
call vchksum(CS%vhtr,"Pre-mixedlayer_restrat vhtr", G%HI, haloshift=0)
call uvchksum_pair(CS%uhtr,"Pre-mixedlayer_restrat uhtr", &
CS%vhtr,"Pre-mixedlayer_restrat vhtr", G%HI, haloshift=0)
endif
call cpu_clock_begin(id_clock_ml_restrat)
call mixedlayer_restrat(h, CS%uhtr ,CS%vhtr, CS%tv, fluxes, dt, CS%visc%MLD, &
Expand All @@ -981,8 +981,8 @@ subroutine step_MOM(fluxes, state, Time_start, time_interval, CS)
call cpu_clock_end(id_clock_pass)
if (CS%debug) then
call hchksum(h,"Post-mixedlayer_restrat h", G%HI, haloshift=1)
call uchksum(CS%uhtr,"Post-mixedlayer_restrat uhtr", G%HI, haloshift=0)
call vchksum(CS%vhtr,"Post-mixedlayer_restrat vhtr", G%HI, haloshift=0)
call uvchksum_pair(CS%uhtr,"Post-mixedlayer_restrat uhtr", &
CS%vhtr,"Post-mixedlayer_restrat vhtr", G%HI, haloshift=0)
endif
endif

Expand All @@ -1008,11 +1008,11 @@ subroutine step_MOM(fluxes, state, Time_start, time_interval, CS)
call cpu_clock_begin(id_clock_other)

if (CS%debug) then
call uchksum(u,"Pre-advection u", G%HI, haloshift=2)
call vchksum(v,"Pre-advection v", G%HI, haloshift=2)
call uvchksum_pair(u,"Pre-advection u", &
v,"Pre-advection v", G%HI, haloshift=2)
call hchksum(h*GV%H_to_m,"Pre-advection h", G%HI, haloshift=1)
call uchksum(CS%uhtr*GV%H_to_m,"Pre-advection uhtr", G%HI, haloshift=0)
call vchksum(CS%vhtr*GV%H_to_m,"Pre-advection vhtr", G%HI, haloshift=0)
call uvchksum_pair(CS%uhtr*GV%H_to_m,"Pre-advection uhtr", &
CS%vhtr*GV%H_to_m,"Pre-advection vhtr", G%HI, haloshift=0)
! call MOM_state_chksum("Pre-advection ", u, v, &
! h, CS%uhtr, CS%vhtr, G, GV, haloshift=1)
if (associated(CS%tv%T)) call hchksum(CS%tv%T, "Pre-advection T", G%HI, haloshift=1)
Expand Down Expand Up @@ -1095,11 +1095,11 @@ subroutine step_MOM(fluxes, state, Time_start, time_interval, CS)
endif

if (CS%debug) then
call uchksum(u,"Pre-diabatic u", G%HI, haloshift=2)
call vchksum(v,"Pre-diabatic v", G%HI, haloshift=2)
call uvchksum_pair(u,"Pre-diabatic u", &
v,"Pre-diabatic v", G%HI, haloshift=2)
call hchksum(h*GV%H_to_m,"Pre-diabatic h", G%HI, haloshift=1)
call uchksum(CS%uhtr*GV%H_to_m,"Pre-diabatic uh", G%HI, haloshift=0)
call vchksum(CS%vhtr*GV%H_to_m,"Pre-diabatic vh", G%HI, haloshift=0)
call uvchksum_pair(CS%uhtr*GV%H_to_m,"Pre-diabatic uh", &
CS%vhtr*GV%H_to_m,"Pre-diabatic vh", G%HI, haloshift=0)
! call MOM_state_chksum("Pre-diabatic ",u, v, h, CS%uhtr, CS%vhtr, G, GV)
call MOM_thermo_chksum("Pre-diabatic ", CS%tv, G,haloshift=0)
call check_redundant("Pre-diabatic ", u, v, G)
Expand Down Expand Up @@ -1173,11 +1173,11 @@ subroutine step_MOM(fluxes, state, Time_start, time_interval, CS)
call post_diags_TS_vardec(G, CS, CS%dt_trans)

if (CS%debug) then
call uchksum(u,"Post-diabatic u", G%HI, haloshift=2)
call vchksum(v,"Post-diabatic v", G%HI, haloshift=2)
call uvchksum_pair(u,"Post-diabatic u", &
v,"Post-diabatic v", G%HI, haloshift=2)
call hchksum(h*GV%H_to_m,"Post-diabatic h", G%HI, haloshift=1)
call uchksum(CS%uhtr*GV%H_to_m,"Post-diabatic uh", G%HI, haloshift=0)
call vchksum(CS%vhtr*GV%H_to_m,"Post-diabatic vh", G%HI, haloshift=0)
call uvchksum_pair(CS%uhtr*GV%H_to_m,"Post-diabatic uh", &
CS%vhtr*GV%H_to_m,"Post-diabatic vh", G%HI, haloshift=0)
! call MOM_state_chksum("Post-diabatic ", u, v, &
! h, CS%uhtr, CS%vhtr, G, GV, haloshift=1)
if (associated(CS%tv%T)) call hchksum(CS%tv%T, "Post-diabatic T", G%HI, haloshift=1)
Expand Down Expand Up @@ -2289,8 +2289,8 @@ subroutine initialize_MOM(Time, param_file, dirs, CS, Time_in, offline_tracer_mo
! \todo This block exists for legacy reasons and we should phase it out of
! all examples.
if (CS%debug) then
call uchksum(CS%u,"Pre ALE adjust init cond u", G%HI, haloshift=1)
call vchksum(CS%v,"Pre ALE adjust init cond v", G%HI, haloshift=1)
call uvchksum_pair(CS%u,"Pre ALE adjust init cond u", &
CS%v,"Pre ALE adjust init cond v", G%HI, haloshift=1)
call hchksum(CS%h*GV%H_to_m,"Pre ALE adjust init cond h", G%HI, haloshift=1)
endif
call callTree_waypoint("Calling adjustGridForIntegrity() to remap initial conditions (initialize_MOM)")
Expand Down Expand Up @@ -2323,8 +2323,8 @@ subroutine initialize_MOM(Time, param_file, dirs, CS, Time_in, offline_tracer_mo
call cpu_clock_end(id_clock_pass_init)

if (CS%debug) then
call uchksum(CS%u,"Post ALE adjust init cond u", G%HI, haloshift=1)
call vchksum(CS%v,"Post ALE adjust init cond v", G%HI, haloshift=1)
call uvchksum_pair(CS%u,"Post ALE adjust init cond u", &
CS%v,"Post ALE adjust init cond v", G%HI, haloshift=1)
call hchksum(CS%h*GV%H_to_m, "Post ALE adjust init cond h", G%HI, haloshift=1)
endif
endif
Expand Down
59 changes: 30 additions & 29 deletions src/core/MOM_barotropic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ module MOM_barotropic
!* *
!********+*********+*********+*********+*********+*********+*********+**

use MOM_debugging, only : hchksum, uchksum, vchksum
use MOM_debugging, only : hchksum, uvchksum_pair
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end, CLOCK_ROUTINE
use MOM_diag_mediator, only : post_data, query_averaging_enabled, register_diag_field
use MOM_diag_mediator, only : safe_alloc_ptr, diag_ctrl, enable_averaging
Expand Down Expand Up @@ -1461,38 +1461,38 @@ subroutine btstep(U_in, V_in, eta_in, dt, bc_accel_u, bc_accel_v, &
endif

if (CS%debug) then
call uchksum(uhbt*GV%H_to_m, "BT uhbt",CS%debug_BT_HI,haloshift=0)
call vchksum(vhbt*GV%H_to_m, "BT vhbt",CS%debug_BT_HI,haloshift=0)
call uchksum(ubt, "BT Initial ubt",CS%debug_BT_HI,haloshift=0)
call vchksum(vbt, "BT Initial vbt",CS%debug_BT_HI,haloshift=0)
call uvchksum_pair(uhbt*GV%H_to_m, "BT uhbt", &
vhbt*GV%H_to_m, "BT vhbt",CS%debug_BT_HI,haloshift=0)
call uvchksum_pair(ubt, "BT Initial ubt", &
vbt, "BT Initial vbt",CS%debug_BT_HI,haloshift=0)
call hchksum(GV%H_to_kg_m2*eta, "BT Initial eta",CS%debug_BT_HI,haloshift=0)
call uchksum(BT_force_u, "BT BT_force_u",CS%debug_BT_HI,haloshift=0)
call vchksum(BT_force_v, "BT BT_force_v",CS%debug_BT_HI,haloshift=0)
call uvchksum_pair(BT_force_u, "BT BT_force_u", &
BT_force_v, "BT BT_force_v",CS%debug_BT_HI,haloshift=0)
if (interp_eta_PF) then
call hchksum(GV%H_to_kg_m2*eta_PF_1, "BT eta_PF_1",CS%debug_BT_HI,haloshift=0)
call hchksum(GV%H_to_kg_m2*d_eta_PF, "BT d_eta_PF",CS%debug_BT_HI,haloshift=0)
else
call hchksum(GV%H_to_kg_m2*eta_PF, "BT eta_PF",CS%debug_BT_HI,haloshift=0)
call hchksum(GV%H_to_kg_m2*eta_PF_in, "BT eta_PF_in",G%HI,haloshift=0)
endif
call uchksum(Cor_ref_u, "BT Cor_ref_u",CS%debug_BT_HI,haloshift=0)
call vchksum(Cor_ref_v, "BT Cor_ref_v",CS%debug_BT_HI,haloshift=0)
call uchksum(uhbt0*GV%H_to_m, "BT uhbt0",CS%debug_BT_HI,haloshift=0)
call vchksum(vhbt0*GV%H_to_m, "BT vhbt0",CS%debug_BT_HI,haloshift=0)
call uvchksum_pair(Cor_ref_u, "BT Cor_ref_u", &
Cor_ref_v, "BT Cor_ref_v",CS%debug_BT_HI,haloshift=0)
call uvchksum_pair(uhbt0*GV%H_to_m, "BT uhbt0", &
vhbt0*GV%H_to_m, "BT vhbt0",CS%debug_BT_HI,haloshift=0)
if (.not. use_BT_cont) then
call uchksum(GV%H_to_m*Datu, "BT Datu",CS%debug_BT_HI,haloshift=1)
call vchksum(GV%H_to_m*Datv, "BT Datv",CS%debug_BT_HI,haloshift=1)
call uvchksum_pair(GV%H_to_m*Datu, "BT Datu", &
GV%H_to_m*Datv, "BT Datv",CS%debug_BT_HI,haloshift=1)
endif
call uchksum(wt_u, "BT wt_u",G%HI,haloshift=1)
call vchksum(wt_v, "BT wt_v",G%HI,haloshift=1)
call uchksum(CS%frhatu, "BT frhatu",G%HI,haloshift=1)
call vchksum(CS%frhatv, "BT frhatv",G%HI,haloshift=1)
call uchksum(bc_accel_u, "BT bc_accel_u",G%HI,haloshift=0)
call vchksum(bc_accel_v, "BT bc_accel_v",G%HI,haloshift=0)
call uchksum(CS%IDatu, "BT IDatu",G%HI,haloshift=0)
call vchksum(CS%IDatv, "BT IDatv",G%HI,haloshift=0)
call uchksum(visc_rem_u, "BT visc_rem_u",G%HI,haloshift=1)
call vchksum(visc_rem_v, "BT visc_rem_v",G%HI,haloshift=1)
call uvchksum_pair(wt_u, "BT wt_u", &
wt_v, "BT wt_v", G%HI, haloshift=1)
call uvchksum_pair(CS%frhatu, "BT frhatu", &
CS%frhatv, "BT frhatv",G%HI,haloshift=1)
call uvchksum_pair(bc_accel_u, "BT bc_accel_u", &
bc_accel_v, "BT bc_accel_v",G%HI,haloshift=0)
call uvchksum_pair(CS%IDatu, "BT IDatu", &
CS%IDatv, "BT IDatv",G%HI,haloshift=0)
call uvchksum_pair(visc_rem_u, "BT visc_rem_u", &
visc_rem_v, "BT visc_rem_v",G%HI,haloshift=1)
endif

if (query_averaging_enabled(CS%diag)) then
Expand Down Expand Up @@ -1970,8 +1970,9 @@ subroutine btstep(U_in, V_in, eta_in, dt, bc_accel_u, bc_accel_v, &
endif

if (CS%debug_bt) then
call uchksum(uhbt*GV%H_to_m, "BT uhbt just after OBC",CS%debug_BT_HI,haloshift=iev-ie)
call vchksum(vhbt*GV%H_to_m, "BT vhbt just after OBC",CS%debug_BT_HI,haloshift=iev-ie)
call uvchksum_pair(uhbt*GV%H_to_m, "BT uhbt just after OBC", &
vhbt*GV%H_to_m, "BT vhbt just after OBC", &
CS%debug_BT_HI,haloshift=iev-ie)
endif

!$OMP parallel do default(none) shared(isv,iev,jsv,jev,n,eta,eta_src,dtbt,CS,uhbt,vhbt,eta_wtd,wt_eta)
Expand All @@ -1997,8 +1998,8 @@ subroutine btstep(U_in, V_in, eta_in, dt, bc_accel_u, bc_accel_v, &

if (CS%debug_bt) then
write(mesg,'("BT step ",I4)') n
call uchksum(ubt, trim(mesg)//" ubt",CS%debug_BT_HI,haloshift=iev-ie)
call vchksum(vbt, trim(mesg)//" vbt",CS%debug_BT_HI,haloshift=iev-ie)
call uvchksum_pair(ubt, trim(mesg)//" ubt", &
vbt, trim(mesg)//" vbt",CS%debug_BT_HI,haloshift=iev-ie)
call hchksum(GV%H_to_kg_m2*eta, trim(mesg)//" eta",CS%debug_BT_HI,haloshift=iev-ie)
endif

Expand Down Expand Up @@ -3077,8 +3078,8 @@ subroutine btcalc(h, G, GV, CS, h_u, h_v, may_use_default)
enddo

if (CS%debug) then
call uchksum(CS%frhatu, "btcalc frhatu",G%HI,haloshift=1)
call vchksum(CS%frhatv, "btcalc frhatv",G%HI,haloshift=1)
call uvchksum_pair(CS%frhatu, "btcalc frhatu", &
CS%frhatv, "btcalc frhatv",G%HI,haloshift=1)
call hchksum(GV%H_to_m*h, "btcalc h",G%HI,haloshift=1)
endif

Expand Down
28 changes: 11 additions & 17 deletions src/core/MOM_checksum_packages.F90
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module MOM_checksum_packages
! This module provdes a several routines that do check-sums of groups
! of variables in the various dynamic solver routines.

use MOM_debugging, only : hchksum, uchksum, vchksum
use MOM_debugging, only : hchksum, uvchksum_pair
use MOM_domains, only : sum_across_PEs, min_across_PEs, max_across_PEs
use MOM_error_handler, only : MOM_mesg, is_root_pe
use MOM_grid, only : ocean_grid_type
Expand Down Expand Up @@ -77,11 +77,10 @@ subroutine MOM_state_chksum_5arg(mesg, u, v, h, uh, vh, G, GV, haloshift)
! counts, there must be no redundant points, so all variables use is..ie
! and js...je as their extent.
hs=1; if (present(haloshift)) hs=haloshift
call uchksum(u, mesg//" u",G%HI,haloshift=hs)
call vchksum(v, mesg//" v",G%HI,haloshift=hs)
call uvchksum_pair(u, mesg//" u", v, mesg//" v",G%HI,haloshift=hs)
call hchksum(GV%H_to_kg_m2*h, mesg//" h",G%HI,haloshift=hs)
call uchksum(GV%H_to_kg_m2*uh, mesg//" uh",G%HI,haloshift=hs)
call vchksum(GV%H_to_kg_m2*vh, mesg//" vh",G%HI,haloshift=hs)
call uvchksum_pair(GV%H_to_kg_m2*uh, mesg//" uh", GV%H_to_kg_m2*vh, mesg//" vh", &
G%HI,haloshift=hs)
end subroutine MOM_state_chksum_5arg

! =============================================================================
Expand Down Expand Up @@ -110,8 +109,7 @@ subroutine MOM_state_chksum_3arg(mesg, u, v, h, G, GV, haloshift)
! counts, there must be no redundant points, so all variables use is..ie
! and js...je as their extent.
hs=1; if (present(haloshift)) hs=haloshift
call uchksum(u, mesg//" u",G%HI,haloshift=hs)
call vchksum(v, mesg//" v",G%HI,haloshift=hs)
call uvchksum_pair(u, mesg//" u", v, mesg//" v",G%HI,haloshift=hs)
call hchksum(GV%H_to_kg_m2*h, mesg//" h",G%HI,haloshift=hs)
end subroutine MOM_state_chksum_3arg

Expand Down Expand Up @@ -184,18 +182,14 @@ subroutine MOM_accel_chksum(mesg, CAu, CAv, PFu, PFv, diffu, diffv, G, GV, pbce,
! Note that for the chksum calls to be useful for reproducing across PE
! counts, there must be no redundant points, so all variables use is..ie
! and js...je as their extent.
call uchksum(CAu, mesg//" CAu",G%HI,haloshift=0)
call vchksum(CAv, mesg//" CAv",G%HI,haloshift=0)
call uchksum(PFu, mesg//" PFu",G%HI,haloshift=0)
call vchksum(PFv, mesg//" PFv",G%HI,haloshift=0)
call uchksum(diffu, mesg//" diffu",G%HI,haloshift=0)
call vchksum(diffv, mesg//" diffv",G%HI,haloshift=0)
call uvchksum_pair(CAu, mesg//" CAu", CAv, mesg//" CAv",G%HI,haloshift=0)
call uvchksum_pair(PFu, mesg//" PFu", PFv, mesg//" PFv",G%HI,haloshift=0)
call uvchksum_pair(diffu, mesg//" diffu", diffv, mesg//" diffv",G%HI,haloshift=0)
if (present(pbce)) &
call hchksum(GV%kg_m2_to_H*pbce, mesg//" pbce",G%HI,haloshift=0)
if (present(u_accel_bt)) &
call uchksum(u_accel_bt, mesg//" u_accel_bt",G%HI,haloshift=0)
if (present(v_accel_bt)) &
call vchksum(v_accel_bt, mesg//" v_accel_bt",G%HI,haloshift=0)
if (present(u_accel_bt) .and. present(v_accel_bt)) &
call uvchksum_pair(u_accel_bt, mesg//" u_accel_bt", &
v_accel_bt, mesg//" v_accel_bt", G%HI,haloshift=0)
end subroutine MOM_accel_chksum

! =============================================================================
Expand Down
25 changes: 12 additions & 13 deletions src/core/MOM_dynamics_legacy_split.F90
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ module MOM_dynamics_legacy_split
use MOM_domains, only : pass_var_start, pass_var_complete
use MOM_domains, only : pass_vector_start, pass_vector_complete
use MOM_domains, only : To_South, To_West, To_All, CGRID_NE, SCALAR_PAIR
use MOM_debugging, only : hchksum, uchksum, vchksum
use MOM_debugging, only : hchksum, uvchksum_pair
use MOM_error_handler, only : MOM_error, MOM_mesg, FATAL, WARNING, is_root_pe
use MOM_error_handler, only : MOM_set_verbosity
use MOM_file_parser, only : get_param, log_version, param_file_type
Expand Down Expand Up @@ -684,11 +684,11 @@ subroutine step_MOM_dyn_legacy_split(u, v, h, tv, visc, &
call cpu_clock_end(id_clock_mom_update)

if (CS%debug) then
call uchksum(up,"Predictor 1 u",G%HI,haloshift=0)
call vchksum(vp,"Predictor 1 v",G%HI,haloshift=0)
call uvchksum_pair(up,"Predictor 1 u", vp,"Predictor 1 v", &
G%HI,haloshift=0)
call hchksum(GV%H_to_kg_m2*h,"Predictor 1 h",G%HI,haloshift=1)
call uchksum(GV%H_to_kg_m2*uh,"Predictor 1 uh",G%HI,haloshift=2)
call vchksum(GV%H_to_kg_m2*vh,"Predictor 1 vh",G%HI,haloshift=2)
call uvchksum_pair(GV%H_to_kg_m2*uh,"Predictor 1 uh", &
GV%H_to_kg_m2*vh,"Predictor 1 vh",G%HI,haloshift=2)
! call MOM_state_chksum("Predictor 1", up, vp, h, uh, vh, G, GV, haloshift=1)
call MOM_accel_chksum("Predictor accel", CS%CAu, CS%CAv, CS%PFu, CS%PFv, &
CS%diffu, CS%diffv, G, GV, CS%pbce, CS%u_accel_bt, CS%v_accel_bt)
Expand Down Expand Up @@ -803,8 +803,8 @@ subroutine step_MOM_dyn_legacy_split(u, v, h, tv, visc, &

if (CS%debug) then
call MOM_state_chksum("Predictor ", up, vp, hp, uh, vh, G, GV)
call uchksum(u_av,"Predictor avg u",G%HI,haloshift=1)
call vchksum(v_av,"Predictor avg v",G%HI,haloshift=1)
call uvchksum_pair(u_av,"Predictor avg u", &
v_av,"Predictor avg v",G%HI,haloshift=1)
call hchksum(GV%H_to_kg_m2*h_av,"Predictor avg h",G%HI,haloshift=0)
! call MOM_state_chksum("Predictor avg ", u_av, v_av, h_av,uh, vh, G, GV)
call check_redundant("Predictor up ", up, vp, G)
Expand Down Expand Up @@ -887,11 +887,10 @@ subroutine step_MOM_dyn_legacy_split(u, v, h, tv, visc, &
call cpu_clock_end(id_clock_mom_update)

if (CS%debug) then
call uchksum(u,"Corrector 1 u",G%HI,haloshift=0)
call vchksum(v,"Corrector 1 v",G%HI,haloshift=0)
call uvchksum_pair(u,"Corrector 1 u", v,"Corrector 1 v", G%HI, haloshift=0)
call hchksum(GV%H_to_kg_m2*h,"Corrector 1 h",G%HI,haloshift=2)
call uchksum(GV%H_to_kg_m2*uh,"Corrector 1 uh",G%HI,haloshift=2)
call vchksum(GV%H_to_kg_m2*vh,"Corrector 1 vh",G%HI,haloshift=2)
call uvchksum_pair(GV%H_to_kg_m2*uh,"Corrector 1 uh", &
GV%H_to_kg_m2*vh,"Corrector 1 vh",G%HI,haloshift=2)
! call MOM_state_chksum("Corrector 1", u, v, h, uh, vh, G, GV, haloshift=1)
call MOM_accel_chksum("Corrector accel", CS%CAu, CS%CAv, CS%PFu, CS%PFv, &
CS%diffu, CS%diffv, G, GV, CS%pbce, CS%u_accel_bt, CS%v_accel_bt)
Expand Down Expand Up @@ -1048,8 +1047,8 @@ subroutine step_MOM_dyn_legacy_split(u, v, h, tv, visc, &
if (CS%id_dv_adj > 0) call post_data(CS%id_dv_adj, CS%ADp%dv_other, CS%diag)
if (CS%debug) then
call MOM_state_chksum("Corrector ", u, v, h, uh, vh, G, GV)
call uchksum(u_av,"Corrector avg u",G%HI,haloshift=1)
call vchksum(v_av,"Corrector avg v",G%HI,haloshift=1)
call uvchksum_pair(u_av,"Corrector avg u", &
v_av,"Corrector avg v", G%HI, haloshift=1)
call hchksum(GV%H_to_kg_m2*h_av,"Corrector avg h",G%HI,haloshift=1)
! call MOM_state_chksum("Corrector avg ", u_av, v_av, h_av, uh, vh, G, GV)
endif
Expand Down
Loading

0 comments on commit 1b70831

Please sign in to comment.