/[MITgcm]/MITgcm/eesupp/src/global_sum.F
ViewVC logotype

Diff of /MITgcm/eesupp/src/global_sum.F

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

revision 1.1 by cnh, Wed Apr 22 19:15:30 1998 UTC revision 1.5 by adcroft, Mon Mar 22 17:37:43 1999 UTC
# Line 1  Line 1 
1  C $Id$  C $Header$
2    
3  C--   File global_sum.F: Routines that perform global sum on an array  C--   File global_sum.F: Routines that perform global sum on an array
4  C                        of thread values.  C                        of thread values.
# Line 50  C     mpiRC  - MPI return code Line 50  C     mpiRC  - MPI return code
50        INTEGER mpiRC        INTEGER mpiRC
51  #endif /* ALLOW_USE_MPI */  #endif /* ALLOW_USE_MPI */
52    
53  C--   Can't start until everyone is ready  C--   Can not start until everyone is ready
54        _BARRIER        _BARRIER
55    
56  C--   Sum within the process first  C--   Sum within the process first
# Line 65  C--   Sum within the process first Line 65  C--   Sum within the process first
65         IF ( usingMPI ) THEN         IF ( usingMPI ) THEN
66  #endif  #endif
67          CALL MPI_Allreduce(tmp,sumPhi,1,MPI_REAL,MPI_SUM,          CALL MPI_Allreduce(tmp,sumPhi,1,MPI_REAL,MPI_SUM,
68       &                   MPI_COMM_WORLD,mpiRC)       &                   MPI_COMM_MODEL,mpiRC)
69  #ifndef ALWAYS_USE_MPI  #ifndef ALWAYS_USE_MPI
70         ENDIF         ENDIF
71  #endif  #endif
# Line 122  C     mpiRC  - MPI return code Line 122  C     mpiRC  - MPI return code
122        INTEGER mpiRC        INTEGER mpiRC
123  #endif   /* ALLOW_USE_MPI */  #endif   /* ALLOW_USE_MPI */
124    
125  C--   Can't start until everyone is ready  C--   Can not start until everyone is ready
126        _BARRIER        _BARRIER
127    
128  C--   Sum within the process first  C--   Sum within the process first
# Line 137  C--   Sum within the process first Line 137  C--   Sum within the process first
137         IF ( usingMPI ) THEN         IF ( usingMPI ) THEN
138  #endif  #endif
139          CALL MPI_Allreduce(tmp,sumPhi,1,MPI_DOUBLE_PRECISION,MPI_SUM,          CALL MPI_Allreduce(tmp,sumPhi,1,MPI_DOUBLE_PRECISION,MPI_SUM,
140       &                   MPI_COMM_WORLD,mpiRC)       &                   MPI_COMM_MODEL,mpiRC)
141  #ifndef ALWAYS_USE_MPI  #ifndef ALWAYS_USE_MPI
142         ENDIF         ENDIF
143  #endif  #endif
# Line 146  C--     Write solution to place where al Line 146  C--     Write solution to place where al
146          phi(1,1) = sumPhi          phi(1,1) = sumPhi
147        _END_MASTER( myThid )        _END_MASTER( myThid )
148    
149  C--   Don't leave until we are sure that the sum is done  C--   Do not leave until we are sure that the sum is done
150        _BARRIER        _BARRIER
151  C  C
152        RETURN        RETURN
153        END        END
   
 C $Id$  

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

  ViewVC Help
Powered by ViewVC 1.1.22