Skip to content

Commit

Permalink
Replaced group_pass of h with pass_var of h
Browse files Browse the repository at this point in the history
  Reverted to the simpler pass_var routines for the single 3-d variable h.  This
avoids the issue that triggered the recent pull request #520, and it should have
no performance impacts.  (In fact, by letting each call have its own halo size,
it might lead to performance improvements in subsequent commits.)  All answers
are bitwise identical.
  • Loading branch information
Hallberg-NOAA committed Jun 14, 2017
1 parent 5daf60f commit a8565c7
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,6 @@ module MOM

! These are used for group halo updates.
type(group_pass_type) :: pass_tau_ustar_psurf
type(group_pass_type) :: pass_h
type(group_pass_type) :: pass_ray
type(group_pass_type) :: pass_bbl_thick_kv_bbl
type(group_pass_type) :: pass_T_S_h
Expand Down Expand Up @@ -568,8 +567,6 @@ subroutine step_MOM(fluxes, state, Time_start, time_interval, CS)
call create_group_pass(CS%pass_tau_ustar_psurf, fluxes%ustar(:,:), G%Domain)
if (ASSOCIATED(fluxes%p_surf)) &
call create_group_pass(CS%pass_tau_ustar_psurf, fluxes%p_surf(:,:), G%Domain)
if ((CS%thickness_diffuse .and. (.not.CS%thickness_diffuse_first .or. CS%t_dyn_rel_adv == 0)) .OR. CS%mixedlayer_restrat) &
call create_group_pass(CS%pass_h, h, G%Domain) !###, halo=max(2,cont_stensil))

do_pass_Ray = .FALSE.
if ((.not.G%Domain%symmetric) .and. &
Expand Down Expand Up @@ -758,7 +755,7 @@ subroutine step_MOM(fluxes, state, Time_start, time_interval, CS)
CS%MEKE, CS%VarMix, CS%CDp, CS%thickness_diffuse_CSp)
call cpu_clock_end(id_clock_thick_diff)
call cpu_clock_begin(id_clock_pass)
call do_group_pass(CS%pass_h, G%Domain)
call pass_var(h, G%Domain) !###, halo=max(2,cont_stensil))
call cpu_clock_end(id_clock_pass)
call disable_averaging(CS%diag)
if (showCallTree) call callTree_waypoint("finished thickness_diffuse_first (step_MOM)")
Expand Down Expand Up @@ -898,7 +895,7 @@ subroutine step_MOM(fluxes, state, Time_start, time_interval, CS)
if (CS%debug) call hchksum(h,"Post-thickness_diffuse h", G%HI, haloshift=1, scale=GV%H_to_m)
call cpu_clock_end(id_clock_thick_diff)
call cpu_clock_begin(id_clock_pass)
call do_group_pass(CS%pass_h, G%Domain)
call pass_var(h, G%Domain) !###, halo=max(2,cont_stensil))
call cpu_clock_end(id_clock_pass)
if (showCallTree) call callTree_waypoint("finished thickness_diffuse (step_MOM)")
endif
Expand All @@ -915,7 +912,7 @@ subroutine step_MOM(fluxes, state, Time_start, time_interval, CS)
G, GV, CS%mixedlayer_restrat_CSp)
call cpu_clock_end(id_clock_ml_restrat)
call cpu_clock_begin(id_clock_pass)
call do_group_pass(CS%pass_h, G%Domain)
call pass_var(h, G%Domain) !###, halo=max(2,cont_stensil))
call cpu_clock_end(id_clock_pass)
if (CS%debug) then
call hchksum(h,"Post-mixedlayer_restrat h", G%HI, haloshift=1, scale=GV%H_to_m)
Expand Down Expand Up @@ -1396,7 +1393,7 @@ subroutine step_tracers(fluxes, state, Time_start, time_interval, CS)
fluxes%netMassOut(:,:) = CS%offline_CSp%netMassOut(:,:)
call offline_diabatic_ale(fluxes, Time_start, Time_end, time_interval, CS%offline_CSp, &
CS%h, eatr, ebtr)
call pass_var(CS%h,G%Domain)
call pass_var(CS%h, G%Domain)

! Do the transport, the final ALE remappings, horizontal diffusion if it is
! the last iteration
Expand All @@ -1415,9 +1412,7 @@ subroutine step_tracers(fluxes, state, Time_start, time_interval, CS)
call cpu_clock_begin(id_clock_ALE)
call ALE_offline_tracer_final( G, GV, CS%h, h_end, CS%tracer_Reg, CS%ALE_CSp)
call cpu_clock_end(id_clock_ALE)
call pass_var(CS%h,G%Domain)


call pass_var(CS%h, G%Domain)
endif

else ! NON-ALE MODE...NOT WELL TESTED
Expand Down Expand Up @@ -1445,9 +1440,9 @@ subroutine step_tracers(fluxes, state, Time_start, time_interval, CS)
CS%tv%S = salt_mean
CS%h = h_end

call pass_var(CS%tv%T,G%Domain)
call pass_var(CS%tv%S,G%Domain)
call pass_var(CS%h,G%Domain)
call pass_var(CS%tv%T, G%Domain)
call pass_var(CS%tv%S, G%Domain)
call pass_var(CS%h, G%Domain)

endif

Expand Down

0 comments on commit a8565c7

Please sign in to comment.