File indexing completed on 2022-01-14 06:11:04 UTC
view on githubraw file Latest commit 56d13a40 on 2022-01-13 18:04:11 UTC
8f134a052a Patr*0001 #include "EXF_OPTIONS.h"
0002
a66aad0124 Gael*0003
0004
0005
0006
0007
0008
e113337138 Jean*0009
0010
0011
0012
492dec36bd Jean*0013 SUBROUTINE EXF_CHECK( myThid )
8f134a052a Patr*0014
e113337138 Jean*0015
0016
0017
0018
0019
0020
8f134a052a Patr*0021
e113337138 Jean*0022
0023 IMPLICIT NONE
8f134a052a Patr*0024
e113337138 Jean*0025
8f134a052a Patr*0026 #include "EEPARAMS.h"
0027 #include "SIZE.h"
0028 #include "PARAMS.h"
0029
082e18c36c Jean*0030 #include "EXF_PARAM.h"
0031 #include "EXF_CONSTANTS.h"
30fcb891cf Jean*0032 #include "EXF_INTERP_SIZE.h"
0033 #include "EXF_INTERP_PARAM.h"
8f134a052a Patr*0034
e113337138 Jean*0035
0036
492dec36bd Jean*0037 INTEGER myThid
8f134a052a Patr*0038
e113337138 Jean*0039
8ee90b1274 Gael*0040
0041 CHARACTER*(MAX_LEN_MBUF) msgBuf
e113337138 Jean*0042 INTEGER errCount
0043
0044
0045 _BEGIN_MASTER(myThid)
0046 errCount = 0
8ee90b1274 Gael*0047
e113337138 Jean*0048 WRITE(msgBuf,'(A)') 'EXF_CHECK: #define ALLOW_EXF'
0049 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0050 & SQUEEZE_RIGHT, myThid )
8f134a052a Patr*0051
e113337138 Jean*0052
978ce8544a Jean*0053
87a8c4ec6c Mart*0054 IF (.NOT.
db51dfab8f Jean*0055 & (exf_iprec.EQ.precFloat32 .OR. exf_iprec.EQ.precFloat64)
87a8c4ec6c Mart*0056 & ) THEN
0057 WRITE(msgBuf,'(A)')
0058 & 'S/R EXF_CHECK: value of exf_iprec not allowed'
0059 CALL PRINT_ERROR( msgBuf, myThid )
e113337138 Jean*0060 errCount = errCount + 1
87a8c4ec6c Mart*0061 ENDIF
659d0ae881 Dimi*0062
5c05bb9f54 Jean*0063 IF ( repeatPeriod.LT.0. ) THEN
978ce8544a Jean*0064
e113337138 Jean*0065 WRITE(msgBuf,'(A)')
87a8c4ec6c Mart*0066 & 'S/R EXF_CHECK: repeatPeriod must be positive'
0067 CALL PRINT_ERROR( msgBuf, myThid )
e113337138 Jean*0068 errCount = errCount + 1
87a8c4ec6c Mart*0069 ENDIF
659d0ae881 Dimi*0070
5c05bb9f54 Jean*0071 IF ( useExfYearlyFields ) THEN
0072 IF ( .NOT.useCAL ) THEN
978ce8544a Jean*0073 WRITE(msgBuf,'(2A)') 'EXF_CHECK: ',
5c05bb9f54 Jean*0074 & 'useExfYearlyFields requires to use pkg/cal (useCAL=T)'
0075 CALL PRINT_ERROR( msgBuf, myThid )
0076 errCount = errCount + 1
0077 ENDIF
0078 IF ( repeatPeriod.NE.0. ) THEN
978ce8544a Jean*0079
0080 WRITE(msgBuf,'(2A)') 'EXF_CHECK: The use of ',
5c05bb9f54 Jean*0081 & 'useExfYearlyFields AND repeatPeriod is not implemented'
0082 CALL PRINT_ERROR( msgBuf, myThid )
0083 errCount = errCount + 1
0084 ENDIF
0085 ENDIF
0086 IF ( useOBCS .AND. useOBCSYearlyFields ) THEN
0087 IF ( .NOT.useCAL ) THEN
978ce8544a Jean*0088 WRITE(msgBuf,'(2A)') 'EXF_CHECK: ',
5c05bb9f54 Jean*0089 & 'useOBCSYearlyFields requires to use pkg/cal (useCAL=T)'
0090 CALL PRINT_ERROR( msgBuf, myThid )
0091 errCount = errCount + 1
0092 ENDIF
deacece587 Oliv*0093 IF ( repeatPeriod.NE.0. .AND. (OBCSNperiod.GE.0 .OR.
0094 & OBCSSperiod.GE.0 .OR. OBCSWperiod.GE.0 .OR.
0095 & OBCSEperiod.GE.0)) THEN
978ce8544a Jean*0096
0097 WRITE(msgBuf,'(2A)') 'EXF_CHECK: ',
5c05bb9f54 Jean*0098 & 'useOBCSYearlyFields not implemented for repeatPeriod <> 0'
0099 CALL PRINT_ERROR( msgBuf, myThid )
0100 errCount = errCount + 1
0101 ENDIF
87a8c4ec6c Mart*0102 ENDIF
8f134a052a Patr*0103
978ce8544a Jean*0104
0105
0106
0107
0108
0109
6d313fc1e1 Jean*0110 IF ( useAtmWind ) THEN
e113337138 Jean*0111 IF ( ustressfile .NE. ' ' .OR. vstressfile .NE. ' ' ) THEN
87a8c4ec6c Mart*0112 WRITE(msgBuf,'(A)')
978ce8544a Jean*0113 & 'EXF_CHECK: use u,v_wind components but not wind-stress'
87a8c4ec6c Mart*0114 CALL PRINT_ERROR( msgBuf, myThid )
e113337138 Jean*0115 errCount = errCount + 1
0116 ENDIF
6d313fc1e1 Jean*0117 ENDIF
1e33dfec5d Gael*0118
6d313fc1e1 Jean*0119 IF ( .NOT.useAtmWind ) THEN
87a8c4ec6c Mart*0120 IF ( uwindfile .NE. ' ' .OR. vwindfile .NE. ' ' ) THEN
0121 WRITE(msgBuf,'(A)')
978ce8544a Jean*0122 & 'EXF_CHECK: read-in wind-stress but not u,v_wind components'
87a8c4ec6c Mart*0123 CALL PRINT_ERROR( msgBuf, myThid )
e113337138 Jean*0124 errCount = errCount + 1
87a8c4ec6c Mart*0125 ENDIF
6d313fc1e1 Jean*0126 ENDIF
9c3e24f78c Jean*0127
978ce8544a Jean*0128 #if
0129 IF ( wspeedfile.NE.' ' .AND. .NOT.useAtmWind ) THEN
0130 WRITE(msgBuf,'(3A)') '** WARNING ** EXF_CHECK: "wspeed" ',
0131 & 'field is loaded from file but not used within pkg/exf'
0132 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
0133 & SQUEEZE_RIGHT, myThid )
0134 ENDIF
0135 #endif
0136
0137
0138
0139 #ifdef ALLOW_ATM_TEMP
0140 IF ( hfluxfile.NE.' ' ) THEN
0141 WRITE(msgBuf,'(3A)') '** WARNING ** EXF_CHECK: "hflux" ',
0142 & 'field is loaded from file but not used within pkg/exf'
0143 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
0144 & SQUEEZE_RIGHT, myThid )
0145 ENDIF
0146 IF ( sfluxfile.NE.' ' ) THEN
0147 WRITE(msgBuf,'(3A)') '** WARNING ** EXF_CHECK: "sflux" ',
0148 & 'field is loaded from file but not used within pkg/exf'
0149 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
0150 & SQUEEZE_RIGHT, myThid )
0151 ENDIF
0152
0153 # ifndef ALLOW_BULKFORMULAE
0154
0155
0156
0157
0158
0159
0160
0161 IF ( aqhfile.NE.' ' ) THEN
0162 WRITE(msgBuf,'(2A)') '** WARNING ** EXF_CHECK: "aqh" ',
0163 & 'field is loaded from file but not used within pkg/exf'
0164 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
0165 & SQUEEZE_RIGHT, myThid )
0166 ENDIF
0167 # endif /* ndef ALLOW_BULKFORMULAE */
0168 #else /* ALLOW_ATM_TEMP */
0169 IF ( atempfile.NE.' ' ) THEN
0170 WRITE(msgBuf,'(3A)') 'EXF_CHECK: Cannot read-in field ',
0171 & '"atemp" with #undef ALLOW_ATM_TEMP'
0172 CALL PRINT_ERROR( msgBuf, myThid )
0173 errCount = errCount + 1
0174 ENDIF
0175 IF ( aqhfile.NE.' ' ) THEN
0176 WRITE(msgBuf,'(3A)') 'EXF_CHECK: Cannot read-in field ',
0177 & '"aqh" with #undef ALLOW_ATM_TEMP'
0178 CALL PRINT_ERROR( msgBuf, myThid )
0179 errCount = errCount + 1
0180 ENDIF
0181 #endif /* ALLOW_ATM_TEMP */
0182
0183 #if (defined ALLOW_ATM_TEMP) && (defined ALLOW_READ_TURBFLUXES)
0184 # ifdef ALLOW_BULKFORMULAE
0185 IF ( hs_file.NE.' ' ) THEN
0186 WRITE(msgBuf,'(2A)') '** WARNING ** EXF_CHECK: "hs" ',
0187 & 'field is loaded from file but not used within pkg/exf'
0188 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
0189 & SQUEEZE_RIGHT, myThid )
0190 ENDIF
0191 IF ( hl_file.NE.' ' ) THEN
0192 WRITE(msgBuf,'(2A)') '** WARNING ** EXF_CHECK: "hl" ',
0193 & 'field is loaded from file but not used within pkg/exf'
0194 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
0195 & SQUEEZE_RIGHT, myThid )
0196 ENDIF
0197 # endif /* ALLOW_BULKFORMULAE */
0198 #else /* ALLOW_ATM_TEMP and ALLOW_READ_TURBFLUXES */
0199 IF ( hs_file.NE.' ' ) THEN
0200 WRITE(msgBuf,'(3A)') 'EXF_CHECK: Cannot read-in field ',
0201 & '"hs" without ALLOW_ATM_TEMP and ALLOW_READ_TURBFLUXES'
0202 CALL PRINT_ERROR( msgBuf, myThid )
0203 errCount = errCount + 1
0204 ENDIF
0205 IF ( hl_file.NE.' ' ) THEN
0206 WRITE(msgBuf,'(3A)') 'EXF_CHECK: Cannot read-in field ',
0207 & '"hl" without ALLOW_ATM_TEMP and ALLOW_READ_TURBFLUXES'
0208 CALL PRINT_ERROR( msgBuf, myThid )
0209 errCount = errCount + 1
0210 ENDIF
0211 #endif /* ALLOW_ATM_TEMP and ALLOW_READ_TURBFLUXES */
0212
0213 #if
0214 IF ( evapfile.NE.' ' ) THEN
0215 WRITE(msgBuf,'(3A)') 'EXF_CHECK: Cannot read-in field ',
0216 & '"evap" without ALLOW_ATM_TEMP and EXF_READ_EVAP'
0217 CALL PRINT_ERROR( msgBuf, myThid )
0218 errCount = errCount + 1
0219 ENDIF
0220 #endif /* ndef ALLOW_ATM_TEMP or ndef EXF_READ_EVAP */
0221
0222 #ifndef ALLOW_ATM_TEMP
0223 IF ( precipfile.NE.' ' ) THEN
0224 WRITE(msgBuf,'(3A)') 'EXF_CHECK: Cannot read-in field ',
0225 & '"precip" with #undef ALLOW_ATM_TEMP'
0226 CALL PRINT_ERROR( msgBuf, myThid )
0227 errCount = errCount + 1
0228 ENDIF
0229 IF ( snowprecipfile.NE.' ' ) THEN
0230 WRITE(msgBuf,'(3A)') 'EXF_CHECK: Cannot read-in field ',
0231 & '"snowprecip" with #undef ALLOW_ATM_TEMP'
0232 CALL PRINT_ERROR( msgBuf, myThid )
0233 errCount = errCount + 1
0234 ENDIF
0235 # ifndef SHORTWAVE_HEATING
0236 IF ( swfluxfile.NE.' ' ) THEN
0237 WRITE(msgBuf,'(3A)') 'EXF_CHECK: Cannot read-in field ',
0238 & '"swflux" without ALLOW_ATM_TEMP or SHORTWAVE_HEATING'
0239 CALL PRINT_ERROR( msgBuf, myThid )
0240 errCount = errCount + 1
0241 ENDIF
0242 IF ( swdownfile.NE.' ' ) THEN
0243 WRITE(msgBuf,'(3A)') 'EXF_CHECK: Cannot read-in field ',
0244 & '"swdown" without ALLOW_ATM_TEMP or SHORTWAVE_HEATING'
0245 CALL PRINT_ERROR( msgBuf, myThid )
0246 errCount = errCount + 1
0247 ENDIF
0248 # endif /* ndef SHORTWAVE_HEATING */
0249 IF ( lwfluxfile.NE.' ' ) THEN
0250 WRITE(msgBuf,'(3A)') 'EXF_CHECK: Cannot read-in field ',
0251 & '"lwflux" with #undef ALLOW_ATM_TEMP'
0252 CALL PRINT_ERROR( msgBuf, myThid )
0253 errCount = errCount + 1
0254 ENDIF
0255 IF ( lwdownfile.NE.' ' ) THEN
0256 WRITE(msgBuf,'(3A)') 'EXF_CHECK: Cannot read-in field ',
0257 & '"lwdown" with #undef ALLOW_ATM_TEMP'
0258 CALL PRINT_ERROR( msgBuf, myThid )
0259 errCount = errCount + 1
0260 ENDIF
0261 #endif /* ndef ALLOW_ATM_TEMP */
0262
0263 #ifdef ALLOW_DOWNWARD_RADIATION
0264 # if defined(ALLOW_ATM_TEMP) || defined(SHORTWAVE_HEATING)
0265 IF ( swdownfile.NE.' ' .AND. swfluxfile.NE.' ' ) THEN
0266 WRITE(msgBuf,'(2A)') '** WARNING ** EXF_CHECK: "swdown" ',
0267 & 'field is loaded from file but not used within pkg/exf'
0268 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
0269 & SQUEEZE_RIGHT, myThid )
0270 ENDIF
0271 # endif /* ALLOW_ATM_TEMP or SHORTWAVE_HEATING */
0272 # ifdef ALLOW_ATM_TEMP
0273 IF ( lwdownfile.NE.' ' .AND. lwfluxfile.NE.' ' ) THEN
0274 WRITE(msgBuf,'(2A)') '** WARNING ** EXF_CHECK: "lwdown" ',
0275 & 'field is loaded from file but not used within pkg/exf'
0276 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
0277 & SQUEEZE_RIGHT, myThid )
0278 ENDIF
0279 # endif /* ALLOW_ATM_TEMP or SHORTWAVE_HEATING */
0280 #else /* ALLOW_DOWNWARD_RADIATION */
0281 IF ( swdownfile.NE.' ' ) THEN
0282 WRITE(msgBuf,'(3A)') 'EXF_CHECK: Cannot read-in field ',
0283 & '"swdown" with #undef ALLOW_DOWNWARD_RADIATION'
0284 CALL PRINT_ERROR( msgBuf, myThid )
0285 errCount = errCount + 1
0286 ENDIF
0287 IF ( lwdownfile.NE.' ' ) THEN
0288 WRITE(msgBuf,'(3A)') 'EXF_CHECK: Cannot read-in field ',
0289 & '"lwdown" with #undef ALLOW_DOWNWARD_RADIATION'
0290 CALL PRINT_ERROR( msgBuf, myThid )
0291 errCount = errCount + 1
0292 ENDIF
0293 #endif /* ALLOW_DOWNWARD_RADIATION */
0294
0295 #ifndef ATMOSPHERIC_LOADING
0296 IF ( apressurefile.NE.' ' ) THEN
0297 WRITE(msgBuf,'(3A)') 'EXF_CHECK: Cannot read-in field ',
0298 & '"apressure" with #undef ATMOSPHERIC_LOADING'
0299 CALL PRINT_ERROR( msgBuf, myThid )
0300 errCount = errCount + 1
0301 ENDIF
0302 #endif /* ndef ATMOSPHERIC_LOADING */
0303
497d85062c Jean*0304 #ifndef EXF_ALLOW_TIDES
0305 IF ( tidePotFile.NE.' ' ) THEN
0306 WRITE(msgBuf,'(3A)') 'EXF_CHECK: Cannot read-in field ',
0307 & '"tidePot" with #undef EXF_ALLOW_TIDES'
0308 CALL PRINT_ERROR( msgBuf, myThid )
0309 errCount = errCount + 1
0310 ENDIF
0311 #endif /* ndef EXF_SEAICE_FRACTION */
0312
978ce8544a Jean*0313 #ifndef EXF_SEAICE_FRACTION
0314 IF ( areamaskfile.NE.' ' ) THEN
0315 WRITE(msgBuf,'(3A)') 'EXF_CHECK: Cannot read-in field ',
0316 & '"areamask" with #undef EXF_SEAICE_FRACTION'
0317 CALL PRINT_ERROR( msgBuf, myThid )
0318 errCount = errCount + 1
0319 ENDIF
0320 #endif /* ndef EXF_SEAICE_FRACTION */
0321
0322 #ifndef ALLOW_RUNOFF
0323 IF ( runofffile.NE.' ' ) THEN
0324 WRITE(msgBuf,'(3A)') 'EXF_CHECK: Cannot read-in field ',
0325 & '"runoff" with #undef ALLOW_RUNOFF'
0326 CALL PRINT_ERROR( msgBuf, myThid )
0327 errCount = errCount + 1
0328 ENDIF
0329 #endif /* ndef ALLOW_RUNOFF */
0330
0331 IF ( runoftempfile.NE.' ' ) THEN
0332 #ifndef ALLOW_RUNOFTEMP
0333 WRITE(msgBuf,'(3A)') 'EXF_CHECK: Cannot read-in field ',
0334 & '"runoftemp" with #undef ALLOW_RUNOFTEMP'
0335 CALL PRINT_ERROR( msgBuf, myThid )
0336 errCount = errCount + 1
0337 #endif /* ndef ALLOW_RUNOFTEMP */
0338 IF ( runofffile.EQ.' ' ) THEN
0339 WRITE(msgBuf,'(2A)') '** WARNING ** EXF_CHECK: "runoftemp" ',
0340 & 'field is loaded from file but not used within pkg/exf'
0341 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
0342 & SQUEEZE_RIGHT, myThid )
0343 ENDIF
0344 ENDIF
0345
0346 IF ( saltflxfile.NE.' ' ) THEN
0347 #ifndef ALLOW_SALTFLX
0348 WRITE(msgBuf,'(3A)') 'EXF_CHECK: Cannot read-in field ',
0349 & '"saltflx" with #undef ALLOW_SALTFLX'
0350 CALL PRINT_ERROR( msgBuf, myThid )
0351 errCount = errCount + 1
0352 #endif /* ndef ALLOW_SALTFLX */
0353 IF ( useSEAICE .OR. useThSIce ) THEN
0354 WRITE(msgBuf,'(2A)') 'EXF_CHECK: exf salt flux is not',
a66aad0124 Gael*0355 & ' allowed when using either pkg/seaice or pkg/thsice'
0356 CALL PRINT_ERROR( msgBuf, myThid )
0357 errCount = errCount + 1
0358 ENDIF
0359 ENDIF
978ce8544a Jean*0360
0361
a66aad0124 Gael*0362
f71b2ceff6 Gael*0363 #ifdef ALLOW_ZENITHANGLE
222f24f3e7 Jean*0364 IF ( ( useExfZenIncoming .OR. select_ZenAlbedo.NE.0 ) .AND.
0365 & ( usingCartesianGrid .OR. usingCylindricalGrid ) ) THEN
978ce8544a Jean*0366 WRITE(msgBuf,'(A,A)') 'EXF_CHECK: ZENITHANGLE code ',
222f24f3e7 Jean*0367 & 'does not work for cartesian and cylindrical grids'
87a8c4ec6c Mart*0368 CALL PRINT_ERROR( msgBuf, myThid )
e113337138 Jean*0369 errCount = errCount + 1
f71b2ceff6 Gael*0370 ENDIF
87a8c4ec6c Mart*0371 IF ( select_ZenAlbedo.LT.0 .OR. select_ZenAlbedo.GT.3 ) THEN
978ce8544a Jean*0372 WRITE(msgBuf,'(A,A)') 'EXF_CHECK: unsupported ',
87a8c4ec6c Mart*0373 & 'select_ZenAlbedo choice'
0374 CALL PRINT_ERROR( msgBuf, myThid )
e113337138 Jean*0375 errCount = errCount + 1
f71b2ceff6 Gael*0376 ENDIF
222f24f3e7 Jean*0377 IF ( select_ZenAlbedo.EQ.2 ) THEN
e113337138 Jean*0378 WRITE(msgBuf,'(A,A)')
978ce8544a Jean*0379 & '** WARNING ** EXF_CHECK: for daily mean albedo, ',
87a8c4ec6c Mart*0380 & 'it is advised to use select_ZenAlbedo.EQ.1 instead of 2'
0381 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0382 & SQUEEZE_RIGHT, myThid )
f71b2ceff6 Gael*0383 ENDIF
222f24f3e7 Jean*0384 IF ( select_ZenAlbedo.EQ.3 .AND. swdownperiod.GT.21600. ) THEN
978ce8544a Jean*0385 WRITE(msgBuf,'(A,A)') 'EXF_CHECK: using diurnal albedo ',
8ee90b1274 Gael*0386 & 'formula requires diurnal downward shortwave forcing'
87a8c4ec6c Mart*0387 CALL PRINT_ERROR( msgBuf, myThid )
e113337138 Jean*0388 errCount = errCount + 1
f71b2ceff6 Gael*0389 ENDIF
222f24f3e7 Jean*0390 IF ( select_ZenAlbedo.EQ.3 .AND. swdownperiod.GT.3600. ) THEN
978ce8544a Jean*0391 WRITE(msgBuf,'(3A)') '** WARNING ** EXF_CHECK: ',
87a8c4ec6c Mart*0392 & 'the diurnal albedo formula is likely not safe for such ',
0393 & 'coarse temporal resolution downward shortwave forcing'
0394 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0395 & SQUEEZE_RIGHT, myThid )
f71b2ceff6 Gael*0396 ENDIF
222f24f3e7 Jean*0397 #else /* ALLOW_ZENITHANGLE */
0398 IF ( useExfZenIncoming .OR. select_ZenAlbedo.NE.0 ) THEN
978ce8544a Jean*0399 WRITE(msgBuf,'(A,A)') 'EXF_CHECK: unsupported option',
222f24f3e7 Jean*0400 & ' when ALLOW_ZENITHANGLE is not defined'
0401 CALL PRINT_ERROR( msgBuf, myThid )
0402 errCount = errCount + 1
0403 ENDIF
c994dbe735 Jean*0404 #endif /* ALLOW_ZENITHANGLE */
f71b2ceff6 Gael*0405
be59d6c9bb Dimi*0406 #ifdef USE_EXF_INTERPOLATION
e113337138 Jean*0407 IF ( usingCartesianGrid ) THEN
978ce8544a Jean*0408 WRITE(msgBuf,'(A,A)') 'EXF_CHECK: ',
e113337138 Jean*0409 & 'USE_EXF_INTERPOLATION assumes latitude/longitude'
0410 CALL PRINT_ERROR( msgBuf, myThid )
978ce8544a Jean*0411 WRITE(msgBuf,'(A,A)') 'EXF_CHECK: ',
e113337138 Jean*0412 & 'input and output coordinates. Trivial to extend to'
0413 CALL PRINT_ERROR( msgBuf, myThid )
978ce8544a Jean*0414 WRITE(msgBuf,'(A,A)') 'EXF_CHECK: ',
e113337138 Jean*0415 & 'cartesian coordinates, but has not yet been done.'
0416 CALL PRINT_ERROR( msgBuf, myThid )
0417 errCount = errCount + 1
0418 ENDIF
0419
978ce8544a Jean*0420 CALL EXF_CHECK_INTERP( 'ustress', ustressfile,
0421 & ustress_interpMethod, ustress_nlat,
0422 & ustress_nlon, ustress_lon_inc, errCount, myThid )
0423 CALL EXF_CHECK_INTERP( 'vstress', vstressfile,
0424 & vstress_interpMethod, vstress_nlat,
0425 & vstress_nlon, vstress_lon_inc, errCount, myThid )
0426 CALL EXF_CHECK_INTERP( 'hflux', hfluxfile, hflux_interpMethod,
0427 & hflux_nlat, hflux_nlon, hflux_lon_inc, errCount, myThid )
0428 CALL EXF_CHECK_INTERP( 'sflux', sfluxfile, sflux_interpMethod,
0429 & sflux_nlat, sflux_nlon, sflux_lon_inc, errCount, myThid )
0430 CALL EXF_CHECK_INTERP( 'swflux', swfluxfile, swflux_interpMethod,
0431 & swflux_nlat, swflux_nlon, swflux_lon_inc, errCount, myThid )
0432 CALL EXF_CHECK_INTERP( 'runoff', runofffile, runoff_interpMethod,
0433 & runoff_nlat, runoff_nlon, runoff_lon_inc, errCount, myThid )
0434 CALL EXF_CHECK_INTERP( 'saltflx', saltflxfile,
0435 & saltflx_interpMethod, saltflx_nlat,
0436 & saltflx_nlon, saltflx_lon_inc, errCount, myThid )
0437 CALL EXF_CHECK_INTERP( 'atemp', atempfile, atemp_interpMethod,
0438 & atemp_nlat, atemp_nlon, atemp_lon_inc, errCount, myThid )
0439 CALL EXF_CHECK_INTERP( 'aqh', aqhfile, aqh_interpMethod,
0440 & aqh_nlat, aqh_nlon, aqh_lon_inc, errCount, myThid )
c994dbe735 Jean*0441 CALL EXF_CHECK_INTERP( 'hs', hs_file, hs_interpMethod,
978ce8544a Jean*0442 & hs_nlat, hs_nlon, hs_lon_inc, errCount, myThid )
c994dbe735 Jean*0443 CALL EXF_CHECK_INTERP( 'hl', hl_file, hl_interpMethod,
978ce8544a Jean*0444 & hl_nlat, hl_nlon, hl_lon_inc, errCount, myThid )
0445 CALL EXF_CHECK_INTERP( 'evap', evapfile, evap_interpMethod,
0446 & evap_nlat, evap_nlon, evap_lon_inc, errCount, myThid )
0447 CALL EXF_CHECK_INTERP( 'precip', precipfile, precip_interpMethod,
0448 & precip_nlat, precip_nlon, precip_lon_inc, errCount, myThid )
0449 CALL EXF_CHECK_INTERP( 'snowprecip', snowprecipfile,
0450 & snowprecip_interpMethod, snowprecip_nlat,
0451 & snowprecip_nlon, snowprecip_lon_inc, errCount, myThid )
0452 CALL EXF_CHECK_INTERP( 'uwind', uwindfile, uwind_interpMethod,
0453 & uwind_nlat, uwind_nlon, uwind_lon_inc, errCount, myThid )
0454 CALL EXF_CHECK_INTERP( 'vwind', vwindfile, vwind_interpMethod,
0455 & vwind_nlat, vwind_nlon, vwind_lon_inc, errCount, myThid )
0456 CALL EXF_CHECK_INTERP( 'wspeed', wspeedfile, wspeed_interpMethod,
0457 & wspeed_nlat, wspeed_nlon, wspeed_lon_inc, errCount, myThid )
0458 CALL EXF_CHECK_INTERP( 'lwflux', lwfluxfile, lwflux_interpMethod,
0459 & lwflux_nlat, lwflux_nlon, lwflux_lon_inc, errCount, myThid )
0460 CALL EXF_CHECK_INTERP( 'swdown', swdownfile, swdown_interpMethod,
0461 & swdown_nlat, swdown_nlon, swdown_lon_inc, errCount, myThid )
0462 CALL EXF_CHECK_INTERP( 'lwdown', lwdownfile, lwdown_interpMethod,
0463 & lwdown_nlat, lwdown_nlon, lwdown_lon_inc, errCount, myThid )
0464 CALL EXF_CHECK_INTERP( 'apressure', apressurefile,
0465 & apressure_interpMethod, apressure_nlat,
0466 & apressure_nlon, apressure_lon_inc, errCount, myThid )
497d85062c Jean*0467 CALL EXF_CHECK_INTERP( 'tidePot', tidePotFile,
0468 & tidePot_interpMethod, tidePot_nlat,
0469 & tidePot_nlon, tidePot_lon_inc, errCount, myThid )
978ce8544a Jean*0470 CALL EXF_CHECK_INTERP( 'areamask', areamaskfile,
0471 & areamask_interpMethod, areamask_nlat,
0472 & areamask_nlon, areamask_lon_inc, errCount, myThid )
0473 CALL EXF_CHECK_INTERP( 'climsst', climsstfile,
0474 & climsst_interpMethod, climsst_nlat,
0475 & climsst_nlon, climsst_lon_inc, errCount, myThid )
0476 CALL EXF_CHECK_INTERP( 'climsss', climsssfile,
0477 & climsss_interpMethod, climsss_nlat,
0478 & climsss_nlon, climsss_lon_inc, errCount, myThid )
0479 CALL EXF_CHECK_INTERP( 'climustr', climustrfile,
0480 & climustr_interpMethod, climustr_nlat,
0481 & climustr_nlon, climustr_lon_inc, errCount,myThid )
0482 CALL EXF_CHECK_INTERP( 'climvstr', climvstrfile,
0483 & climvstr_interpMethod, climvstr_nlat,
0484 & climvstr_nlon, climvstr_lon_inc, errCount, myThid )
e113337138 Jean*0485
ca03621776 Jean*0486
0487 IF ( ( uwind_interpMethod.GE.1 .AND. uwindfile.NE.' ' ) .OR.
0488 & ( vwind_interpMethod.GE.1 .AND. vwindfile.NE.' ' ) ) THEN
0489 IF ( usingCurvilinearGrid .OR. rotateGrid ) THEN
87a8c4ec6c Mart*0490 IF ( uwind_interpMethod.EQ.0 .OR. uwindfile.EQ.' ' .OR.
0491 & vwind_interpMethod.EQ.0 .OR. vwindfile.EQ.' ' ) THEN
ca03621776 Jean*0492
e113337138 Jean*0493 WRITE(msgBuf,'(A)')
978ce8544a Jean*0494 & 'EXF_CHECK: interp. needs 2 components (wind)'
87a8c4ec6c Mart*0495 CALL PRINT_ERROR( msgBuf, myThid )
e113337138 Jean*0496 errCount = errCount + 1
87a8c4ec6c Mart*0497 ENDIF
32e4056e6a Jean*0498 IF ( uwindStartTime .NE. vwindStartTime .OR.
978ce8544a Jean*0499 & uwindperiod .NE. vwindperiod .OR.
0500 & uwindRepCycle .NE. vwindRepCycle ) THEN
0501 WRITE(msgBuf,'(A,A)') 'EXF_CHECK: ',
87a8c4ec6c Mart*0502 & 'For CurvilinearGrid/RotatedGrid, the u and v wind '
0503 CALL PRINT_ERROR( msgBuf, myThid )
978ce8544a Jean*0504 WRITE(msgBuf,'(A,A,A)') 'EXF_CHECK: ',
0505 & 'files have to have the same StartTime,period & Cycle ',
87a8c4ec6c Mart*0506 & 'because S/R EXF_SET_UV assumes that.'
0507 CALL PRINT_ERROR( msgBuf, myThid )
e113337138 Jean*0508 errCount = errCount + 1
87a8c4ec6c Mart*0509 ENDIF
ca03621776 Jean*0510 ENDIF
9c3e24f78c Jean*0511 ENDIF
ca03621776 Jean*0512 IF ( (ustress_interpMethod.GE.1 .AND. ustressfile.NE.' ') .OR.
0513 & (vstress_interpMethod.GE.1 .AND. vstressfile.NE.' ') ) THEN
0514 IF ( readStressOnCgrid ) THEN
e113337138 Jean*0515 WRITE(msgBuf,'(A,A)')
978ce8544a Jean*0516 & 'EXF_CHECK: readStressOnCgrid=.TRUE. ',
87a8c4ec6c Mart*0517 & 'and interp wind-stress (=A-grid) are not compatible'
0518 CALL PRINT_ERROR( msgBuf, myThid )
e113337138 Jean*0519 errCount = errCount + 1
ca03621776 Jean*0520 ENDIF
0521 IF ( usingCurvilinearGrid .OR. rotateGrid ) THEN
87a8c4ec6c Mart*0522 IF ( ustress_interpMethod.EQ.0 .OR. ustressfile.EQ.' ' .OR.
0523 & vstress_interpMethod.EQ.0 .OR. vstressfile.EQ.' ' ) THEN
ca03621776 Jean*0524
e113337138 Jean*0525 WRITE(msgBuf,'(A)')
978ce8544a Jean*0526 & 'EXF_CHECK: interp. needs 2 components (wind-stress)'
87a8c4ec6c Mart*0527 CALL PRINT_ERROR( msgBuf, myThid )
e113337138 Jean*0528 errCount = errCount + 1
87a8c4ec6c Mart*0529 ENDIF
32e4056e6a Jean*0530 IF ( ustressStartTime .NE. vstressStartTime .OR.
978ce8544a Jean*0531 & ustressperiod .NE. vstressperiod .OR.
0532 & ustressRepCycle .NE. vstressRepCycle ) THEN
0533 WRITE(msgBuf,'(A,A)') 'EXF_CHECK: ',
87a8c4ec6c Mart*0534 & 'For CurvilinearGrid/RotatedGrid, the u and v wind stress '
0535 CALL PRINT_ERROR( msgBuf, myThid )
978ce8544a Jean*0536 WRITE(msgBuf,'(A,A,A)') 'EXF_CHECK: ',
0537 & 'have to have the same StartTime,period & Cycle ',
87a8c4ec6c Mart*0538 & 'because S/R EXF_SET_UV assumes that.'
0539 CALL PRINT_ERROR( msgBuf, myThid )
e113337138 Jean*0540 errCount = errCount + 1
87a8c4ec6c Mart*0541 ENDIF
ca03621776 Jean*0542 ENDIF
0543 ENDIF
0544
0545 IF ( (ustress_interpMethod.EQ.0 .AND. ustressfile.NE.' ') .OR.
0546 & (vstress_interpMethod.EQ.0 .AND. vstressfile.NE.' ') ) THEN
222f24f3e7 Jean*0547 #else /* ndef USE_EXF_INTERPOLATION */
ca03621776 Jean*0548 IF ( ustressfile .NE. ' ' .OR. vstressfile .NE. ' ' ) THEN
0549 #endif /* USE_EXF_INTERPOLATION */
87a8c4ec6c Mart*0550 IF ( (readStressOnAgrid.AND.readStressOnCgrid) .OR.
0551 & .NOT.(readStressOnAgrid.OR.readStressOnCgrid) ) THEN
0552 WRITE(msgBuf,'(A)')
978ce8544a Jean*0553 & 'EXF_CHECK: Select 1 wind-stress position: A or C-grid'
87a8c4ec6c Mart*0554 CALL PRINT_ERROR( msgBuf, myThid )
e113337138 Jean*0555 errCount = errCount + 1
87a8c4ec6c Mart*0556 ENDIF
63930fb278 Gael*0557 IF (rotateStressOnAgrid.AND..NOT.readStressOnAgrid) THEN
978ce8544a Jean*0558 WRITE(msgBuf,'(2A)') 'EXF_CHECK: rotateStressOnAgrid ',
0559 & 'only applies to cases readStressOnAgrid is true'
63930fb278 Gael*0560 CALL PRINT_ERROR( msgBuf, myThid )
e113337138 Jean*0561 errCount = errCount + 1
63930fb278 Gael*0562 ENDIF
0e202116a1 Jean*0563 IF ( rotateStressOnAgrid .AND.
0564 & ( ustressfile .EQ. ' ' .OR. ustressperiod .EQ. 0. .OR.
0565 & vstressfile .EQ. ' ' .OR. vstressperiod .EQ. 0. ) ) THEN
0566 WRITE(msgBuf,'(2A)') 'EXF_CHECK: rotateStressOnAgrid ',
0567 & 'requires to update u/vstress'
0568 CALL PRINT_ERROR( msgBuf, myThid )
0569 errCount = errCount + 1
0570 ENDIF
63930fb278 Gael*0571
9c3e24f78c Jean*0572 ELSE
e113337138 Jean*0573 IF ( readStressOnAgrid .OR. readStressOnCgrid .OR.
978ce8544a Jean*0574 & rotateStressOnAgrid ) THEN
0575 WRITE(msgBuf,'(2A)') '** WARNING ** EXF_CHECK: ',
0576 & 'wind-stress position irrelevant'
0577 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
0578 & SQUEEZE_RIGHT, myThid )
87a8c4ec6c Mart*0579 ENDIF
9c3e24f78c Jean*0580 ENDIF
ca03621776 Jean*0581
0582 #ifdef USE_NO_INTERP_RUNOFF
e113337138 Jean*0583 WRITE(msgBuf,'(A)')
978ce8544a Jean*0584 & 'EXF_CHECK: USE_NO_INTERP_RUNOFF code has been removed;'
ca03621776 Jean*0585 CALL PRINT_ERROR( msgBuf, myThid )
e113337138 Jean*0586 WRITE(msgBuf,'(A,A)')
978ce8544a Jean*0587 & 'EXF_CHECK: use instead "runoff_interpMethod=0"',
ca03621776 Jean*0588 & ' in "data.exf" (EXF_NML_04)'
0589 CALL PRINT_ERROR( msgBuf, myThid )
e113337138 Jean*0590 errCount = errCount + 1
ca03621776 Jean*0591 #endif /* USE_NO_INTERP_RUNOFF */
be59d6c9bb Dimi*0592
b6445f0d85 Patr*0593 #ifdef ALLOW_CLIMTEMP_RELAXATION
978ce8544a Jean*0594 WRITE(msgBuf,'(A,A)') 'EXF_CHECK: ',
87a8c4ec6c Mart*0595 & 'ALLOW_CLIMTEMP_RELAXATION no longer supported. Use pkg/rbcs'
0596 CALL PRINT_ERROR( msgBuf, myThid )
e113337138 Jean*0597 errCount = errCount + 1
c994dbe735 Jean*0598 #endif /* ALLOW_CLIMTEMP_RELAXATION */
8f134a052a Patr*0599
b6445f0d85 Patr*0600 #ifdef ALLOW_CLIMSALT_RELAXATION
978ce8544a Jean*0601 WRITE(msgBuf,'(A,A)') 'EXF_CHECK: ',
87a8c4ec6c Mart*0602 & 'ALLOW_CLIMSALT_RELAXATION no longer supported. Use pkg/rbcs'
0603 CALL PRINT_ERROR( msgBuf, myThid )
e113337138 Jean*0604 errCount = errCount + 1
c994dbe735 Jean*0605 #endif /* ALLOW_CLIMSALT_RELAXATION */
b6445f0d85 Patr*0606
492dec36bd Jean*0607 IF ( climsstTauRelax.NE.0. ) THEN
0608 #ifndef ALLOW_CLIMSST_RELAXATION
978ce8544a Jean*0609 WRITE(msgBuf,'(A)') 'EXF_CHECK: climsstTauRelax > 0'
87a8c4ec6c Mart*0610 CALL PRINT_ERROR( msgBuf, myThid )
e113337138 Jean*0611 WRITE(msgBuf,'(A)')
978ce8544a Jean*0612 & 'EXF_CHECK: but ALLOW_CLIMSST_RELAXATION is not defined'
87a8c4ec6c Mart*0613 CALL PRINT_ERROR( msgBuf, myThid )
e113337138 Jean*0614 errCount = errCount + 1
c994dbe735 Jean*0615 #endif /* ndef ALLOW_CLIMSST_RELAXATION */
492dec36bd Jean*0616 IF ( climsstfile.EQ.' ' ) THEN
978ce8544a Jean*0617 WRITE(msgBuf,'(A)') 'EXF_CHECK: climsstTauRelax > 0 but'
492dec36bd Jean*0618 CALL PRINT_ERROR( msgBuf, myThid )
978ce8544a Jean*0619 WRITE(msgBuf,'(A)') 'EXF_CHECK: climsstfile is not set'
492dec36bd Jean*0620 CALL PRINT_ERROR( msgBuf, myThid )
e113337138 Jean*0621 errCount = errCount + 1
492dec36bd Jean*0622 ENDIf
0623 ENDIf
e113337138 Jean*0624
492dec36bd Jean*0625 IF ( climsssTauRelax.NE.0. ) THEN
0626 #ifndef ALLOW_CLIMSSS_RELAXATION
978ce8544a Jean*0627 WRITE(msgBuf,'(A)') 'EXF_CHECK: climsssTauRelax > 0'
87a8c4ec6c Mart*0628 CALL PRINT_ERROR( msgBuf, myThid )
e113337138 Jean*0629 WRITE(msgBuf,'(A)')
978ce8544a Jean*0630 & 'EXF_CHECK: but ALLOW_CLIMSSS_RELAXATION is not defined'
87a8c4ec6c Mart*0631 CALL PRINT_ERROR( msgBuf, myThid )
e113337138 Jean*0632 errCount = errCount + 1
c994dbe735 Jean*0633 #endif /* ALLOW_CLIMSSS_RELAXATION */
492dec36bd Jean*0634 IF ( climsssfile.EQ.' ' ) THEN
978ce8544a Jean*0635 WRITE(msgBuf,'(A)') 'EXF_CHECK: climsssTauRelax > 0 but'
492dec36bd Jean*0636 CALL PRINT_ERROR( msgBuf, myThid )
978ce8544a Jean*0637 WRITE(msgBuf,'(A)') 'EXF_CHECK: climsssfile is not set'
492dec36bd Jean*0638 CALL PRINT_ERROR( msgBuf, myThid )
e113337138 Jean*0639 errCount = errCount + 1
492dec36bd Jean*0640 ENDIF
0641 ENDIF
0642
e113337138 Jean*0643
0644
0645 IF ( errCount.GE.1 ) THEN
0646 WRITE(msgBuf,'(A,I3,A)')
0647 & 'EXF_CHECK: detected', errCount,' fatal error(s)'
0648 CALL PRINT_ERROR( msgBuf, myThid )
0649 CALL ALL_PROC_DIE( 0 )
0650 STOP 'ABNORMAL END: S/R EXF_CHECK'
0651 ENDIF
0652
0653 _END_MASTER(myThid)
0654
9c3e24f78c Jean*0655 RETURN
0656 END
d5392b983c Gael*0657
0658
0659
0660
0661
0662
0663
c994dbe735 Jean*0664 SUBROUTINE EXF_CHECK_INTERP(
978ce8544a Jean*0665 I loc_name, loc_file, loc_interpMethod,
0666 I loc_nlat, loc_nlon, loc_lon_inc,
c994dbe735 Jean*0667 U errCount,
0668 I myThid )
d5392b983c Gael*0669
0670
0671
0672
0673
0674
0675
0676
0677
0678 IMPLICIT NONE
0679
0680
0681 #include "EEPARAMS.h"
978ce8544a Jean*0682 #include "EXF_INTERP_SIZE.h"
d5392b983c Gael*0683
0684
978ce8544a Jean*0685
0686
0687
0688
0689
0690
0691
0692
c994dbe735 Jean*0693 CHARACTER*(*) loc_name
0694 CHARACTER*(*) loc_file
d5392b983c Gael*0695 INTEGER loc_interpMethod
c994dbe735 Jean*0696 INTEGER loc_nlat
978ce8544a Jean*0697 INTEGER loc_nlon
0698 _RL loc_lon_inc
c994dbe735 Jean*0699 INTEGER errCount
0700 INTEGER myThid
d5392b983c Gael*0701
0702
0703
0704 CHARACTER*(MAX_LEN_MBUF) msgBuf
0705
0706
0707 IF ( loc_interpMethod.GE.1 .AND. loc_file.NE.' ' ) THEN
d1272ed847 Dimi*0708 IF ( loc_nlat .GT. (MAX_LAT_INC+1) ) THEN
978ce8544a Jean*0709 WRITE(msgBuf,'(3A)') 'EXF_CHECK_INTERP: ',loc_name,
d1272ed847 Dimi*0710 & '_nlat > (MAX_LAT_INC+1)'
d5392b983c Gael*0711 CALL PRINT_ERROR( msgBuf, myThid )
0712 errCount = errCount + 1
0713 ENDIF
978ce8544a Jean*0714 #ifndef EXF_INTERP_USE_DYNALLOC
0715
0716 IF ( loc_nlon.GT.exf_max_nLon ) THEN
0717 WRITE(msgBuf,'(3A)') 'EXF_CHECK_INTERP: ',loc_name,
0718 & '_nlon > exf_max_nLon'
0719 CALL PRINT_ERROR( msgBuf, myThid )
0720 errCount = errCount + 1
0721 ENDIF
0722 IF ( loc_nlat.GT.exf_max_nLat ) THEN
0723 WRITE(msgBuf,'(3A)') 'EXF_CHECK_INTERP: ',loc_name,
0724 & '_nlat > exf_max_nLat'
0725 CALL PRINT_ERROR( msgBuf, myThid )
0726 errCount = errCount + 1
0727 ENDIF
0728 IF ( (loc_nlon+4)*(loc_nlat+4).GT.exf_interp_bufferSize ) THEN
0729 WRITE(msgBuf,'(6A)') 'EXF_CHECK_INTERP: ',
0730 & 'exf_interp_bufferSize too small for ',
0731 & loc_name, '_nlon & ', loc_name, '_nlat'
0732 CALL PRINT_ERROR( msgBuf, myThid )
0733 errCount = errCount + 1
0734 ENDIF
0735 #endif /* ndef EXF_INTERP_USE_DYNALLOC */
d5392b983c Gael*0736 IF ( loc_lon_inc.GT.500. ) THEN
978ce8544a Jean*0737 WRITE(msgBuf,'(4A,1PE16.8)') 'EXF_CHECK_INTERP: ',
d5392b983c Gael*0738 & 'Invalid value for: ',loc_name,'_lon_inc =', loc_lon_inc
0739 CALL PRINT_ERROR( msgBuf, myThid )
978ce8544a Jean*0740 WRITE(msgBuf,'(4A)') 'EXF_CHECK_INTERP: Fix it ',
d5392b983c Gael*0741 & 'or Turn off ',loc_name,'-interp (interpMethod=0)'
0742 CALL PRINT_ERROR( msgBuf, myThid )
0743 errCount = errCount + 1
0744 ENDIF
0745 ENDIF
0746
0747 RETURN
0748 END