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