Skip to content

Commit

Permalink
Merge pull request #95 from alperaltuntas/fix_debug_mode
Browse files Browse the repository at this point in the history
Fixes for debug mode
  • Loading branch information
gustavo-marques authored Apr 24, 2019
2 parents acb4d3f + 03a5586 commit 42582a1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
12 changes: 6 additions & 6 deletions src/ice_shelf/MOM_ice_shelf.F90
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ subroutine shelf_calc_flux(state, fluxes, Time, time_step, CS, forces)
if (CS%mass_from_file) call update_shelf_mass(G, CS, ISS, Time)
endif

if (CS%DEBUG) then
if (CS%debug) then
call hchksum(fluxes%frac_shelf_h, "frac_shelf_h before apply melting", G%HI, haloshift=0)
call hchksum(state%sst, "sst before apply melting", G%HI, haloshift=0)
call hchksum(state%sss, "sss before apply melting", G%HI, haloshift=0)
Expand Down Expand Up @@ -650,7 +650,7 @@ subroutine shelf_calc_flux(state, fluxes, Time, time_step, CS, forces)
endif
endif

if (CS%DEBUG) call MOM_forcing_chksum("Before add shelf flux", fluxes, G, US, haloshift=0)
if (CS%debug) call MOM_forcing_chksum("Before add shelf flux", fluxes, G, haloshift=0)

call add_shelf_flux(G, CS, state, fluxes)

Expand Down Expand Up @@ -692,7 +692,7 @@ subroutine shelf_calc_flux(state, fluxes, Time, time_step, CS, forces)

call cpu_clock_end(id_clock_shelf)

if (CS%DEBUG) call MOM_forcing_chksum("End of shelf calc flux", fluxes, G, US, haloshift=0)
if (CS%debug) call MOM_forcing_chksum("End of shelf calc flux", fluxes, G, haloshift=0)

end subroutine shelf_calc_flux

Expand Down Expand Up @@ -1055,8 +1055,8 @@ subroutine add_shelf_flux(G, CS, state, fluxes)
endif
enddo ; enddo

if (CS%DEBUG) then
write(mesg,*) 'Mean melt flux [kg m-2 s-1], dt = ', mean_melt_flux, CS%time_step
if (CS%debug) then
write(mesg,*) 'Mean melt flux (kg/(m^2 s)), dt = ', mean_melt_flux, CS%time_step
call MOM_mesg(mesg)
call MOM_forcing_chksum("After constant sea level", fluxes, G, CS%US, haloshift=0)
endif
Expand Down Expand Up @@ -1514,7 +1514,7 @@ subroutine initialize_ice_shelf(param_file, ocn_grid, Time, CS, diag, forces, fl
if (G%areaT(i,j) > 0.0) fluxes%frac_shelf_h(i,j) = ISS%area_shelf_h(i,j) / G%areaT(i,j)
enddo ; enddo ; endif

if (CS%DEBUG) then
if (CS%debug) then
call hchksum(fluxes%frac_shelf_h, "IS init: frac_shelf_h", G%HI, haloshift=0)
endif

Expand Down
4 changes: 2 additions & 2 deletions src/ice_shelf/MOM_ice_shelf_dynamics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ subroutine ice_shelf_solve_outer(CS, ISS, G, US, u, v, iters, time)
call ice_shelf_solve_inner(CS, ISS, G, u, v, TAUDX, TAUDY, H_node, float_cond, &
ISS%hmask, conv_flag, iters, time, Phi, Phisub)

if (CS%DEBUG) then
if (CS%debug) then
call qchksum(u, "u shelf", G%HI, haloshift=2)
call qchksum(v, "v shelf", G%HI, haloshift=2)
endif
Expand Down Expand Up @@ -3600,7 +3600,7 @@ subroutine ice_shelf_temp(CS, ISS, G, US, time_step, melt_rate, Time)
call pass_var(CS%t_shelf, G%domain)
call pass_var(CS%tmask, G%domain)

if (CS%DEBUG) then
if (CS%debug) then
call hchksum(CS%t_shelf, "temp after front", G%HI, haloshift=3)
endif

Expand Down
3 changes: 1 addition & 2 deletions src/parameterizations/lateral/MOM_lateral_mixing_coeffs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,7 @@ subroutine VarMix_init(Time, G, GV, US, param_file, diag, CS)
'Depth average square of slope magnitude, S^2, at v-points, as used in Visbeck et al.', 's-2')
endif

oneOrTwo = 1.0
if (CS%Resoln_scaled_Kh .or. CS%Resoln_scaled_KhTh .or. CS%Resoln_scaled_KhTr) then
CS%calculate_Rd_dx = .true.
CS%calculate_res_fns = .true.
Expand Down Expand Up @@ -941,8 +942,6 @@ subroutine VarMix_init(Time, G, GV, US, param_file, diag, CS)
"is the more appropriate definition.\n", default=.false.)
if (Gill_equatorial_Ld) then
oneOrTwo = 2.0
else
oneOrTwo = 1.0
endif

do J=js-1,Jeq ; do I=is-1,Ieq
Expand Down

0 comments on commit 42582a1

Please sign in to comment.