1 subroutine da_proc_sum_real (value)
3 !---------------------------------------------------------------------------
4 ! Purpose: Do MPI reduction operation across processors to sum a real
6 ! On return, each of the N components of the vector "value" represents
7 ! the sum of parts from each processor. The result is stored only on
8 ! the root processor, i.e., processor 0. (In this way, we do not have
9 ! to do all-to-all communication, unlike wrf_dm_sum_real, which does)
11 ! The routine generates a MPI barrier
12 !---------------------------------------------------------------------------
16 real, intent(inout) :: value(:) ! Array to be summed componentwise.
19 real :: apsum(size(value)) ! Sum across processors.
21 ! Don't trace, as called within trace routines
22 !if (trace_use_frequent) call da_trace_entry("da_proc_sum_real")
25 call mpi_reduce(value, apsum, SIZE(value), true_mpi_real, mpi_sum, root, &
28 if (rootproc) value = apsum
30 !if (trace_use_frequent) call da_trace_exit("da_proc_sum_real")
33 end subroutine da_proc_sum_real