/[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.9 by adcroft, Tue May 29 14:01:36 2001 UTC revision 1.10 by cnh, Fri Sep 21 03:54:35 2001 UTC
# Line 8  C      o global_sum_r4 Line 8  C      o global_sum_r4
8  C      o global_sum_r8  C      o global_sum_r8
9  #include "CPP_EEOPTIONS.h"  #include "CPP_EEOPTIONS.h"
10    
11  CStartOfInterface  CBOP
12    C     !ROUTINE: GLOBAL_SUM_R4
13    
14    C     !INTERFACE:
15        SUBROUTINE GLOBAL_SUM_R4(        SUBROUTINE GLOBAL_SUM_R4(
16       U                       sumPhi,       U                       sumPhi,
17       I                       myThid )       I                       myThid )
 C     /==========================================================\  
 C     | SUBROUTINE GLOBAL_SUM_R4                                 |  
 C     | o Handle sum for real*4 data.                            |  
 C     |==========================================================|  
 C     | Perform sum an array of one value per thread and then    |  
 C     | sum result of all the processes.                         |  
 C     | Notes                                                    |  
 C     | =====                                                    |  
 C     | Within a process only one thread does the sum, each      |  
 C     | thread is assumed to have already summed its local data. |  
 C     | The same thread also does the inter-process sum for      |  
 C     | example with MPI and then writes the result into a shared|  
 C     | location. All threads wait until the sum is avaiailable. |  
 C     \==========================================================/  
18        IMPLICIT NONE        IMPLICIT NONE
19    C     !DESCRIPTION:
20    C     *==========================================================*
21    C     | SUBROUTINE GLOBAL_SUM_R4                                  
22    C     | o Handle sum for real*4 data.                            
23    C     *==========================================================*
24    C     | Perform sum an array of one value per thread and then    
25    C     | sum result of all the processes.                          
26    C     | Notes                                                    
27    C     | =====                                                    
28    C     | Within a process only one thread does the sum, each      
29    C     | thread is assumed to have already summed its local data.  
30    C     | The same thread also does the inter-process sum for      
31    C     | example with MPI and then writes the result into a shared
32    C     | location. All threads wait until the sum is avaiailable.  
33    C     *==========================================================*
34    
35    C     !USES:
36  C     == Global data ==  C     == Global data ==
37  #include "SIZE.h"  #include "SIZE.h"
38  #include "EEPARAMS.h"  #include "EEPARAMS.h"
39  #include "EESUPPORT.h"  #include "EESUPPORT.h"
40  #include "GLOBAL_SUM.h"  #include "GLOBAL_SUM.h"
41    
42    C     !INPUT/OUTPUT PARAMETERS:
43  C     == Routine arguments ==  C     == Routine arguments ==
44  C     sumPhi - Result of sum.  C     sumPhi - Result of sum.
45  C     myThid - My thread id.  C     myThid - My thread id.
46        Real*4 sumPhi        Real*4 sumPhi
47        INTEGER myThid        INTEGER myThid
 CEndOfInterface  
48    
49    C     !LOCAL VARIABLES:
50  C     == Local variables ==  C     == Local variables ==
51  C     I      - Loop counters  C     I      - Loop counters
52  C     mpiRC  - MPI return code  C     mpiRC  - MPI return code
# Line 49  C     mpiRC  - MPI return code Line 55  C     mpiRC  - MPI return code
55  #ifdef   ALLOW_USE_MPI  #ifdef   ALLOW_USE_MPI
56        INTEGER mpiRC        INTEGER mpiRC
57  #endif /* ALLOW_USE_MPI */  #endif /* ALLOW_USE_MPI */
58    CEOP
59    
60  C--   write local sum into array  C--   write local sum into array
61        CALL BAR2( myThid )        CALL BAR2( myThid )
# Line 89  C--   set result for every process Line 96  C--   set result for every process
96        END        END
97                
98    
99  CStartOfInterface  CBOP
100    C     !ROUTINE: GLOBAL_SUM_R8
101    
102    C     !INTERFACE:
103        SUBROUTINE GLOBAL_SUM_R8(        SUBROUTINE GLOBAL_SUM_R8(
104       U                       sumPhi,       U                       sumPhi,
105       I                       myThid )       I                       myThid )
106  C     /==========================================================\        IMPLICIT NONE
107  C     | SUBROUTINE GLOBAL_SUM_R8                                 |  C     !DESCRIPTION:
108  C     | o Handle sum for real*8 data.                            |  C     *==========================================================*
109  C     |==========================================================|  C     | SUBROUTINE GLOBAL_SUM_R8                                  
110  C     | Perform sum an array of one value per thread and then    |  C     | o Handle sum for real*8 data.                            
111  C     | sum result of all the processes.                         |  C     *==========================================================*
112  C     | Notes                                                    |  C     | Perform sum an array of one value per thread and then    
113  C     | =====                                                    |  C     | sum result of all the processes.                          
114  C     | Within a process only one thread does the sum, each      |  C     | Notes                                                    
115  C     | thread is assumed to have already summed its local data. |  C     | =====                                                    
116  C     | The same thread also does the inter-process sum for      |  C     | Within a process only one thread does the sum, each      
117  C     | example with MPI and then writes the result into a shared|  C     | thread is assumed to have already summed its local data.  
118  C     | location. All threads wait until the sum is avaiailable. |  C     | The same thread also does the inter-process sum for      
119  C     \==========================================================/  C     | example with MPI and then writes the result into a shared
120        IMPLICIT NONE  C     | location. All threads wait until the sum is avaiailable.  
121    C     *==========================================================*
122    
123    C     !USES:
124  C     === Global data ===  C     === Global data ===
125  #include "SIZE.h"  #include "SIZE.h"
126  #include "EEPARAMS.h"  #include "EEPARAMS.h"
127  #include "EESUPPORT.h"  #include "EESUPPORT.h"
128  #include "GLOBAL_SUM.h"  #include "GLOBAL_SUM.h"
129    
130    C     !INPUT/OUTPUT PARAMETERS:
131  C     === Routine arguments ===  C     === Routine arguments ===
132  C     sumPhi - Result of sum.  C     sumPhi - Result of sum.
133  C     myThid - My thread id.  C     myThid - My thread id.
134        Real*8 sumPhi        Real*8 sumPhi
135        INTEGER myThid        INTEGER myThid
 CEndOfInterface  
136    
137    C     !LOCAL VARIABLES:
138  C     === Local variables ===  C     === Local variables ===
139  C     I      - Loop counters  C     I      - Loop counters
140  C     mpiRC  - MPI return code  C     mpiRC  - MPI return code
# Line 130  C     mpiRC  - MPI return code Line 143  C     mpiRC  - MPI return code
143  #ifdef   ALLOW_USE_MPI  #ifdef   ALLOW_USE_MPI
144        INTEGER mpiRC        INTEGER mpiRC
145  #endif   /* ALLOW_USE_MPI */  #endif   /* ALLOW_USE_MPI */
146    CEOP
147    
148        CALL BAR2( myThid )        CALL BAR2( myThid )
149  C--   write local sum into array  C--   write local sum into array
# Line 178  C--   set result for every process Line 192  C--   set result for every process
192    
193        RETURN        RETURN
194        END        END
195  CStartOfInterface  
196    CBOP
197    C     !ROUTINE: GLOBAL_SUM_INT
198    C     !INTERFACE:
199        SUBROUTINE GLOBAL_SUM_INT(        SUBROUTINE GLOBAL_SUM_INT(
200       U                       sumPhi,       U                       sumPhi,
201       I                       myThid )       I                       myThid )
 C     /==========================================================\  
 C     | SUBROUTINE GLOBAL_SUM_INT                                |  
 C     | o Handle sum for integer data.                           |  
 C     |==========================================================|  
 C     | Perform sum an array of one value per thread and then    |  
 C     | sum result of all the processes.                         |  
 C     | Notes                                                    |  
 C     | =====                                                    |  
 C     | Within a process only one thread does the sum, each      |  
 C     | thread is assumed to have already summed its local data. |  
 C     | The same thread also does the inter-process sum for      |  
 C     | example with MPI and then writes the result into a shared|  
 C     | location. All threads wait until the sum is avaiailable. |  
 C     \==========================================================/  
202        IMPLICIT NONE        IMPLICIT NONE
203    C     !DESCRIPTION:
204    C     *==========================================================*
205    C     | SUBROUTINE GLOBAL_SUM_INT                                
206    C     | o Handle sum for integer data.                            
207    C     *==========================================================*
208    C     | Perform sum an array of one value per thread and then    
209    C     | sum result of all the processes.                          
210    C     | Notes                                                    
211    C     | =====                                                    
212    C     | Within a process only one thread does the sum, each      
213    C     | thread is assumed to have already summed its local data.  
214    C     | The same thread also does the inter-process sum for      
215    C     | example with MPI and then writes the result into a shared
216    C     | location. All threads wait until the sum is avaiailable.  
217    C     *==========================================================*
218    
219    C     !USES:
220  C     === Global data ===  C     === Global data ===
221  #include "SIZE.h"  #include "SIZE.h"
222  #include "EEPARAMS.h"  #include "EEPARAMS.h"
223  #include "EESUPPORT.h"  #include "EESUPPORT.h"
224  #include "GLOBAL_SUM.h"  #include "GLOBAL_SUM.h"
225    
226    C     !INPUT/OUTPUT PARAMETERS:
227  C     === Routine arguments ===  C     === Routine arguments ===
228  C     sumPhi - Result of sum.  C     sumPhi - Result of sum.
229  C     myThid - My thread id.  C     myThid - My thread id.
230        INTEGER sumPhi        INTEGER sumPhi
231        INTEGER myThid        INTEGER myThid
 CEndOfInterface  
232    
233    C     !LOCAL VARIABLES:
234  C     === Local variables ===  C     === Local variables ===
235  C     I      - Loop counters  C     I      - Loop counters
236  C     mpiRC  - MPI return code  C     mpiRC  - MPI return code
# Line 219  C     mpiRC  - MPI return code Line 239  C     mpiRC  - MPI return code
239  #ifdef   ALLOW_USE_MPI  #ifdef   ALLOW_USE_MPI
240        INTEGER mpiRC        INTEGER mpiRC
241  #endif   /* ALLOW_USE_MPI */  #endif   /* ALLOW_USE_MPI */
242    CEOP
243    
244        _BARRIER        _BARRIER
245  C--   write local sum into array  C--   write local sum into array

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.22