File: C:\NOAA\NEMS_11731\src\chem\gocart\src\GMAO_Shared\MAPL_Base\allreducesum.H

1     ! $Id: allreducesum.H,v 1.1 2009/02/23 20:01:21 trayanov Exp $
2     
3     #ifdef NAME_
4     #undef NAME_
5     #endif
6     
7     #define NAME_ MAPL_CommsAllReduceSum_
8     
9     #include "overload.macro"
10     
11       subroutine SUB_ (vm, sendbuf, recvbuf, cnt, RC)
12       type(ESMF_VM),        intent(in   )            :: vm
13         TYPE_(kind=EKIND_), intent(IN   )            :: sendbuf DIMENSIONS_
14         TYPE_(kind=EKIND_), intent(INOUT)            :: recvbuf DIMENSIONS_
15         integer,            intent(IN   )            :: cnt
16         integer,            intent(  OUT),  optional :: RC
17     
18         character(len=ESMF_MAXSTR), parameter :: IAM='MAPL_CommsAllReduceSum'
19         integer                               :: status
20         integer                               :: comm
21     
22         call ESMF_VMGet(vm, mpiCommunicator=COMM, rc=status)
23         VERIFY_(STATUS)
24     
25         call mpi_allreduce ( sendbuf, recvbuf, cnt, MPITYPE_, &
26                              MPI_SUM, comm, status )
27         VERIFY_(STATUS)
28     
29     
30         RETURN_(ESMF_SUCCESS)
31       END SUBROUTINE SUB_
32     
33     #undef NAME_
34     
35     #undef DIMENSIONS_
36     #undef RANK_
37     #undef VARTYPE_
38     
39