File indexing completed on 2022-04-26 05:08:40 UTC
view on githubraw file Latest commit 6b551785 on 2022-04-26 03:50:35 UTC
924557e60a Chri*0001 #include "CPP_EEOPTIONS.h"
0002
4c563c2ee9 Chri*0003
8ad19e1d95 Jean*0004
4c563c2ee9 Chri*0005
0006
6b551785d1 Jean*0007 SUBROUTINE EESET_PARMS( procId, doReport )
924557e60a Chri*0008
4c563c2ee9 Chri*0009
0010
8ad19e1d95 Jean*0011
0012
4c563c2ee9 Chri*0013
8ad19e1d95 Jean*0014
0015
0016
0017
0018
4c563c2ee9 Chri*0019
0020
0021
731627cf5e Jean*0022 IMPLICIT NONE
0023
4c563c2ee9 Chri*0024
924557e60a Chri*0025 #include "SIZE.h"
0026 #include "EEPARAMS.h"
0027 #include "EESUPPORT.h"
c11f817917 Jean*0028 #include "EXCH.h"
5d5e83c00e Jean*0029
0030
3777bbd57d Jean*0031
5d5e83c00e Jean*0032
3777bbd57d Jean*0033 INTEGER procId
5d5e83c00e Jean*0034 LOGICAL doReport
0035
0036
4c563c2ee9 Chri*0037 INTEGER IFNBLNK
0038 EXTERNAL IFNBLNK
0039 INTEGER ILNBLNK
0040 EXTERNAL ILNBLNK
924557e60a Chri*0041
4c563c2ee9 Chri*0042
0043
0044
0045
0046
0047
0048
76c208745c Alis*0049 INTEGER IL
924557e60a Chri*0050 INTEGER errIO
0051 INTEGER iUnit
0052 CHARACTER*(MAX_LEN_MBUF) msgBuf
0053 CHARACTER*(MAX_LEN_PREC) record
133c6caa8d Mart*0054 # if
b5912aa7d7 Jean*0055 CHARACTER*(MAX_LEN_FNAM) scratchFile1
90807ba1b6 Jean*0056 #endif
0057 #ifdef SINGLE_DISK_IO
eb083ce29c Dimi*0058
0059 INTEGER mpiRC
b5912aa7d7 Jean*0060 #endif
c3d0b098ae Lars*0061 #ifdef USE_PDAF
0062 INTEGER mpi_task_id
0063 #endif
b5912aa7d7 Jean*0064
0065
924557e60a Chri*0066 NAMELIST /EEPARMS/
0deb8b4619 Jean*0067 & nTx, nTy, usingMPI,
0068 & useCubedSphereExchange,
6591b3fcc3 Jean*0069 & useCoupler, useNEST_PARENT, useNEST_CHILD,
0070 & useNest2W_parent, useNest2W_child, useOASIS,
8ad19e1d95 Jean*0071 & useSETRLSTK, useSIGREG,
731627cf5e Jean*0072 & debugMode, printMapIncludesZeros, maxLengthPrt1D
924557e60a Chri*0073
c11f817917 Jean*0074
0075
924557e60a Chri*0076 usingSyncMessages = .TRUE.
910f05e765 Chri*0077
c11f817917 Jean*0078
0079
924557e60a Chri*0080
0081
c11f817917 Jean*0082
924557e60a Chri*0083
0084
c11f817917 Jean*0085
0086
0087
0088
924557e60a Chri*0089
c11f817917 Jean*0090
0091
0092
924557e60a Chri*0093
c11f817917 Jean*0094
0095
0096
924557e60a Chri*0097
ed584e7d0c Jean*0098
0099
0100
8ad19e1d95 Jean*0101
df91541502 Ed H*0102
ab504a3a96 Ed H*0103
924557e60a Chri*0104 notUsingXPeriodicity = .FALSE.
0105 notUsingYPeriodicity = .FALSE.
aea29c8517 Alis*0106 useCubedSphereExchange = .FALSE.
5d5e83c00e Jean*0107 #ifdef ALLOW_USE_MPI
0108 usingMPI = .TRUE.
0109 #else
924557e60a Chri*0110 usingMPI = .FALSE.
5d5e83c00e Jean*0111 #endif
ed584e7d0c Jean*0112 useCoupler = .FALSE.
0deb8b4619 Jean*0113 useNEST_PARENT = .FALSE.
0114 useNEST_CHILD = .FALSE.
6591b3fcc3 Jean*0115 useNest2W_parent = .FALSE.
0116 useNest2W_child = .FALSE.
9aa451bbe6 Mart*0117 useOASIS = .FALSE.
65d079bafa Alis*0118 nTx = 1
0119 nTy = 1
df91541502 Ed H*0120 useSETRLSTK = .FALSE.
b81731e160 Ed H*0121 useSIGREG = .FALSE.
924557e60a Chri*0122
8ad19e1d95 Jean*0123
731627cf5e Jean*0124
0125 debugMode = .FALSE.
8ad19e1d95 Jean*0126
0127 printMapIncludesZeros = .FALSE.
0128
0129 maxLengthPrt1D = 65
0130
3ee5154f7c Jean*0131
0132
0133 useSingleCpuIO = .FALSE.
0134
924557e60a Chri*0135
0136
6b551785d1 Jean*0137
eb083ce29c Dimi*0138 #ifdef SINGLE_DISK_IO
e018783d3d Jean*0139
06c7c05b27 Dimi*0140 IF ( .NOT.doReport )
e018783d3d Jean*0141 & STOP 'ABNORMAL END: S/R EESET_PARMS: myProcId unset'
8336c6aa6d Dimi*0142 WRITE(scratchFile1,'(A)') 'scratch1'
e018783d3d Jean*0143 IF( myProcId .EQ. 0 ) THEN
6b551785d1 Jean*0144 OPEN( UNIT=scrUnit1, FILE=scratchFile1, STATUS='UNKNOWN' )
eb083ce29c Dimi*0145 ENDIF
0146 #else /* ifndef SINGLE_DISK_IO */
d459aedd7a Mart*0147 # ifdef USE_FORTRAN_SCRATCH_FILES
0148
0149
6b551785d1 Jean*0150 OPEN( UNIT=scrUnit1, STATUS='SCRATCH' )
d459aedd7a Mart*0151 # else
0152
0153
0154
c3d0b098ae Lars*0155 #ifdef USE_PDAF
0156 CALL GET_TASKID_PDAF(mpi_task_id)
0157 WRITE(scratchFile1,'(A,'//FMT_PROC_ID//',A,'//FMT_TSK_ID//')')
0158 & 'scratch1.', procId, '.', mpi_task_id
0159 #else
133c6caa8d Mart*0160 WRITE(scratchFile1,'(A,'//FMT_PROC_ID//')') 'scratch1.', procId
c3d0b098ae Lars*0161 #endif
6b551785d1 Jean*0162 OPEN( UNIT=scrUnit1, FILE=scratchFile1, STATUS='UNKNOWN' )
eb083ce29c Dimi*0163 # endif
0164 #endif /* SINGLE_DISK_IO */
0165
0166 #ifdef SINGLE_DISK_IO
e018783d3d Jean*0167 IF( myProcId .EQ. 0 ) THEN
1dfb26592e Cons*0168 #endif
eb083ce29c Dimi*0169
6b551785d1 Jean*0170
0171 OPEN( UNIT=eeDataUnit, FILE='eedata', STATUS='OLD',
0172 & err=1, IOSTAT=errIO )
924557e60a Chri*0173 IF ( errIO .GE. 0 ) GOTO 2
0174 1 CONTINUE
5d5e83c00e Jean*0175 IF ( doReport ) THEN
0176 WRITE(msgBuf,'(2A)') 'EESET_PARMS: ',
0177 & 'Unable to open parameter file "eedata"'
0178 CALL PRINT_ERROR( msgBuf, 1 )
0179 CALL EEDATA_EXAMPLE
86e28207df Jean*0180
0181
0182
0183 eeBootError = .TRUE.
5d5e83c00e Jean*0184 ELSE
0185 RETURN
0186 ENDIF
924557e60a Chri*0187 2 CONTINUE
5d5e83c00e Jean*0188
6b551785d1 Jean*0189
0190
5d5e83c00e Jean*0191 IF ( doReport ) THEN
0192 WRITE(msgBuf,'(A)')
46dc4f419b Chri*0193 & '// ======================================================='
5d5e83c00e Jean*0194 CALL PRINT_MESSAGE(msgBuf, standardMessageUnit, SQUEEZE_RIGHT, 1)
0195 WRITE(msgBuf,'(A)')
46dc4f419b Chri*0196 & '// Execution Environment parameter file "eedata"'
5d5e83c00e Jean*0197 CALL PRINT_MESSAGE(msgBuf, standardMessageUnit, SQUEEZE_RIGHT, 1)
0198 WRITE(msgBuf,'(A)')
46dc4f419b Chri*0199 & '// ======================================================='
5d5e83c00e Jean*0200 CALL PRINT_MESSAGE(msgBuf, standardMessageUnit, SQUEEZE_RIGHT, 1)
6b551785d1 Jean*0201 ENDIF
924557e60a Chri*0202
6b551785d1 Jean*0203
0204 1000 CONTINUE
0205 READ(eeDataUnit,FMT='(A)',END=1001) RECORD
0206 IL = MAX(ILNBLNK(RECORD),1)
0207 IF ( RECORD(1:1) .NE. commentCharacter ) THEN
0208 CALL NML_SET_TERMINATOR( RECORD )
0209 WRITE(UNIT=scrUnit1,FMT='(A)') RECORD(:IL)
0210 ENDIF
0211 IF ( doReport ) THEN
5d5e83c00e Jean*0212 WRITE(msgBuf,'(A,A)') '>',RECORD(:IL)
6b551785d1 Jean*0213 CALL PRINT_MESSAGE( msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1 )
0214 ENDIF
0215 GOTO 1000
0216 1001 CONTINUE
0217 CLOSE(eeDataUnit)
0218 IF ( doReport ) THEN
5d5e83c00e Jean*0219 WRITE(msgBuf,'(A)') ' '
0220 CALL PRINT_MESSAGE(msgBuf,standardMessageUnit, SQUEEZE_RIGHT, 1)
0221 ENDIF
924557e60a Chri*0222
eb083ce29c Dimi*0223 #ifdef SINGLE_DISK_IO
06c7c05b27 Dimi*0224 CALL FLUSH(scrUnit1)
8336c6aa6d Dimi*0225 CLOSE(scrUnit1)
eb083ce29c Dimi*0226 ENDIF
0227 # ifdef ALLOW_USE_MPI
8336c6aa6d Dimi*0228
0229
90807ba1b6 Jean*0230 IF ( usingMPI ) THEN
0231 CALL MPI_BARRIER( MPI_COMM_MODEL, mpiRC )
0232 ENDIF
eb083ce29c Dimi*0233 # endif
daa19abb49 Jean*0234 #ifdef HAVE_SYSTEM
06c7c05b27 Dimi*0235 CALL SYSTEM('sleep 1')
daa19abb49 Jean*0236 #endif
6b551785d1 Jean*0237 OPEN( UNIT=scrUnit1, FILE=scratchFile1, STATUS='OLD' )
eb083ce29c Dimi*0238 #endif /* SINGLE_DISK_IO */
0239
8336c6aa6d Dimi*0240
0241 iUnit = scrUnit1
0242 REWIND(iUnit)
924557e60a Chri*0243 READ(UNIT=iUnit,NML=EEPARMS,IOSTAT=errIO,err=3)
0244 IF ( errIO .GE. 0 ) GOTO 4
0245 3 CONTINUE
2c24d43b0c Dani*0246 #ifndef TARGET_PWR3
5d5e83c00e Jean*0247 IF ( doReport ) THEN
0248 WRITE(msgBuf,'(2A)') 'EESET_PARMS: ',
0249 & 'Error reading parameter file "eedata"'
0250 CALL PRINT_ERROR( msgBuf, 1 )
924557e60a Chri*0251 CALL EEDATA_EXAMPLE
86e28207df Jean*0252 eeBootError = .TRUE.
5d5e83c00e Jean*0253 ENDIF
2c24d43b0c Dani*0254 #endif
924557e60a Chri*0255 4 CONTINUE
0256
b51e35105b Chri*0257
54c2b49af5 Mart*0258 #ifdef SINGLE_DISK_IO
89bcd05385 Mart*0259 CLOSE(iUnit)
54c2b49af5 Mart*0260 #else
0628219f77 Mart*0261 CLOSE(iUnit,STATUS='DELETE')
54c2b49af5 Mart*0262 #endif /* SINGLE_DISK_IO */
b51e35105b Chri*0263
5d5e83c00e Jean*0264 #ifdef ALLOW_USE_MPI
0265 #ifdef ALWAYS_USE_MPI
0266 IF ( doReport .AND. .NOT.usingMPI ) THEN
0267 WRITE(msgBuf,'(2A)') 'EESET_PARMS: ',
0268 & 'in eedata: usingMPI=F conflicts'
0269 CALL PRINT_ERROR( msgBuf, 1 )
0270 WRITE(msgBuf,'(A)') 'EESET_PARMS: with #define ALWAYS_USE_MPI'
0271 CALL PRINT_ERROR( msgBuf, 1 )
86e28207df Jean*0272 eeBootError = .TRUE.
5d5e83c00e Jean*0273 ENDIF
0274 usingMPI = .TRUE.
0275 #endif
02efaefb87 Jean*0276 #else /* ALLOW_USE_MPI */
0277 IF ( doReport .AND. usingMPI ) THEN
0278 WRITE(msgBuf,'(2A)') 'EESET_PARMS: ',
0279 & 'in eedata: usingMPI=T conflicts'
0280 CALL PRINT_ERROR( msgBuf, 1 )
0281 WRITE(msgBuf,'(A)') 'EESET_PARMS: with #undef ALLOW_USE_MPI'
0282 CALL PRINT_ERROR( msgBuf, 1 )
86e28207df Jean*0283 eeBootError = .TRUE.
02efaefb87 Jean*0284 ENDIF
0285 usingMPI = .FALSE.
0286 #endif /* ALLOW_USE_MPI */
5d5e83c00e Jean*0287
924557e60a Chri*0288
0289
0290
0291
0292
0293
8ad19e1d95 Jean*0294
924557e60a Chri*0295
0296
0297
0298
0299
0300
8ad19e1d95 Jean*0301
924557e60a Chri*0302
8ad19e1d95 Jean*0303
924557e60a Chri*0304
0305
0306
0307
0308
0309
8ad19e1d95 Jean*0310
924557e60a Chri*0311
0312
0313
0314
0315
5d5e83c00e Jean*0316
c11f817917 Jean*0317 IF ( doReport ) THEN
0318
0319
0320
0321 exchCollectStatistics = .TRUE.
0322
0323 exchNeedsMemsync = .TRUE.
0324 exchUsesBarrier = .TRUE.
0325 IF ( usingMPI ) THEN
0326
0327 exchNeedsMemsync = .FALSE.
0328 exchUsesBarrier = .FALSE.
0329 ENDIF
0330
0331
0332 ENDIF
0333
924557e60a Chri*0334 RETURN
0335 END