Skip to content

Commit

Permalink
*Reproducing sums for SST_global and SSS_global
Browse files Browse the repository at this point in the history
- Uses reproducing_sum() subroutine
- timestats.intel did not change for MOM6z_SIS_025 config
  • Loading branch information
jkrasting committed Apr 4, 2014
1 parent e85c125 commit debafa1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ module MOM
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
use MOM_cpu_clock, only : CLOCK_COMPONENT, CLOCK_SUBCOMPONENT
use MOM_cpu_clock, only : CLOCK_MODULE_DRIVER, CLOCK_MODULE, CLOCK_ROUTINE
use MOM_coms, only : reproducing_sum
use MOM_diag_mediator, only : diag_mediator_init, enable_averaging
use MOM_diag_mediator, only : disable_averaging, post_data, safe_alloc_ptr
use MOM_diag_mediator, only : register_diag_field, register_static_field
Expand Down Expand Up @@ -646,6 +647,7 @@ subroutine step_MOM(fluxes, state, Time_start, time_interval, CS)
h ! h : Layer thickness, in m.
real, dimension(SZI_(CS%G),SZJ_(CS%G),SZK_(CS%G)+1) :: eta_predia
real :: tot_wt_ssh, Itot_wt_ssh, I_time_int
real, dimension(SZI_(CS%G),SZJ_(CS%G)) :: tmpForSumming
real :: SST_global, SSS_global
type(time_type) :: Time_local
integer :: pid_tau, pid_ustar, pid_psurf, pid_u, pid_h
Expand Down Expand Up @@ -1318,22 +1320,20 @@ subroutine step_MOM(fluxes, state, Time_start, time_interval, CS)
endif

if (CS%id_sst_global > 0) then
SST_global = 0.0
tmpForSumming(:,:) = 0.
do j=js,je ; do i=is, ie
SST_global = SST_global + ( state%SST(i,j) * G%areaT(i,j) * G%mask2dT(i,j) )
tmpForSumming(i,j) = ( state%SST(i,j) * G%areaT(i,j) * G%mask2dT(i,j) )
enddo ; enddo
call sum_across_PEs( SST_global )
SST_global = SST_global * G%IareaT_global
SST_global = reproducing_sum( tmpForSumming ) * G%IareaT_global
call post_data(CS%id_sst_global, SST_global, CS%diag)
endif

if (CS%id_sss_global > 0) then
SSS_global = 0.0
tmpForSumming(:,:) = 0.
do j=js,je ; do i=is, ie
SSS_global = SSS_global + ( state%SSS(i,j) * G%areaT(i,j) * G%mask2dT(i,j) )
tmpForSumming(i,j) = ( state%SSS(i,j) * G%areaT(i,j) * G%mask2dT(i,j) )
enddo ; enddo
call sum_across_PEs( SSS_global )
SSS_global = SSS_global * G%IareaT_global
SSS_global = reproducing_sum( tmpForSumming ) * G%IareaT_global
call post_data(CS%id_sss_global, SSS_global, CS%diag)
endif

Expand Down

0 comments on commit debafa1

Please sign in to comment.