File indexing completed on 2018-03-02 18:42:47 UTC
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
31ebb84b18 Jean*0001 #include "OCN_CPL_OPTIONS.h"
69e21e3ef0 Jean*0002
0003
0004
0005
0006 SUBROUTINE CPL_READPARMS( myThid )
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
42a361c5e5 Jean*0017
69e21e3ef0 Jean*0018
0019 IMPLICIT NONE
0020
0021
0022 #include "SIZE.h"
0023 #include "EEPARAMS.h"
0024 #include "PARAMS.h"
f5803a5d6d Jean*0025 #include "CPL_PARAMS.h"
6c5a9380b0 Ed H*0026 #ifdef ALLOW_MNC
0027 #include "MNC_PARAMS.h"
0028 #endif
69e21e3ef0 Jean*0029
0030
8504a02c3f Jean*0031
49715ba709 Jean*0032
69e21e3ef0 Jean*0033 INTEGER myThid
0034
0035
0036 #ifdef COMPONENT_MODULE
0037
49715ba709 Jean*0038
0039
69e21e3ef0 Jean*0040
49715ba709 Jean*0041
8504a02c3f Jean*0042
49715ba709 Jean*0043
69e21e3ef0 Jean*0044
0045
0046
44ff40f0ae Jean*0047
0048
69e21e3ef0 Jean*0049 CHARACTER*(MAX_LEN_MBUF) msgBuf
49715ba709 Jean*0050 INTEGER iUnit
0051
44ff40f0ae Jean*0052 LOGICAL cpl_earlyExpImpCall
69e21e3ef0 Jean*0053
0054
0055
8504a02c3f Jean*0056
69e21e3ef0 Jean*0057
0058
0059
e596558d31 Jean*0060
d06ba90ed2 Jean*0061
0062
0063
0064
0065
0066
0067
69e21e3ef0 Jean*0068
0069 NAMELIST /CPL_OCN_PARAM/
e596558d31 Jean*0070 & cpl_earlyExpImpCall,
d4b28e407b Jean*0071 & useImportHFlx, useImportFW, useImportTau,
d06ba90ed2 Jean*0072 & useImportSLP, useImportRunOff,
0073 & useImportSIce, useImportThSIce, useImportSltPlm,
0074 & useImportFice, useImportCO2, useImportWSpd,
6c5a9380b0 Ed H*0075 & cpl_taveFreq, cpl_snapshot_mnc, cpl_timeave_mnc
69e21e3ef0 Jean*0076
0077
0078
49715ba709 Jean*0079 _BEGIN_MASTER(myThid)
0080
0081
0082 WRITE(msgBuf,'(A)') ' CPL_READPARMS: opening data.cpl'
31ebb84b18 Jean*0083 CALL PRINT_MESSAGE( msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1 )
49715ba709 Jean*0084
0085 CALL OPEN_COPY_DATA_FILE( 'data.cpl', 'CPL_READPARMS',
0086 O iUnit, myThid )
0087
69e21e3ef0 Jean*0088
42a361c5e5 Jean*0089 cpl_earlyExpImpCall = .TRUE.
d06ba90ed2 Jean*0090 useImportHFlx = .TRUE.
0091 useImportFW = .TRUE.
0092 useImportTau = .TRUE.
0093 useImportSLP = .TRUE.
0094 useImportRunOff = cpl_exchange_RunOff.EQ.3
0095 useImportSIce = cpl_exchange1W_sIce.EQ.3
0096 useImportThSIce = cpl_exchange2W_sIce.EQ.3
0097 useImportSltPlm = cpl_exchange_SaltPl.EQ.3
0098 useImportFice =( cpl_exchange_DIC .EQ. 3 .AND.
0099 & cpl_exchange1W_sIce.EQ.3 )
0100
0101 useImportCO2 = cpl_exchange_DIC .EQ. 3
0102 useImportWSpd = cpl_exchange_DIC .EQ. 3
0103 cpl_taveFreq = taveFreq
f5803a5d6d Jean*0104 #ifdef ALLOW_MNC
6c5a9380b0 Ed H*0105 cpl_snapshot_mnc = snapshot_mnc
0106 cpl_timeave_mnc = timeave_mnc
42a361c5e5 Jean*0107 #else
0108 cpl_snapshot_mnc = .FALSE.
0109 cpl_timeave_mnc = .FALSE.
f5803a5d6d Jean*0110 #endif
42a361c5e5 Jean*0111
69e21e3ef0 Jean*0112
0113
0114
0115 READ(UNIT=iUnit,NML=CPL_OCN_PARAM)
0116
42a361c5e5 Jean*0117 WRITE(msgBuf,'(A)')
69e21e3ef0 Jean*0118 & ' CPL_READPARMS: finished reading data.cpl'
31ebb84b18 Jean*0119 CALL PRINT_MESSAGE( msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1 )
42a361c5e5 Jean*0120
69e21e3ef0 Jean*0121
7a77863887 Mart*0122 #ifdef SINGLE_DISK_IO
69e21e3ef0 Jean*0123 CLOSE(iUnit)
7a77863887 Mart*0124 #else
0125 CLOSE(iUnit,STATUS='DELETE')
0126 #endif /* SINGLE_DISK_IO */
69e21e3ef0 Jean*0127
0128
44ff40f0ae Jean*0129
0130 IF ( .NOT.cpl_earlyExpImpCall ) THEN
0131 WRITE(msgBuf,'(2A)') 'CPL_READPARMS: ',
0132 & 'Parameter "cpl_earlyExpImpCall" has been retired;'
0133 CALL PRINT_ERROR( msgBuf, myThid )
0134 WRITE(msgBuf,'(2A)') 'CPL_READPARMS: ',
0135 & '=> always call coupler early in sequence of calls'
0136 CALL PRINT_ERROR( msgBuf, myThid )
31ebb84b18 Jean*0137 cplErrorCount = cplErrorCount + 1
44ff40f0ae Jean*0138 ENDIF
0139
69e21e3ef0 Jean*0140
0141
d06ba90ed2 Jean*0142 #ifndef ALLOW_DIC
0143 IF ( ocn_cplExch_RunOff ) THEN
0144 WRITE(msgBuf,'(2A)') 'CPL_READPARMS: needs',
0145 & ' to compile pkg/dic to use: ocn_cplExch_RunOff=T'
0146 CALL PRINT_ERROR( msgBuf, myThid )
0147 WRITE(msgBuf,'(2A)') 'CPL_READPARMS: ',
0148 & ' (set from Coupler "data.cpl": cpl_exchange_RunOff=1,3)'
0149 CALL PRINT_ERROR( msgBuf, myThid )
0150 cplErrorCount = cplErrorCount + 1
0151 ENDIF
0152 #endif /* ndef ALLOW_DIC */
0153 #ifndef ALLOW_THSICE
0154 IF ( ocn_cplExch2W_sIce ) THEN
0155 WRITE(msgBuf,'(2A)') 'CPL_READPARMS: needs',
0156 & ' to compile pkg/thsice to use: ocn_cplExch2W_sIce=T'
0157 CALL PRINT_ERROR( msgBuf, myThid )
0158 WRITE(msgBuf,'(2A)') 'CPL_READPARMS: ',
0159 & ' (set from Coupler "data.cpl": cpl_exchange2W_sIce=1,3)'
0160 CALL PRINT_ERROR( msgBuf, myThid )
0161 cplErrorCount = cplErrorCount + 1
0162 ENDIF
0163 #endif /* ndef ALLOW_THSICE */
0164 #ifndef ALLOW_SALT_PLUME
0165 IF ( ocn_cplExch_SaltPl ) THEN
0166 WRITE(msgBuf,'(2A)') 'CPL_READPARMS: needs',
0167 & ' compiled pkg/salt_plume to use: ocn_cplExch_SaltPl=T'
0168 CALL PRINT_ERROR( msgBuf, myThid )
0169 WRITE(msgBuf,'(2A)') 'CPL_READPARMS: ',
0170 & ' (set from Coupler "data.cpl": cpl_exchange_SaltPl=1,3)'
0171 CALL PRINT_ERROR( msgBuf, myThid )
0172 cplErrorCount = cplErrorCount + 1
0173 ENDIF
0174 #endif /* ndef ALLOW_SALT_PLUME */
0175 #ifndef ALLOW_DIC
0176 IF ( ocn_cplExch_DIC ) THEN
0177 WRITE(msgBuf,'(2A)') 'CPL_READPARMS: needs',
0178 & ' to compile pkg/dic to use: ocn_cplExch_DIC = T'
0179 CALL PRINT_ERROR( msgBuf, myThid )
0180 WRITE(msgBuf,'(2A)') 'CPL_READPARMS: ',
0181 & ' (set from Coupler "data.cpl": cpl_exchange_DIC = 1,3)'
0182 CALL PRINT_ERROR( msgBuf, myThid )
0183 cplErrorCount = cplErrorCount + 1
0184 ENDIF
0185 #endif /* ndef ALLOW_DIC */
0186
31ebb84b18 Jean*0187
69e21e3ef0 Jean*0188 #ifndef ALLOW_TIMEAVE
0189 IF (cpl_taveFreq.GT.0.) THEN
0190 WRITE(msgBuf,'(A)')
d4b28e407b Jean*0191 & 'CPL_READPARMS: cpl_taveFreq > 0 but not compiled pkg/timeave'
69e21e3ef0 Jean*0192 CALL PRINT_ERROR( msgBuf, myThid)
d4b28e407b Jean*0193 WRITE(msgBuf,'(A)')
0194 & 'Re-compile with pkg "timeave" in packages.conf'
69e21e3ef0 Jean*0195 CALL PRINT_ERROR( msgBuf, myThid)
31ebb84b18 Jean*0196 cplErrorCount = cplErrorCount + 1
69e21e3ef0 Jean*0197 ENDIF
d06ba90ed2 Jean*0198 #endif /* ndef ALLOW_TIMEAVE */
69e21e3ef0 Jean*0199
d4b28e407b Jean*0200 #ifndef ATMOSPHERIC_LOADING
8504a02c3f Jean*0201 iUnit = errorMessageUnit
d4b28e407b Jean*0202 IF ( useImportSLP ) THEN
8504a02c3f Jean*0203 WRITE(msgBuf,'(2A)') '** WARNING ** CPL_READPARMS:',
0204 & ' useImportSLP is set but'
31ebb84b18 Jean*0205 CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT, myThid )
d4b28e407b Jean*0206 ELSEIF ( useImportSIce ) THEN
8504a02c3f Jean*0207 WRITE(msgBuf,'(2A)') '** WARNING ** CPL_READPARMS:',
0208 & ' useImportSIce is set but'
31ebb84b18 Jean*0209 CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT, myThid )
d4b28e407b Jean*0210 ENDIF
0211 IF ( useImportSLP .OR. useImportSIce ) THEN
8504a02c3f Jean*0212 WRITE(msgBuf,'(2A)') '** WARNING ** CPL_READPARMS:',
0213 & ' pressure loading code is not active.'
31ebb84b18 Jean*0214 CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT, myThid )
e7c6a47db7 Jeff*0215
0216
0217
d4b28e407b Jean*0218 ENDIF
8504a02c3f Jean*0219 #endif /* ATMOSPHERIC_LOADING */
d4b28e407b Jean*0220
d06ba90ed2 Jean*0221 IF ( useImportRunOff .AND. cpl_exchange_RunOff.NE.3 ) THEN
0222 WRITE(msgBuf,'(2A)') 'CPL_READPARMS: useImportRunOff',
0223 & ' requires setting'
0224 CALL PRINT_ERROR( msgBuf, myThid)
0225 WRITE(msgBuf,'(2A)') 'CPL_READPARMS: ',
0226 & ' cpl_exchange_RunOff = 3 (in Coupler "data.cpl")'
0227 CALL PRINT_ERROR( msgBuf, myThid)
0228 cplErrorCount = cplErrorCount + 1
0229 ENDIF
0230 IF ( ( useImportSIce .OR.
0231 & useImportFice.AND.cpl_exchange2W_sIce.NE.3 )
0232 & .AND. cpl_exchange1W_sIce.NE.3 ) THEN
0233 WRITE(msgBuf,'(2A)') 'CPL_READPARMS: useImport',
0234 & ' SIce-Mass/Frac requires setting'
0235 CALL PRINT_ERROR( msgBuf, myThid)
0236 WRITE(msgBuf,'(2A)') 'CPL_READPARMS: ',
0237 & ' cpl_exchange1W_sIce = 3 (in Coupler "data.cpl")'
0238 CALL PRINT_ERROR( msgBuf, myThid)
0239 cplErrorCount = cplErrorCount + 1
0240 ENDIF
0241 IF ( useImportThSIce .AND. .NOT.ocn_cplExch2W_sIce ) THEN
0242 WRITE(msgBuf,'(2A)') 'CPL_READPARMS: useImportThSIce',
0243 & ' requires setting'
0244 CALL PRINT_ERROR( msgBuf, myThid)
0245 WRITE(msgBuf,'(2A)') 'CPL_READPARMS: ',
0246 & ' cpl_exchange2W_sIce=1,3 (in Coupler "data.cpl")'
0247 CALL PRINT_ERROR( msgBuf, myThid)
0248 cplErrorCount = cplErrorCount + 1
0249 ELSEIF ( useImportThSIce .AND. cpl_exchange2W_sIce.NE.3 ) THEN
0250 WRITE(msgBuf,'(2A)') '** WARNING ** CPL_READPARMS: ',
0251 & 'useImportThSIce useless without'
0252 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
0253 & SQUEEZE_RIGHT, myThid )
0254 WRITE(msgBuf,'(2A)') '** WARNING ** CPL_READPARMS: ',
0255 & ' cpl_exchange2W_sIce = 3 (in Coupler "data.cpl")'
0256 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
0257 & SQUEEZE_RIGHT, myThid )
0258 ENDIF
0259 IF ( useImportSltPlm .AND. cpl_exchange_SaltPl.NE.3 ) THEN
0260 WRITE(msgBuf,'(2A)') 'CPL_READPARMS: useImportSltPlm',
0261 & ' requires setting'
0262 CALL PRINT_ERROR( msgBuf, myThid)
0263 WRITE(msgBuf,'(2A)') 'CPL_READPARMS: ',
0264 & ' cpl_exchange_SaltPl = 3 (in Coupler "data.cpl")'
0265 CALL PRINT_ERROR( msgBuf, myThid)
0266 cplErrorCount = cplErrorCount + 1
0267 ENDIF
0268 IF ( ( useImportFice.AND.cpl_exchange2W_sIce.NE.3
0269 & .OR. useImportCO2 .OR. useImportWSpd )
0270 & .AND. cpl_exchange_DIC.NE.3 ) THEN
6826bab212 Jean*0271 WRITE(msgBuf,'(2A)') 'CPL_READPARMS: useImport',
d06ba90ed2 Jean*0272 & ' with DIC variables requires setting'
0273 CALL PRINT_ERROR( msgBuf, myThid)
0274 WRITE(msgBuf,'(2A)') 'CPL_READPARMS: ',
0275 & ' cpl_exchange_DIC = 3 (in Coupler "data.cpl")'
e7c6a47db7 Jeff*0276 CALL PRINT_ERROR( msgBuf, myThid)
31ebb84b18 Jean*0277 cplErrorCount = cplErrorCount + 1
e7c6a47db7 Jeff*0278 ENDIF
0279
6c5a9380b0 Ed H*0280
42a361c5e5 Jean*0281 cpl_snapshot_mdsio = .TRUE.
0282 cpl_timeave_mdsio = .TRUE.
0283 #ifdef ALLOW_MNC
0284 IF (useMNC) THEN
0285 IF ( .NOT.outputTypesInclusive
0286 & .AND. cpl_snapshot_mnc ) cpl_snapshot_mdsio = .FALSE.
0287 IF ( .NOT.outputTypesInclusive
0288 & .AND. cpl_timeave_mnc ) cpl_timeave_mdsio = .FALSE.
0289 ENDIF
0290 #endif
0291
69e21e3ef0 Jean*0292
0293
0294
31ebb84b18 Jean*0295
69e21e3ef0 Jean*0296
0297 iUnit = standardMessageUnit
0298 WRITE(msgBuf,'(A)') ' '
31ebb84b18 Jean*0299 CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT, myThid )
69e21e3ef0 Jean*0300 WRITE(msgBuf,'(A)') '// ==================================='
31ebb84b18 Jean*0301 CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT, myThid )
0302 WRITE(msgBuf,'(A)') '// Coupling set-up summary :'
0303 CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT, myThid )
69e21e3ef0 Jean*0304 WRITE(msgBuf,'(A)') '// ==================================='
31ebb84b18 Jean*0305 CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT, myThid )
0306
0307
0308 WRITE(msgBuf,'(A)') '// -------'
0309 CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT, myThid )
0310 WRITE(msgBuf,'(A)')
0311 & '// Coupler-exchange switch (received from coupler):'
0312 CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT, myThid )
0313
0314 CALL WRITE_0D_L( ocn_cplSequential, INDEX_NONE,
0315 & 'ocn_cplSequential =',
0316 & ' /* use Sequential Coupling Exchange on/off flag */')
0317
0318 CALL WRITE_0D_L( ocn_cplExch_RunOff, INDEX_NONE,
0319 & 'ocn_cplExch_RunOff =',
0320 & ' /* exchange RunOff fields with coupler on/off */')
0321 CALL WRITE_0D_L( ocn_cplExch1W_sIce, INDEX_NONE,
0322 & 'ocn_cplExch1W_sIce =',
0323 & ' /* 1-way exchange of seaice vars with coupler */')
0324 CALL WRITE_0D_L( ocn_cplExch2W_sIce, INDEX_NONE,
0325 & 'ocn_cplExch2W_sIce =',
0326 & ' /* 2-way exchange of ThSIce vars with coupler */')
0327 CALL WRITE_0D_L( ocn_cplExch_SaltPl, INDEX_NONE,
0328 & 'ocn_cplExch_SaltPl =',
0329 & ' /* exchange Salt-Plume fields with coupler */')
0330 CALL WRITE_0D_L( ocn_cplExch_DIC, INDEX_NONE,
0331 & 'ocn_cplExch_DIC =',
0332 & ' /* exchange DIC fields with coupler on/off */')
0333
0334
0335 WRITE(msgBuf,'(A)') '// -------'
0336 CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT, myThid )
0337 WRITE(msgBuf,'(A)')
0338 & '// Coupler parameters (from local param file):'
0339 CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT, myThid )
69e21e3ef0 Jean*0340
0341 CALL WRITE_0D_L( useImportHFlx, INDEX_NONE,
d06ba90ed2 Jean*0342 & 'useImportHFlx =',
42a361c5e5 Jean*0343 & ' /* use Imported Heat-Flx fr Coupler on/off flag */')
69e21e3ef0 Jean*0344 CALL WRITE_0D_L( useImportFW , INDEX_NONE,
d06ba90ed2 Jean*0345 & 'useImportFW =',
42a361c5e5 Jean*0346 & ' /* use Imported Fresh-Water fr Cpl. on/off flag */')
69e21e3ef0 Jean*0347 CALL WRITE_0D_L( useImportTau , INDEX_NONE,
d06ba90ed2 Jean*0348 & 'useImportTau =',
42a361c5e5 Jean*0349 & ' /* use Imported Wind-Stress fr Cpl. on/off flag */')
e596558d31 Jean*0350 CALL WRITE_0D_L( useImportSLP , INDEX_NONE,
d06ba90ed2 Jean*0351 & 'useImportSLP =',
42a361c5e5 Jean*0352 & ' /* use Imported Sea-level Atm Press on/off flag */')
d06ba90ed2 Jean*0353 CALL WRITE_0D_L( useImportRunOff , INDEX_NONE,
0354 & 'useImportRunOff=',
0355 & ' /* use Imported Run-Off fr Cpl. on/off flag */')
d4b28e407b Jean*0356 CALL WRITE_0D_L( useImportSIce , INDEX_NONE,
d06ba90ed2 Jean*0357 & 'useImportSIce =',
42a361c5e5 Jean*0358 & ' /* use Imported Sea-Ice loading on/off flag */')
d06ba90ed2 Jean*0359 CALL WRITE_0D_L( useImportThSIce , INDEX_NONE,
0360 & 'useImportThSIce=',
0361 & ' /* use Imported thSIce state-var on/off flag */')
0362 CALL WRITE_0D_L( useImportSltPlm , INDEX_NONE,
0363 & 'useImportSltPlm=',
0364 & ' /* use Imported Salt-Plume flux on/off flag */')
0365 CALL WRITE_0D_L( useImportFice , INDEX_NONE,
0366 & 'useImportFice =',
0367 & ' /* use Imported Seaice Frac (DIC-only) flag */')
6826bab212 Jean*0368 CALL WRITE_0D_L( useImportCO2 , INDEX_NONE,
d06ba90ed2 Jean*0369 & 'useImportCO2 =',
e7c6a47db7 Jeff*0370 & ' /* use Imported Atmos. CO2 fr Cpl. on/off flag */')
6826bab212 Jean*0371 CALL WRITE_0D_L( useImportWSpd , INDEX_NONE,
d06ba90ed2 Jean*0372 & 'useImportWSpd =',
e7c6a47db7 Jeff*0373 & ' /* use Imported Windspeed fr Cpl. on/off flag */')
d06ba90ed2 Jean*0374
4da4b49499 Jean*0375 CALL WRITE_0D_RL( cpl_taveFreq, INDEX_NONE, 'cpl_taveFreq =',
69e21e3ef0 Jean*0376 & ' /* Frequency^-1 for time-Aver. output (s) */')
42a361c5e5 Jean*0377 CALL WRITE_0D_L( cpl_timeave_mnc , INDEX_NONE,
0378 & 'cpl_timeave_mnc =',
0379 & ' /* write TimeAv to MNC file on/off flag */')
0380 CALL WRITE_0D_L( cpl_timeave_mdsio , INDEX_NONE,
0381 & 'cpl_timeave_mdsio =',
0382 & ' /* write TimeAv to MDSIO file on/off flag */')
69e21e3ef0 Jean*0383
31ebb84b18 Jean*0384 WRITE(msgBuf,'(A)') '// ==================================='
0385 CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT, myThid )
0386 WRITE(msgBuf,'(A)') '// End of Coupling set-up summary'
0387 CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT, myThid )
0388 WRITE(msgBuf,'(A)') '// ==================================='
0389 CALL PRINT_MESSAGE( msgBuf, iUnit, SQUEEZE_RIGHT, myThid )
0390
69e21e3ef0 Jean*0391
0392
0393 _END_MASTER(myThid)
42a361c5e5 Jean*0394
69e21e3ef0 Jean*0395
0396 _BARRIER
0397
0398 #endif /* COMPONENT_MODULE */
0399
0400 RETURN
0401 END