/[MITgcm]/MITgcm_contrib/cg2d_bench/gsum.F
ViewVC logotype

Diff of /MITgcm_contrib/cg2d_bench/gsum.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1 by ce107, Fri May 12 21:58:05 2006 UTC revision 1.2 by ce107, Fri May 12 22:23:10 2006 UTC
# Line 1  Line 1 
1    C       $Id$    
2        SUBROUTINE GSUM_R8( ans, phi )        SUBROUTINE GSUM_R8( ans, phi )
3    
4    #include "EEPARAMS.h"
5  #ifdef ALLOW_MPI  #ifdef ALLOW_MPI
6  #include "mpif.h"  #include "mpif.h"
7    #include "MPI_INFO.h"
8  #endif  #endif
9    
10        Real*8 ans  #ifdef USE_MIXED_PRECISION
11        Real*8 phi        REAL*8 ans
12          REAL*8 phi
13    #else
14          Real ans
15          Real phi
16    #endif
17    
18        INTEGER RC        INTEGER RC
19    
20        ans = phi        ans = phi
21    
22  #ifdef USE_MPI_GSUM  #ifdef USE_MPI_GSUM
23    #ifdef USE_MIXED_PRECISION
24        CALL MPI_Allreduce( phi,        CALL MPI_Allreduce( phi,
25       &                    ans,       &                    ans,
26       &                      1,       &                      1,
27       &                    MPI_REAL8,       &                    MPI_REAL8,
28       &                    MPI_SUM,       &                    MPI_SUM,
29       &                    MPI_COMM_WORLD,       &                    comm_use,
30         &                    rc
31         &                  )
32    #else
33          CALL MPI_Allreduce( phi,
34         &                    ans,
35         &                      1,
36         &                    _MPI_TYPE_REAL,
37         &                    MPI_SUM,
38         &                    comm_use,
39       &                    rc       &                    rc
40       &                  )       &                  )
41  #endif  #endif
42    #endif
43    
44  #ifdef USE_JAM_GSUM  #ifdef USE_JAM_GSUM
45  C     JAM global sum  C     JAM global sum

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.22