File indexing completed on 2018-03-02 18:36:09 UTC
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
b043311a0b Jean*0001 #include "CPP_EEOPTIONS.h"
0002
924557e60a Chri*0003
0004
0005
b043311a0b Jean*0006
0007
924557e60a Chri*0008
b043311a0b Jean*0009
4c563c2ee9 Chri*0010
0011
0012
0013
b043311a0b Jean*0014 SUBROUTINE GLOBAL_MAX_R4(
78c96bee2f Alis*0015 U maxPhi,
924557e60a Chri*0016 I myThid )
b043311a0b Jean*0017
4c563c2ee9 Chri*0018
0019
b043311a0b Jean*0020
0021
4c563c2ee9 Chri*0022
b043311a0b Jean*0023
0024
0025
0026
0027
0028
0029
0030
0031
4c563c2ee9 Chri*0032
0033
0034
b043311a0b Jean*0035 IMPLICIT NONE
0036
924557e60a Chri*0037
0038 #include "SIZE.h"
0039 #include "EEPARAMS.h"
0040 #include "EESUPPORT.h"
aea29c8517 Alis*0041 #include "GLOBAL_MAX.h"
924557e60a Chri*0042
4c563c2ee9 Chri*0043
924557e60a Chri*0044
4c563c2ee9 Chri*0045
0046
924557e60a Chri*0047 Real*4 maxPhi
0048 INTEGER myThid
0049
4c563c2ee9 Chri*0050
924557e60a Chri*0051
4c563c2ee9 Chri*0052
0053
924557e60a Chri*0054 INTEGER I
0055 Real*4 tmp
ca1d7a672f Jean*0056 #ifdef ALLOW_USE_MPI
924557e60a Chri*0057 INTEGER mpiRC
0058 #endif /* ALLOW_USE_MPI */
4c563c2ee9 Chri*0059
924557e60a Chri*0060
78c96bee2f Alis*0061
b043311a0b Jean*0062 phiGMR4(1,myThid) = maxPhi
78c96bee2f Alis*0063
46dc4f419b Chri*0064
aea29c8517 Alis*0065 CALL BAR2( myThid )
924557e60a Chri*0066
0067
0068 _BEGIN_MASTER( myThid )
b043311a0b Jean*0069 tmp = phiGMR4(1,1)
924557e60a Chri*0070 DO I=2,nThreads
b043311a0b Jean*0071 tmp = MAX(tmp,phiGMR4(1,I))
924557e60a Chri*0072 ENDDO
0073 maxPhi = tmp
ca1d7a672f Jean*0074 #ifdef ALLOW_USE_MPI
924557e60a Chri*0075 IF ( usingMPI ) THEN
0076 CALL MPI_Allreduce(tmp,maxPhi,1,MPI_REAL,MPI_MAX,
ed584e7d0c Jean*0077 & MPI_COMM_MODEL,mpiRC)
924557e60a Chri*0078 ENDIF
ca1d7a672f Jean*0079 #endif /* ALLOW_USE_MPI */
b043311a0b Jean*0080 phiGMR4(1,0) = maxPhi
924557e60a Chri*0081 _END_MASTER( myThid )
ca1d7a672f Jean*0082
0083
aea29c8517 Alis*0084 CALL BAR2( myThid )
78c96bee2f Alis*0085
0086
b043311a0b Jean*0087 maxPhi = phiGMR4(1,0)
78c96bee2f Alis*0088
924557e60a Chri*0089 RETURN
0090 END
0091
b043311a0b Jean*0092
0093
4c563c2ee9 Chri*0094
0095
0096
b043311a0b Jean*0097 SUBROUTINE GLOBAL_MAX_R8(
924557e60a Chri*0098 O maxPhi,
0099 I myThid )
b043311a0b Jean*0100
4c563c2ee9 Chri*0101
0102
b043311a0b Jean*0103
0104
4c563c2ee9 Chri*0105
b043311a0b Jean*0106
0107
0108
0109
0110
0111
0112
0113
0114
4c563c2ee9 Chri*0115
0116
0117
b043311a0b Jean*0118 IMPLICIT NONE
0119
924557e60a Chri*0120
0121 #include "SIZE.h"
0122 #include "EEPARAMS.h"
0123 #include "EESUPPORT.h"
aea29c8517 Alis*0124 #include "GLOBAL_MAX.h"
924557e60a Chri*0125
4c563c2ee9 Chri*0126
924557e60a Chri*0127
4c563c2ee9 Chri*0128
0129
924557e60a Chri*0130 Real*8 maxPhi
0131 INTEGER myThid
0132
4c563c2ee9 Chri*0133
924557e60a Chri*0134
4c563c2ee9 Chri*0135
0136
924557e60a Chri*0137 INTEGER I
0138 Real*8 tmp
ca1d7a672f Jean*0139 #ifdef ALLOW_USE_MPI
924557e60a Chri*0140 INTEGER mpiRC
0141 #endif /* ALLOW_USE_MPI */
4c563c2ee9 Chri*0142
924557e60a Chri*0143
78c96bee2f Alis*0144
b043311a0b Jean*0145 phiGMR8(1,myThid) = maxPhi
78c96bee2f Alis*0146
46dc4f419b Chri*0147
aea29c8517 Alis*0148 CALL BAR2( myThid )
924557e60a Chri*0149
0150
0151 _BEGIN_MASTER( myThid )
b043311a0b Jean*0152 tmp = phiGMR8(1,1)
924557e60a Chri*0153 DO I=2,nThreads
b043311a0b Jean*0154 tmp = MAX(tmp,phiGMR8(1,I))
924557e60a Chri*0155 ENDDO
0156 maxPhi = tmp
ca1d7a672f Jean*0157 #ifdef ALLOW_USE_MPI
924557e60a Chri*0158 IF ( usingMPI ) THEN
0159 CALL MPI_Allreduce(tmp,maxPhi,1,MPI_DOUBLE_PRECISION,MPI_MAX,
ed584e7d0c Jean*0160 & MPI_COMM_MODEL,mpiRC)
924557e60a Chri*0161 ENDIF
ca1d7a672f Jean*0162 #endif /* ALLOW_USE_MPI */
924557e60a Chri*0163
b043311a0b Jean*0164 phiGMR8(1,0) = maxPhi
924557e60a Chri*0165 _END_MASTER( myThid )
0166
46dc4f419b Chri*0167
aea29c8517 Alis*0168 CALL BAR2( myThid )
78c96bee2f Alis*0169
0170
b043311a0b Jean*0171 maxPhi = phiGMR8(1,0)
78c96bee2f Alis*0172
924557e60a Chri*0173 RETURN
0174 END