Skip to content

Commit

Permalink
Use unscale arguments in 384 checksum calls
Browse files Browse the repository at this point in the history
  Replaced 382 scale arguments with unscale arguments in calls to chksum
routines, and did the same in another 5 calls to global_mean or global_integral
routines.  Also added 2 missing unscale arguments to checksums for the initial
velocities, which probably had gone undetected because we usually initialize
velocities to 0.  All answers and diagnostic debugging output (apart from the
afore noted checksums of the initial velocities in some rare case) are bitwise
identical.
  • Loading branch information
Hallberg-NOAA committed Jul 10, 2024
1 parent 2f2b790 commit a1fdd7c
Show file tree
Hide file tree
Showing 35 changed files with 395 additions and 392 deletions.
72 changes: 36 additions & 36 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,7 @@ subroutine step_MOM_dynamics(forces, p_surf_begin, p_surf_end, dt, dt_thermo, &
if ((CS%thickness_diffuse .or. CS%interface_filter) .and. &
.not.CS%thickness_diffuse_first) then

if (CS%debug) call hchksum(h,"Pre-thickness_diffuse h", G%HI, haloshift=0, scale=GV%H_to_MKS)
if (CS%debug) call hchksum(h,"Pre-thickness_diffuse h", G%HI, haloshift=0, unscale=GV%H_to_MKS)

if (CS%thickness_diffuse) then
call cpu_clock_begin(id_clock_thick_diff)
Expand All @@ -1306,7 +1306,7 @@ subroutine step_MOM_dynamics(forces, p_surf_begin, p_surf_end, dt, dt_thermo, &
call thickness_diffuse(h, CS%uhtr, CS%vhtr, CS%tv, dt, G, GV, US, &
CS%MEKE, CS%VarMix, CS%CDp, CS%thickness_diffuse_CSp)

if (CS%debug) call hchksum(h,"Post-thickness_diffuse h", G%HI, haloshift=1, scale=GV%H_to_MKS)
if (CS%debug) call hchksum(h,"Post-thickness_diffuse h", G%HI, haloshift=1, unscale=GV%H_to_MKS)
call cpu_clock_end(id_clock_thick_diff)
call pass_var(h, G%Domain, clock=id_clock_pass, halo=max(2,CS%cont_stencil))
if (showCallTree) call callTree_waypoint("finished thickness_diffuse (step_MOM)")
Expand All @@ -1327,19 +1327,19 @@ subroutine step_MOM_dynamics(forces, p_surf_begin, p_surf_end, dt, dt_thermo, &
! apply the submesoscale mixed layer restratification parameterization
if (CS%mixedlayer_restrat) then
if (CS%debug) then
call hchksum(h,"Pre-mixedlayer_restrat h", G%HI, haloshift=1, scale=GV%H_to_MKS)
call hchksum(h,"Pre-mixedlayer_restrat h", G%HI, haloshift=1, unscale=GV%H_to_MKS)
call uvchksum("Pre-mixedlayer_restrat uhtr", &
CS%uhtr, CS%vhtr, G%HI, haloshift=0, scale=GV%H_to_MKS*US%L_to_m**2)
CS%uhtr, CS%vhtr, G%HI, haloshift=0, unscale=GV%H_to_MKS*US%L_to_m**2)
endif
call cpu_clock_begin(id_clock_ml_restrat)
call mixedlayer_restrat(h, CS%uhtr, CS%vhtr, CS%tv, forces, dt, CS%visc%MLD, CS%visc%h_ML, &
CS%visc%sfc_buoy_flx, CS%VarMix, G, GV, US, CS%mixedlayer_restrat_CSp)
call cpu_clock_end(id_clock_ml_restrat)
call pass_var(h, G%Domain, clock=id_clock_pass, halo=max(2,CS%cont_stencil))
if (CS%debug) then
call hchksum(h,"Post-mixedlayer_restrat h", G%HI, haloshift=1, scale=GV%H_to_MKS)
call hchksum(h,"Post-mixedlayer_restrat h", G%HI, haloshift=1, unscale=GV%H_to_MKS)
call uvchksum("Post-mixedlayer_restrat [uv]htr", &
CS%uhtr, CS%vhtr, G%HI, haloshift=0, scale=GV%H_to_MKS*US%L_to_m**2)
CS%uhtr, CS%vhtr, G%HI, haloshift=0, unscale=GV%H_to_MKS*US%L_to_m**2)
endif
endif

Expand Down Expand Up @@ -1410,15 +1410,15 @@ subroutine step_MOM_tracer_dyn(CS, G, GV, US, h, Time_local)

if (CS%debug) then
call cpu_clock_begin(id_clock_other)
call hchksum(h,"Pre-advection h", G%HI, haloshift=1, scale=GV%H_to_MKS)
call hchksum(h,"Pre-advection h", G%HI, haloshift=1, unscale=GV%H_to_MKS)
call uvchksum("Pre-advection uhtr", CS%uhtr, CS%vhtr, G%HI, &
haloshift=0, scale=GV%H_to_MKS*US%L_to_m**2)
if (associated(CS%tv%T)) call hchksum(CS%tv%T, "Pre-advection T", G%HI, haloshift=1, scale=US%C_to_degC)
if (associated(CS%tv%S)) call hchksum(CS%tv%S, "Pre-advection S", G%HI, haloshift=1, scale=US%S_to_ppt)
haloshift=0, unscale=GV%H_to_MKS*US%L_to_m**2)
if (associated(CS%tv%T)) call hchksum(CS%tv%T, "Pre-advection T", G%HI, haloshift=1, unscale=US%C_to_degC)
if (associated(CS%tv%S)) call hchksum(CS%tv%S, "Pre-advection S", G%HI, haloshift=1, unscale=US%S_to_ppt)
if (associated(CS%tv%frazil)) call hchksum(CS%tv%frazil, "Pre-advection frazil", G%HI, haloshift=0, &
scale=US%Q_to_J_kg*US%RZ_to_kg_m2)
unscale=US%Q_to_J_kg*US%RZ_to_kg_m2)
if (associated(CS%tv%salt_deficit)) call hchksum(CS%tv%salt_deficit, &
"Pre-advection salt deficit", G%HI, haloshift=0, scale=US%S_to_ppt*US%RZ_to_kg_m2)
"Pre-advection salt deficit", G%HI, haloshift=0, unscale=US%S_to_ppt*US%RZ_to_kg_m2)
! call MOM_thermo_chksum("Pre-advection ", CS%tv, G, US)
call cpu_clock_end(id_clock_other)
endif
Expand Down Expand Up @@ -1593,10 +1593,10 @@ subroutine step_MOM_thermo(CS, G, GV, US, u, v, h, tv, fluxes, dtdia, &
call cpu_clock_begin(id_clock_thermo)
if (.not.CS%adiabatic) then
if (CS%debug) then
call uvchksum("Pre-diabatic [uv]", u, v, G%HI, haloshift=2, scale=US%L_T_to_m_s)
call hchksum(h,"Pre-diabatic h", G%HI, haloshift=1, scale=GV%H_to_MKS)
call uvchksum("Pre-diabatic [uv]", u, v, G%HI, haloshift=2, unscale=US%L_T_to_m_s)
call hchksum(h,"Pre-diabatic h", G%HI, haloshift=1, unscale=GV%H_to_MKS)
call uvchksum("Pre-diabatic [uv]h", CS%uhtr, CS%vhtr, G%HI, &
haloshift=0, scale=GV%H_to_MKS*US%L_to_m**2)
haloshift=0, unscale=GV%H_to_MKS*US%L_to_m**2)
! call MOM_state_chksum("Pre-diabatic ", u, v, h, CS%uhtr, CS%vhtr, G, GV, vel_scale=1.0)
call MOM_thermo_chksum("Pre-diabatic ", tv, G, US, haloshift=0)
call check_redundant("Pre-diabatic ", u, v, G, unscale=US%L_T_to_m_s)
Expand Down Expand Up @@ -1634,8 +1634,8 @@ subroutine step_MOM_thermo(CS, G, GV, US, u, v, h, tv, fluxes, dtdia, &

if (CS%debug) then
call MOM_state_chksum("Pre-ALE ", u, v, h, CS%uh, CS%vh, G, GV, US, omit_corners=.true.)
call hchksum(tv%T,"Pre-ALE T", G%HI, haloshift=1, omit_corners=.true., scale=US%C_to_degC)
call hchksum(tv%S,"Pre-ALE S", G%HI, haloshift=1, omit_corners=.true., scale=US%S_to_ppt)
call hchksum(tv%T,"Pre-ALE T", G%HI, haloshift=1, omit_corners=.true., unscale=US%C_to_degC)
call hchksum(tv%S,"Pre-ALE S", G%HI, haloshift=1, omit_corners=.true., unscale=US%S_to_ppt)
call check_redundant("Pre-ALE ", u, v, G, unscale=US%L_T_to_m_s)
endif
call cpu_clock_begin(id_clock_ALE)
Expand Down Expand Up @@ -1720,8 +1720,8 @@ subroutine step_MOM_thermo(CS, G, GV, US, u, v, h, tv, fluxes, dtdia, &

if (CS%debug .and. CS%use_ALE_algorithm) then
call MOM_state_chksum("Post-ALE ", u, v, h, CS%uh, CS%vh, G, GV, US)
call hchksum(tv%T, "Post-ALE T", G%HI, haloshift=1, scale=US%C_to_degC)
call hchksum(tv%S, "Post-ALE S", G%HI, haloshift=1, scale=US%S_to_ppt)
call hchksum(tv%T, "Post-ALE T", G%HI, haloshift=1, unscale=US%C_to_degC)
call hchksum(tv%S, "Post-ALE S", G%HI, haloshift=1, unscale=US%S_to_ppt)
call check_redundant("Post-ALE ", u, v, G, unscale=US%L_T_to_m_s)
endif

Expand All @@ -1734,18 +1734,18 @@ subroutine step_MOM_thermo(CS, G, GV, US, u, v, h, tv, fluxes, dtdia, &
call postALE_tracer_diagnostics(CS%tracer_Reg, G, GV, CS%diag, dtdia)

if (CS%debug) then
call uvchksum("Post-diabatic u", u, v, G%HI, haloshift=2, scale=US%L_T_to_m_s)
call hchksum(h, "Post-diabatic h", G%HI, haloshift=1, scale=GV%H_to_MKS)
call uvchksum("Post-diabatic u", u, v, G%HI, haloshift=2, unscale=US%L_T_to_m_s)
call hchksum(h, "Post-diabatic h", G%HI, haloshift=1, unscale=GV%H_to_MKS)
call uvchksum("Post-diabatic [uv]h", CS%uhtr, CS%vhtr, G%HI, &
haloshift=0, scale=GV%H_to_MKS*US%L_to_m**2)
haloshift=0, unscale=GV%H_to_MKS*US%L_to_m**2)
! call MOM_state_chksum("Post-diabatic ", u, v, &
! h, CS%uhtr, CS%vhtr, G, GV, haloshift=1)
if (associated(tv%T)) call hchksum(tv%T, "Post-diabatic T", G%HI, haloshift=1, scale=US%C_to_degC)
if (associated(tv%S)) call hchksum(tv%S, "Post-diabatic S", G%HI, haloshift=1, scale=US%S_to_ppt)
if (associated(tv%T)) call hchksum(tv%T, "Post-diabatic T", G%HI, haloshift=1, unscale=US%C_to_degC)
if (associated(tv%S)) call hchksum(tv%S, "Post-diabatic S", G%HI, haloshift=1, unscale=US%S_to_ppt)
if (associated(tv%frazil)) call hchksum(tv%frazil, "Post-diabatic frazil", G%HI, haloshift=0, &
scale=US%Q_to_J_kg*US%RZ_to_kg_m2)
unscale=US%Q_to_J_kg*US%RZ_to_kg_m2)
if (associated(tv%salt_deficit)) call hchksum(tv%salt_deficit, &
"Post-diabatic salt deficit", G%HI, haloshift=0, scale=US%RZ_to_kg_m2)
"Post-diabatic salt deficit", G%HI, haloshift=0, unscale=US%RZ_to_kg_m2)
! call MOM_thermo_chksum("Post-diabatic ", tv, G, US)
call check_redundant("Post-diabatic ", u, v, G, unscale=US%L_T_to_m_s)
endif
Expand All @@ -1765,8 +1765,8 @@ subroutine step_MOM_thermo(CS, G, GV, US, u, v, h, tv, fluxes, dtdia, &
call create_group_pass(pass_T_S, tv%S, G%Domain, To_All+Omit_Corners, halo=dynamics_stencil)
call do_group_pass(pass_T_S, G%Domain, clock=id_clock_pass)
if (CS%debug) then
if (associated(tv%T)) call hchksum(tv%T, "Post-diabatic T", G%HI, haloshift=1, scale=US%C_to_degC)
if (associated(tv%S)) call hchksum(tv%S, "Post-diabatic S", G%HI, haloshift=1, scale=US%S_to_ppt)
if (associated(tv%T)) call hchksum(tv%T, "Post-diabatic T", G%HI, haloshift=1, unscale=US%C_to_degC)
if (associated(tv%S)) call hchksum(tv%S, "Post-diabatic S", G%HI, haloshift=1, unscale=US%S_to_ppt)
endif

! Update derived thermodynamic quantities.
Expand Down Expand Up @@ -3031,7 +3031,7 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, &

if (use_ice_shelf .and. CS%debug) then
call hchksum(CS%frac_shelf_h, "MOM:frac_shelf_h", G%HI, haloshift=0)
call hchksum(CS%mass_shelf, "MOM:mass_shelf", G%HI, haloshift=0,scale=US%RZ_to_kg_m2)
call hchksum(CS%mass_shelf, "MOM:mass_shelf", G%HI, haloshift=0, unscale=US%RZ_to_kg_m2)
endif

call cpu_clock_end(id_clock_MOM_init)
Expand Down Expand Up @@ -3070,8 +3070,8 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, &
! \todo This block exists for legacy reasons and we should phase it out of
! all examples. !###
if (CS%debug) then
call uvchksum("Pre ALE adjust init cond [uv]", CS%u, CS%v, G%HI, haloshift=1)
call hchksum(CS%h,"Pre ALE adjust init cond h", G%HI, haloshift=1, scale=GV%H_to_MKS)
call uvchksum("Pre ALE adjust init cond [uv]", CS%u, CS%v, G%HI, haloshift=1, unscale=US%L_T_to_m_s)
call hchksum(CS%h,"Pre ALE adjust init cond h", G%HI, haloshift=1, unscale=GV%H_to_MKS)
endif
call callTree_waypoint("Calling adjustGridForIntegrity() to remap initial conditions (initialize_MOM)")
call adjustGridForIntegrity(CS%ALE_CSp, G, GV, CS%h )
Expand Down Expand Up @@ -3128,11 +3128,11 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, &
call cpu_clock_end(id_clock_pass_init)

if (CS%debug) then
call uvchksum("Post ALE adjust init cond [uv]", CS%u, CS%v, G%HI, haloshift=1)
call hchksum(CS%h, "Post ALE adjust init cond h", G%HI, haloshift=2, scale=GV%H_to_MKS)
call uvchksum("Post ALE adjust init cond [uv]", CS%u, CS%v, G%HI, haloshift=1, unscale=US%L_T_to_m_s)
call hchksum(CS%h, "Post ALE adjust init cond h", G%HI, haloshift=2, unscale=GV%H_to_MKS)
if (use_temperature) then
call hchksum(CS%tv%T, "Post ALE adjust init cond T", G%HI, haloshift=2, scale=US%C_to_degC)
call hchksum(CS%tv%S, "Post ALE adjust init cond S", G%HI, haloshift=2, scale=US%S_to_ppt)
call hchksum(CS%tv%T, "Post ALE adjust init cond T", G%HI, haloshift=2, unscale=US%C_to_degC)
call hchksum(CS%tv%S, "Post ALE adjust init cond S", G%HI, haloshift=2, unscale=US%S_to_ppt)
endif
endif
endif
Expand Down Expand Up @@ -4130,7 +4130,7 @@ subroutine get_ocean_stocks(CS, mass, heat, salt, on_PE_only)
heat = CS%US%Q_to_J_kg*CS%tv%C_p * &
global_mass_integral(CS%h, CS%G, CS%GV, CS%tv%T, on_PE_only=on_PE_only, tmp_scale=CS%US%C_to_degC)
if (present(salt)) &
salt = 1.0e-3 * global_mass_integral(CS%h, CS%G, CS%GV, CS%tv%S, on_PE_only=on_PE_only, scale=CS%US%S_to_ppt)
salt = 1.0e-3 * global_mass_integral(CS%h, CS%G, CS%GV, CS%tv%S, on_PE_only=on_PE_only, unscale=CS%US%S_to_ppt)

end subroutine get_ocean_stocks

Expand Down
56 changes: 28 additions & 28 deletions src/core/MOM_barotropic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1725,33 +1725,33 @@ subroutine btstep(U_in, V_in, eta_in, dt, bc_accel_u, bc_accel_v, forces, pbce,

if (CS%debug) then
call uvchksum("BT [uv]hbt", uhbt, vhbt, CS%debug_BT_HI, haloshift=0, &
scale=US%s_to_T*US%L_to_m**2*GV%H_to_m)
call uvchksum("BT Initial [uv]bt", ubt, vbt, CS%debug_BT_HI, haloshift=0, scale=US%L_T_to_m_s)
call hchksum(eta, "BT Initial eta", CS%debug_BT_HI, haloshift=0, scale=GV%H_to_MKS)
unscale=US%s_to_T*US%L_to_m**2*GV%H_to_m)
call uvchksum("BT Initial [uv]bt", ubt, vbt, CS%debug_BT_HI, haloshift=0, unscale=US%L_T_to_m_s)
call hchksum(eta, "BT Initial eta", CS%debug_BT_HI, haloshift=0, unscale=GV%H_to_MKS)
call uvchksum("BT BT_force_[uv]", BT_force_u, BT_force_v, &
CS%debug_BT_HI, haloshift=0, scale=US%L_T2_to_m_s2)
CS%debug_BT_HI, haloshift=0, unscale=US%L_T2_to_m_s2)
if (interp_eta_PF) then
call hchksum(eta_PF_1, "BT eta_PF_1",CS%debug_BT_HI,haloshift=0, scale=GV%H_to_MKS)
call hchksum(d_eta_PF, "BT d_eta_PF",CS%debug_BT_HI,haloshift=0, scale=GV%H_to_MKS)
call hchksum(eta_PF_1, "BT eta_PF_1",CS%debug_BT_HI,haloshift=0, unscale=GV%H_to_MKS)
call hchksum(d_eta_PF, "BT d_eta_PF",CS%debug_BT_HI,haloshift=0, unscale=GV%H_to_MKS)
else
call hchksum(eta_PF, "BT eta_PF",CS%debug_BT_HI,haloshift=0, scale=GV%H_to_MKS)
call hchksum(eta_PF_in, "BT eta_PF_in",G%HI,haloshift=0, scale=GV%H_to_MKS)
call hchksum(eta_PF, "BT eta_PF",CS%debug_BT_HI,haloshift=0, unscale=GV%H_to_MKS)
call hchksum(eta_PF_in, "BT eta_PF_in",G%HI,haloshift=0, unscale=GV%H_to_MKS)
endif
call uvchksum("BT Cor_ref_[uv]", Cor_ref_u, Cor_ref_v, CS%debug_BT_HI, haloshift=0, scale=US%L_T2_to_m_s2)
call uvchksum("BT Cor_ref_[uv]", Cor_ref_u, Cor_ref_v, CS%debug_BT_HI, haloshift=0, unscale=US%L_T2_to_m_s2)
call uvchksum("BT [uv]hbt0", uhbt0, vhbt0, CS%debug_BT_HI, haloshift=0, &
scale=US%L_to_m**2*US%s_to_T*GV%H_to_m)
unscale=US%L_to_m**2*US%s_to_T*GV%H_to_m)
if (.not. use_BT_cont) then
call uvchksum("BT Dat[uv]", Datu, Datv, CS%debug_BT_HI, haloshift=1, scale=US%L_to_m*GV%H_to_m)
call uvchksum("BT Dat[uv]", Datu, Datv, CS%debug_BT_HI, haloshift=1, unscale=US%L_to_m*GV%H_to_m)
endif
call uvchksum("BT wt_[uv]", wt_u, wt_v, G%HI, haloshift=0, &
symmetric=.true., omit_corners=.true., scalar_pair=.true.)
call uvchksum("BT frhat[uv]", CS%frhatu, CS%frhatv, G%HI, haloshift=0, &
symmetric=.true., omit_corners=.true., scalar_pair=.true.)
call uvchksum("BT visc_rem_[uv]", visc_rem_u, visc_rem_v, G%HI, haloshift=0, &
symmetric=.true., omit_corners=.true., scalar_pair=.true.)
call uvchksum("BT bc_accel_[uv]", bc_accel_u, bc_accel_v, G%HI, haloshift=0, scale=US%L_T2_to_m_s2)
call uvchksum("BT bc_accel_[uv]", bc_accel_u, bc_accel_v, G%HI, haloshift=0, unscale=US%L_T2_to_m_s2)
call uvchksum("BT IDat[uv]", CS%IDatu, CS%IDatv, G%HI, haloshift=0, &
scale=GV%m_to_H, scalar_pair=.true.)
unscale=GV%m_to_H, scalar_pair=.true.)
call uvchksum("BT visc_rem_[uv]", visc_rem_u, visc_rem_v, G%HI, &
haloshift=1, scalar_pair=.true.)
endif
Expand Down Expand Up @@ -2324,22 +2324,22 @@ subroutine btstep(U_in, V_in, eta_in, dt, bc_accel_u, bc_accel_v, forces, pbce,
if (CS%debug_bt) then
write(mesg,'("BT vel update ",I4)') n
call uvchksum(trim(mesg)//" PF[uv]", PFu, PFv, CS%debug_BT_HI, haloshift=iev-ie, &
scale=US%L_T_to_m_s*US%s_to_T)
unscale=US%L_T_to_m_s*US%s_to_T)
call uvchksum(trim(mesg)//" Cor_[uv]", Cor_u, Cor_v, CS%debug_BT_HI, haloshift=iev-ie, &
scale=US%L_T_to_m_s*US%s_to_T)
unscale=US%L_T_to_m_s*US%s_to_T)
call uvchksum(trim(mesg)//" BT_force_[uv]", BT_force_u, BT_force_v, CS%debug_BT_HI, haloshift=iev-ie, &
scale=US%L_T_to_m_s*US%s_to_T)
unscale=US%L_T_to_m_s*US%s_to_T)
call uvchksum(trim(mesg)//" BT_rem_[uv]", BT_rem_u, BT_rem_v, CS%debug_BT_HI, &
haloshift=iev-ie, scalar_pair=.true.)
call uvchksum(trim(mesg)//" [uv]bt", ubt, vbt, CS%debug_BT_HI, haloshift=iev-ie, &
scale=US%L_T_to_m_s)
unscale=US%L_T_to_m_s)
call uvchksum(trim(mesg)//" [uv]bt_trans", ubt_trans, vbt_trans, CS%debug_BT_HI, haloshift=iev-ie, &
scale=US%L_T_to_m_s)
unscale=US%L_T_to_m_s)
call uvchksum(trim(mesg)//" [uv]hbt", uhbt, vhbt, CS%debug_BT_HI, haloshift=iev-ie, &
scale=US%s_to_T*US%L_to_m**2*GV%H_to_m)
unscale=US%s_to_T*US%L_to_m**2*GV%H_to_m)
if (integral_BT_cont) &
call uvchksum(trim(mesg)//" [uv]hbt_int", uhbt_int, vhbt_int, CS%debug_BT_HI, haloshift=iev-ie, &
scale=US%L_to_m**2*GV%H_to_m)
unscale=US%L_to_m**2*GV%H_to_m)
endif

if (find_PF) then
Expand Down Expand Up @@ -2426,10 +2426,10 @@ subroutine btstep(U_in, V_in, eta_in, dt, bc_accel_u, bc_accel_v, forces, pbce,

if (CS%debug_bt) then
call uvchksum("BT [uv]hbt just after OBC", uhbt, vhbt, CS%debug_BT_HI, haloshift=iev-ie, &
scale=US%s_to_T*US%L_to_m**2*GV%H_to_m)
unscale=US%s_to_T*US%L_to_m**2*GV%H_to_m)
if (integral_BT_cont) &
call uvchksum("BT [uv]hbt_int just after OBC", uhbt_int, vhbt_int, CS%debug_BT_HI, &
haloshift=iev-ie, scale=US%L_to_m**2*GV%H_to_m)
haloshift=iev-ie, unscale=US%L_to_m**2*GV%H_to_m)
endif

if (integral_BT_cont) then
Expand Down Expand Up @@ -2463,8 +2463,8 @@ subroutine btstep(U_in, V_in, eta_in, dt, bc_accel_u, bc_accel_v, forces, pbce,
if (CS%debug_bt) then
write(mesg,'("BT step ",I4)') n
call uvchksum(trim(mesg)//" [uv]bt", ubt, vbt, CS%debug_BT_HI, haloshift=iev-ie, &
scale=US%L_T_to_m_s)
call hchksum(eta, trim(mesg)//" eta", CS%debug_BT_HI, haloshift=iev-ie, scale=GV%H_to_MKS)
unscale=US%L_T_to_m_s)
call hchksum(eta, trim(mesg)//" eta", CS%debug_BT_HI, haloshift=iev-ie, unscale=GV%H_to_MKS)
endif

if (GV%Boussinesq) then
Expand Down Expand Up @@ -2947,8 +2947,8 @@ subroutine set_dtbt(G, GV, US, CS, eta, pbce, BT_cont, gtot_est, SSH_add)
CS%dtbt_max = dtbt_max

if (CS%debug) then
call chksum0(CS%dtbt, "End set_dtbt dtbt", scale=US%T_to_s)
call chksum0(CS%dtbt_max, "End set_dtbt dtbt_max", scale=US%T_to_s)
call chksum0(CS%dtbt, "End set_dtbt dtbt", unscale=US%T_to_s)
call chksum0(CS%dtbt_max, "End set_dtbt dtbt_max", unscale=US%T_to_s)
endif

end subroutine set_dtbt
Expand Down Expand Up @@ -3698,9 +3698,9 @@ subroutine btcalc(h, G, GV, CS, h_u, h_v, may_use_default, OBC)
scalar_pair=.true.)
if (present(h_u) .and. present(h_v)) &
call uvchksum("btcalc h_[uv]", h_u, h_v, G%HI, haloshift=0, &
symmetric=.true., omit_corners=.true., scale=GV%H_to_MKS, &
symmetric=.true., omit_corners=.true., unscale=GV%H_to_MKS, &
scalar_pair=.true.)
call hchksum(h, "btcalc h",G%HI, haloshift=1, scale=GV%H_to_MKS)
call hchksum(h, "btcalc h",G%HI, haloshift=1, unscale=GV%H_to_MKS)
endif

end subroutine btcalc
Expand Down
Loading

0 comments on commit a1fdd7c

Please sign in to comment.