File indexing completed on 2024-10-18 05:11:22 UTC
view on githubraw file Latest commit 5bb179dd on 2024-10-17 18:00:27 UTC
809c36b928 Patr*0001 #include "SEAICE_OPTIONS.h"
b0c32e7c62 Jean*0002 #ifdef ALLOW_EXF
0003 # include "EXF_OPTIONS.h"
0004 #endif
772b2ed80e Gael*0005 #ifdef ALLOW_AUTODIFF
0006 # include "AUTODIFF_OPTIONS.h"
0007 #endif
809c36b928 Patr*0008
a7a2228515 Jean*0009
0010
0011
809c36b928 Patr*0012 SUBROUTINE SEAICE_CHECK( myThid )
a7a2228515 Jean*0013
0014
8e92ca36c0 Jean*0015
a7a2228515 Jean*0016
8e92ca36c0 Jean*0017
a7a2228515 Jean*0018
8e92ca36c0 Jean*0019
a7a2228515 Jean*0020
0021
0022
809c36b928 Patr*0023 IMPLICIT NONE
0024
0025
0026 #include "SIZE.h"
0027 #include "EEPARAMS.h"
0028 #include "PARAMS.h"
358649780a Gael*0029 #ifdef ALLOW_EXF
0030 # include "EXF_PARAM.h"
0031 #endif
ceae9498ad Gael*0032 #include "GRID.h"
ccaa3c61f4 Patr*0033 #include "SEAICE_SIZE.h"
6060ec2938 Dimi*0034 #include "SEAICE_PARAMS.h"
cf9fa44a59 Patr*0035 #include "SEAICE.h"
ccaa3c61f4 Patr*0036 #include "SEAICE_TRACER.h"
e0fa1cecbf Mart*0037 #ifdef ALLOW_GENERIC_ADVDIFF
0038 # include "GAD.h"
0039 #endif /* ALLOW_GENERIC_ADVDIFF */
a7a2228515 Jean*0040
809c36b928 Patr*0041
a7a2228515 Jean*0042
809c36b928 Patr*0043 INTEGER myThid
a7a2228515 Jean*0044
809c36b928 Patr*0045
a7a2228515 Jean*0046
809c36b928 Patr*0047
c3a5b6decf Jean*0048
a7a2228515 Jean*0049
dc26f158aa Mart*0050
c3a5b6decf Jean*0051 INTEGER ioUnit
809c36b928 Patr*0052 CHARACTER*(MAX_LEN_MBUF) msgBuf
1819581090 Mart*0053 LOGICAL checkAdvSchArea, checkAdvSchHeff, checkAdvSchSnow
e54fe3e1f9 Gael*0054 LOGICAL checkAdvSchSalt
8bc8bee483 Gael*0055 #ifdef ALLOW_SITRACER
0056 INTEGER iTracer
0057 #endif
ceae9498ad Gael*0058 _RL SEAICE_mcphee_max
0320e25227 Mart*0059 INTEGER kSrf
3c7d68edf4 Mart*0060 INTEGER i
dc26f158aa Mart*0061 INTEGER errCount
3c7d68edf4 Mart*0062 INTEGER ILNBLNK
0063 EXTERNAL ILNBLNK
a7a2228515 Jean*0064
0065
0320e25227 Mart*0066 IF ( usingPCoords ) THEN
0067 kSrf = Nr
ceae9498ad Gael*0068 ELSE
0320e25227 Mart*0069 kSrf = 1
ceae9498ad Gael*0070 ENDIF
c3a5b6decf Jean*0071 ioUnit = errorMessageUnit
ceae9498ad Gael*0072
835bd4f8b2 Jean*0073 _BEGIN_MASTER(myThid)
0074
cee16b76ae Dimi*0075
809c36b928 Patr*0076 WRITE(msgBuf,'(A)') 'SEAICE_CHECK: #define ALLOW_SEAICE'
0077 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
3efa3cc6e1 Jean*0078 & SQUEEZE_RIGHT, myThid )
809c36b928 Patr*0079
dc26f158aa Mart*0080 errCount = 0
0081
0f1d4cfc8d Dimi*0082
34d6f142df Jean*0083 IF (tracForcingOutAB.NE.1) THEN
0084 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK:',
0085 & ' Need T,S forcing out of AB (tracForcingOutAB=1)'
835bd4f8b2 Jean*0086 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0087 errCount = errCount + 1
0f1d4cfc8d Dimi*0088 ENDIF
0089
fa64f6674f Jean*0090
0091
0092 IF ( usePW79thermodynamics ) THEN
0093
65f34462d4 Gael*0094
fa64f6674f Jean*0095 IF ((SEAICE_areaGainFormula.LT.1).OR.
0096 & (SEAICE_areaGainFormula.GT.2)) THEN
65f34462d4 Gael*0097 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK:',
6ec4646d60 Gael*0098 & ' SEAICE_areaGainFormula must be between 1 and 2'
65f34462d4 Gael*0099 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0100 errCount = errCount + 1
fa64f6674f Jean*0101 ENDIF
0102 IF ((SEAICE_areaLossFormula.LT.1).OR.
0103 & (SEAICE_areaLossFormula.GT.3)) THEN
6ec4646d60 Gael*0104 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK:',
0105 & ' SEAICE_areaLossFormula must be between 1 and 2'
0106 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0107 errCount = errCount + 1
fa64f6674f Jean*0108 ENDIF
6ec4646d60 Gael*0109
fa64f6674f Jean*0110 IF ( (.NOT.SEAICE_doOpenWaterGrowth)
6ec4646d60 Gael*0111 & .AND.( (SEAICE_areaGainFormula.NE.2).OR.
0112 & (SEAICE_areaLossFormula.NE.3) ) ) THEN
0113 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: ',
0114 & 'when SEAICE_doOpenWaterGrowth is false, you need to set'
0115 CALL PRINT_ERROR( msgBuf, myThid )
0116 WRITE(msgBuf,'(A)')
0117 & 'SEAICE_areaGainFormula.EQ.2 and SEAICE_areaLossFormula.EQ.3'
0118 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0119 errCount = errCount + 1
fa64f6674f Jean*0120 ENDIF
6ec4646d60 Gael*0121
ceae9498ad Gael*0122
0123
0320e25227 Mart*0124 SEAICE_mcphee_max=drF(kSrf)/SEAICE_deltaTtherm
0125 IF ( usingPCoords ) SEAICE_mcphee_max
0126 & = SEAICE_mcphee_max * recip_rhoConst * recip_gravity
fa64f6674f Jean*0127 IF ( SEAICE_mcPheePiston .LT. 0. _d 0 .OR.
0128 & SEAICE_mcPheePiston .GT. SEAICE_mcphee_max ) THEN
0129 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK:',
0130 & ' SEAICE_mcPheePiston is out of bounds.'
0131 CALL PRINT_ERROR( msgBuf, myThid )
0132 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK:',
0133 & ' They must lie within 0. and drF(1)/SEAICE_deltaTtherm'
0134 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0135 errCount = errCount + 1
fa64f6674f Jean*0136 ENDIF
8bc8bee483 Gael*0137
fa64f6674f Jean*0138 IF ( ( SEAICE_frazilFrac .LT. 0. _d 0 ) .OR.
0139 & ( SEAICE_frazilFrac .GT. 1. _d 0 ) ) THEN
0140 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK:',
0141 & ' SEAICE_frazilFrac is out of bounds.'
0142 CALL PRINT_ERROR( msgBuf, myThid )
0143 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK:',
0144 & ' They must lie within 0. and 1. '
0145 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0146 errCount = errCount + 1
fa64f6674f Jean*0147 ENDIF
8bc8bee483 Gael*0148
fa64f6674f Jean*0149 IF ( ( SEAICE_mcPheeTaper .LT. 0. _d 0 ) .OR.
0150 & ( SEAICE_mcPheeTaper .GT. 1. _d 0 ) ) THEN
0151 WRITE(msgBuf,'(2A)')
1c278edd09 Jean*0152 & 'SEAICE_mcPheeTaper cannot be specified ',
8bc8bee483 Gael*0153 & 'outside of the [0. 1.] range'
fa64f6674f Jean*0154 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0155 errCount = errCount + 1
fa64f6674f Jean*0156 ENDIF
8bc8bee483 Gael*0157
fa64f6674f Jean*0158 IF ( SEAICE_doOpenWaterMelt .AND.
0159 & (.NOT.SEAICE_doOpenWaterGrowth) ) THEN
6ec4646d60 Gael*0160 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: ',
0161 & 'to use SEAICE_doOpenWaterMelt, you need to '
0162 CALL PRINT_ERROR( msgBuf, myThid )
0163 WRITE(msgBuf,'(A)')
0164 & 'also set SEAICE_doOpenWaterGrowth to .TRUE.'
0165 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0166 errCount = errCount + 1
0167 ENDIF
0168
0169
0170 IF ( SEAICE_dryIceAlb .GT. SEAICE_drySnowAlb ) THEN
0171 WRITE(msgBuf,'(2A)') '** WARNING ** SEAICE_CHECK: ',
0172 & 'SEAICE_dryIceAlb > SEAICE_drySnowAlb makes little sense'
0173 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
0174 & SQUEEZE_RIGHT, myThid )
0175 WRITE(msgBuf,'(2A)') '** WARNING ** SEAICE_CHECK: and leads ',
0176 & 'to albedo = SEAICE_drySnowAlb for all snow thicknesses'
0177 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
0178 & SQUEEZE_RIGHT, myThid )
0179 ENDIF
0180 IF ( SEAICE_wetIceAlb .GT. SEAICE_wetSnowAlb ) THEN
0181 WRITE(msgBuf,'(2A)') '** WARNING ** SEAICE_CHECK: ',
0182 & 'SEAICE_wetIceAlb > SEAICE_wetSnowAlb makes little sense'
0183 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
0184 & SQUEEZE_RIGHT, myThid )
0185 WRITE(msgBuf,'(2A)') '** WARNING ** SEAICE_CHECK: and leads ',
0186 & 'to albedo = SEAICE_wetSnowAlb for all snow thicknesses'
0187 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
0188 & SQUEEZE_RIGHT, myThid )
0189 ENDIF
0190 IF ( SEAICE_dryIceAlb_south .GT. SEAICE_drySnowAlb_south ) THEN
0191 WRITE(msgBuf,'(3A)') '** WARNING ** SEAICE_CHECK: ',
0192 & 'SEAICE_dryIceAlb_south > SEAICE_drySnowAlb_south ',
0193 & 'makes little sense'
0194 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
0195 & SQUEEZE_RIGHT, myThid )
0196 WRITE(msgBuf,'(2A)') '** WARNING ** SEAICE_CHECK: and leads ',
0197 & 'to albedo = SEAICE_drySnowAlb_south for all snow thicknesses'
0198 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
0199 & SQUEEZE_RIGHT, myThid )
0200 ENDIF
0201 IF ( SEAICE_wetIceAlb_south .GT. SEAICE_wetSnowAlb_south ) THEN
0202 WRITE(msgBuf,'(3A)') '** WARNING ** SEAICE_CHECK: ',
0203 & 'SEAICE_wetIceAlb_south > SEAICE_wetSnowAlb_south ',
0204 & 'makes little sense'
0205 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
0206 & SQUEEZE_RIGHT, myThid )
0207 WRITE(msgBuf,'(2A)') '** WARNING ** SEAICE_CHECK: and leads ',
0208 & 'to albedo = SEAICE_wetSnowAlb_south for all snow thicknesses'
0209 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
0210 & SQUEEZE_RIGHT, myThid )
fa64f6674f Jean*0211 ENDIF
0212
0213
6ec4646d60 Gael*0214 ENDIF
fa64f6674f Jean*0215
0216
e6353c27c4 Gael*0217
8bc8bee483 Gael*0218
0219
7e00d7e8f9 Jean*0220 #ifdef ALLOW_BALANCE_FLUXES
0221 IF ( usePW79thermodynamics .AND. selectBalanceEmPmR.EQ.2 ) THEN
0222 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: ',
0223 & 'selectBalanceEmPmR=2 not yet implemented in pkg/seaice'
0224 CALL PRINT_ERROR( msgBuf, myThid )
0225 errCount = errCount + 1
0226 ENDIF
0227 #endif
0228
e6353c27c4 Gael*0229 #ifdef SEAICE_DISABLE_HEATCONSFIX
0230 IF ( SEAICEheatConsFix ) THEN
0231 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: ',
0232 & 'to use SEAICEheatConsFix, you need to '
0233 CALL PRINT_ERROR( msgBuf, myThid )
0234 WRITE(msgBuf,'(A)')
0235 & 'undef SEAICE_DISABLE_HEATCONSFIX and recompile'
0236 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0237 errCount = errCount + 1
e6353c27c4 Gael*0238 ENDIF
0239 #endif
0240
8bc8bee483 Gael*0241 #ifndef ALLOW_SITRACER
0242 IF ( SEAICE_salinityTracer ) THEN
0243 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: ',
0244 & 'to use SEAICE_salinityTracer, you need to '
0245 CALL PRINT_ERROR( msgBuf, myThid )
0246 WRITE(msgBuf,'(A)')
0247 & 'define ALLOW_SITRACER and recompile'
0248 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0249 errCount = errCount + 1
8bc8bee483 Gael*0250 ENDIF
0251
0252 IF ( SEAICE_ageTracer ) THEN
0253 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: ',
0254 & 'to use SEAICE_ageTracer, you need to '
0255 CALL PRINT_ERROR( msgBuf, myThid )
0256 WRITE(msgBuf,'(A)')
0257 & 'define ALLOW_SITRACER and recompile'
0258 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0259 errCount = errCount + 1
8bc8bee483 Gael*0260 ENDIF
0261 #endif
0262
0263
0264 #ifdef ALLOW_SITRACER
0265
0266
0267
0268
0269 DO iTracer = 1, SItrNumInUse
0270
0271 IF ( ( SItrFromOceanFrac(iTracer) .LT. 0. _d 0 ) .OR.
0272 & ( SItrFromOceanFrac(iTracer) .GT. 1. _d 0 ) ) THEN
1c278edd09 Jean*0273 WRITE(msgBuf,'(2A)')
0274 & 'SItrFromOceanFrac cannot be specified ',
8bc8bee483 Gael*0275 & 'outside of the [0. 1.] range'
3efa3cc6e1 Jean*0276 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0277 errCount = errCount + 1
8bc8bee483 Gael*0278 ENDIF
0279
0280 IF ( ( SItrFromFloodFrac(iTracer) .LT. 0. _d 0 ) .OR.
0281 & ( SItrFromFloodFrac(iTracer) .GT. 1. _d 0 ) ) THEN
1c278edd09 Jean*0282 WRITE(msgBuf,'(2A)')
0283 & 'SItrFromFloodFrac cannot be specified ',
8bc8bee483 Gael*0284 & 'outside of the [0. 1.] range'
3efa3cc6e1 Jean*0285 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0286 errCount = errCount + 1
8bc8bee483 Gael*0287 ENDIF
0288
0289
0290
1c278edd09 Jean*0291
0292
8bc8bee483 Gael*0293
3efa3cc6e1 Jean*0294
dc26f158aa Mart*0295
8bc8bee483 Gael*0296
0297
0298 IF ( (SItrName(iTracer).NE.'salinity').AND.
0299 & ( (SItrFromOceanFrac(iTracer).NE.ZERO).OR.
0300 & (SItrFromFloodFrac(iTracer).NE.ZERO) ) ) THEN
1c278edd09 Jean*0301 WRITE(msgBuf,'(2A)')
0302 & 'SItrFromOceanFrac / SItrFromFloodFrac is only ',
8bc8bee483 Gael*0303 & 'available for SItrName = "salinity" (for now)'
3efa3cc6e1 Jean*0304 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0305 errCount = errCount + 1
8bc8bee483 Gael*0306 ENDIF
0307
0308 ENDDO
1c278edd09 Jean*0309 #endif
0310
1819581090 Mart*0311
e0fa1cecbf Mart*0312 #ifdef ALLOW_GENERIC_ADVDIFF
1819581090 Mart*0313 checkAdvSchArea = SEAICEadvArea .AND. (
0314 & SEAICEadvSchArea.NE.ENUM_UPWIND_1RST .AND.
0315 & SEAICEadvSchArea.NE.ENUM_CENTERED_2ND .AND.
0316 & SEAICEadvSchArea.NE.ENUM_DST2 .AND.
0317 & SEAICEadvSchArea.NE.ENUM_FLUX_LIMIT .AND.
0318 & SEAICEadvSchArea.NE.ENUM_DST3 .AND.
0319 & SEAICEadvSchArea.NE.ENUM_DST3_FLUX_LIMIT .AND.
83ddf5a6c6 Mart*0320 & SEAICEadvSchArea.NE.ENUM_PPM_NULL_LIMIT .AND.
0321 & SEAICEadvSchArea.NE.ENUM_PPM_MONO_LIMIT .AND.
0322 & SEAICEadvSchArea.NE.ENUM_PPM_WENO_LIMIT .AND.
0323 & SEAICEadvSchArea.NE.ENUM_PQM_NULL_LIMIT .AND.
0324 & SEAICEadvSchArea.NE.ENUM_PQM_MONO_LIMIT .AND.
0325 & SEAICEadvSchArea.NE.ENUM_PQM_WENO_LIMIT .AND.
1819581090 Mart*0326 & SEAICEadvSchArea.NE.ENUM_OS7MP )
0327 checkAdvSchHEFF = SEAICEadvHeff .AND. (
0328 & SEAICEadvSchHeff.NE.ENUM_UPWIND_1RST .AND.
0329 & SEAICEadvSchHeff.NE.ENUM_CENTERED_2ND .AND.
0330 & SEAICEadvSchHeff.NE.ENUM_DST2 .AND.
0331 & SEAICEadvSchHeff.NE.ENUM_FLUX_LIMIT .AND.
0332 & SEAICEadvSchHeff.NE.ENUM_DST3 .AND.
0333 & SEAICEadvSchHeff.NE.ENUM_DST3_FLUX_LIMIT .AND.
83ddf5a6c6 Mart*0334 & SEAICEadvSchHeff.NE.ENUM_PPM_NULL_LIMIT .AND.
0335 & SEAICEadvSchHeff.NE.ENUM_PPM_MONO_LIMIT .AND.
0336 & SEAICEadvSchHeff.NE.ENUM_PPM_WENO_LIMIT .AND.
0337 & SEAICEadvSchHeff.NE.ENUM_PQM_NULL_LIMIT .AND.
0338 & SEAICEadvSchHeff.NE.ENUM_PQM_MONO_LIMIT .AND.
0339 & SEAICEadvSchHeff.NE.ENUM_PQM_WENO_LIMIT .AND.
1819581090 Mart*0340 & SEAICEadvSchHeff.NE.ENUM_OS7MP )
0341 checkAdvSchSnow = SEAICEadvSnow .AND. (
0342 & SEAICEadvSchSnow.NE.ENUM_UPWIND_1RST .AND.
0343 & SEAICEadvSchSnow.NE.ENUM_CENTERED_2ND .AND.
0344 & SEAICEadvSchSnow.NE.ENUM_DST2 .AND.
0345 & SEAICEadvSchSnow.NE.ENUM_FLUX_LIMIT .AND.
0346 & SEAICEadvSchSnow.NE.ENUM_DST3 .AND.
0347 & SEAICEadvSchSnow.NE.ENUM_DST3_FLUX_LIMIT .AND.
83ddf5a6c6 Mart*0348 & SEAICEadvSchSnow.NE.ENUM_PPM_NULL_LIMIT .AND.
0349 & SEAICEadvSchSnow.NE.ENUM_PPM_MONO_LIMIT .AND.
0350 & SEAICEadvSchSnow.NE.ENUM_PPM_WENO_LIMIT .AND.
0351 & SEAICEadvSchSnow.NE.ENUM_PQM_NULL_LIMIT .AND.
0352 & SEAICEadvSchSnow.NE.ENUM_PQM_MONO_LIMIT .AND.
0353 & SEAICEadvSchSnow.NE.ENUM_PQM_WENO_LIMIT .AND.
1819581090 Mart*0354 & SEAICEadvSchSnow.NE.ENUM_OS7MP )
0355 checkAdvSchSalt = SEAICEadvSalt .AND. (
0356 & SEAICEadvSchSalt.NE.ENUM_UPWIND_1RST .AND.
0357 & SEAICEadvSchSalt.NE.ENUM_CENTERED_2ND .AND.
0358 & SEAICEadvSchSalt.NE.ENUM_DST2 .AND.
0359 & SEAICEadvSchSalt.NE.ENUM_FLUX_LIMIT .AND.
0360 & SEAICEadvSchSalt.NE.ENUM_DST3 .AND.
0361 & SEAICEadvSchSalt.NE.ENUM_DST3_FLUX_LIMIT .AND.
83ddf5a6c6 Mart*0362 & SEAICEadvSchSalt.NE.ENUM_PPM_NULL_LIMIT .AND.
0363 & SEAICEadvSchSalt.NE.ENUM_PPM_MONO_LIMIT .AND.
0364 & SEAICEadvSchSalt.NE.ENUM_PPM_WENO_LIMIT .AND.
0365 & SEAICEadvSchSalt.NE.ENUM_PQM_NULL_LIMIT .AND.
0366 & SEAICEadvSchSalt.NE.ENUM_PQM_MONO_LIMIT .AND.
0367 & SEAICEadvSchSalt.NE.ENUM_PQM_WENO_LIMIT .AND.
8c02537f20 Jean*0368 & SEAICEadvSchSalt.NE.ENUM_OS7MP )
0369 IF ( checkAdvSchArea .OR. checkAdvSchHeff .OR.
e54fe3e1f9 Gael*0370 & checkAdvSchSnow .OR. checkAdvSchSalt ) THEN
f681b7f5d4 Dimi*0371 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: allowed advection schemes',
e54fe3e1f9 Gael*0372 & ' for heff, area, snow, and salt are: '
1819581090 Mart*0373 CALL PRINT_ERROR( msgBuf, myThid )
83ddf5a6c6 Mart*0374 WRITE(msgBuf,'(A,13I3)') 'SEAICE_CHECK:',
1819581090 Mart*0375 & ENUM_UPWIND_1RST, ENUM_CENTERED_2ND, ENUM_DST2,
8c02537f20 Jean*0376 & ENUM_FLUX_LIMIT, ENUM_DST3, ENUM_DST3_FLUX_LIMIT,
83ddf5a6c6 Mart*0377 & ENUM_PPM_NULL_LIMIT,ENUM_PPM_MONO_LIMIT,ENUM_PPM_WENO_LIMIT,
0378 & ENUM_PQM_NULL_LIMIT,ENUM_PQM_MONO_LIMIT,ENUM_PQM_WENO_LIMIT,
1819581090 Mart*0379 & ENUM_OS7MP
0380 CALL PRINT_ERROR( msgBuf, myThid )
0381 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK:',
83ddf5a6c6 Mart*0382 & ' the following Adv.Schemes are not allowed:'
1819581090 Mart*0383 CALL PRINT_ERROR( msgBuf, myThid )
8e92ca36c0 Jean*0384 IF ( checkAdvSchArea ) THEN
0385 WRITE(msgBuf,'(2A,I3)') 'SEAICE_CHECK:',
0386 & ' SEAICEadvSchArea = ', SEAICEadvSchArea
0387 CALL PRINT_ERROR( msgBuf, myThid )
0388 ENDIF
0389 IF ( checkAdvSchHeff ) THEN
0390 WRITE(msgBuf,'(2A,I3)') 'SEAICE_CHECK:',
0391 & ' SEAICEadvSchHeff = ', SEAICEadvSchHeff
0392 CALL PRINT_ERROR( msgBuf, myThid )
0393 ENDIF
0394 IF ( checkAdvSchSnow ) THEN
0395 WRITE(msgBuf,'(2A,I3)') 'SEAICE_CHECK:',
0396 & ' SEAICEadvSchSnow = ', SEAICEadvSchSnow
0397 CALL PRINT_ERROR( msgBuf, myThid )
0398 ENDIF
0399 IF ( checkAdvSchSalt ) THEN
0400 WRITE(msgBuf,'(2A,I3)') 'SEAICE_CHECK:',
0401 & ' SEAICEadvSchSalt = ', SEAICEadvSchSalt
0402 CALL PRINT_ERROR( msgBuf, myThid )
0403 ENDIF
dc26f158aa Mart*0404 errCount = errCount + 1
1819581090 Mart*0405 ENDIF
8e92ca36c0 Jean*0406 IF ( SEAICEadvScheme.EQ.ENUM_CENTERED_2ND ) THEN
0407
0408
0409
0410 checkAdvSchArea = SEAICEadvArea .AND.
0411 & SEAICEadvSchArea.NE.ENUM_CENTERED_2ND
0412 checkAdvSchHEFF = SEAICEadvHeff .AND.
0413 & SEAICEadvSchHeff.NE.ENUM_CENTERED_2ND
0414 checkAdvSchSnow = SEAICEadvSnow .AND.
0415 & SEAICEadvSchSnow.NE.ENUM_CENTERED_2ND
0416 checkAdvSchSalt = SEAICEadvSalt .AND.
0417 & SEAICEadvSchSalt.NE.ENUM_CENTERED_2ND
e0fa1cecbf Mart*0418 #else /* not ALLOW_GENERIC_ADVDIFF */
0419 IF ( SEAICEadvScheme.EQ.2 ) THEN
0420
0421
0422
0423 checkAdvSchArea = SEAICEadvArea .AND.
0424 & SEAICEadvSchArea.NE.2
0425 checkAdvSchHEFF = SEAICEadvHeff .AND.
0426 & SEAICEadvSchHeff.NE.2
0427 checkAdvSchSnow = SEAICEadvSnow .AND.
0428 & SEAICEadvSchSnow.NE.2
0429 checkAdvSchSalt = SEAICEadvSalt .AND.
0430 & SEAICEadvSchSalt.NE.2
0431 #endif /* ALLOW_GENERIC_ADVDIFF */
8e92ca36c0 Jean*0432 IF ( checkAdvSchArea .OR. checkAdvSchHeff .OR.
e54fe3e1f9 Gael*0433 & checkAdvSchSnow .OR. checkAdvSchSalt ) THEN
8e92ca36c0 Jean*0434 WRITE(msgBuf,'(A,I3,A)') 'SEAICE_CHECK: SEAICEadvScheme=',
0435 & SEAICEadvScheme, ' not compatible with those Adv.Scheme:'
0436 CALL PRINT_ERROR( msgBuf, myThid )
0437 IF ( checkAdvSchArea ) THEN
0438 WRITE(msgBuf,'(2A,I3)') 'SEAICE_CHECK:',
0439 & ' SEAICEadvSchArea = ', SEAICEadvSchArea
0440 CALL PRINT_ERROR( msgBuf, myThid )
0441 ENDIF
0442 IF ( checkAdvSchHeff ) THEN
0443 WRITE(msgBuf,'(2A,I3)') 'SEAICE_CHECK:',
0444 & ' SEAICEadvSchHeff = ', SEAICEadvSchHeff
0445 CALL PRINT_ERROR( msgBuf, myThid )
0446 ENDIF
0447 IF ( checkAdvSchSnow ) THEN
0448 WRITE(msgBuf,'(2A,I3)') 'SEAICE_CHECK:',
0449 & ' SEAICEadvSchSnow = ', SEAICEadvSchSnow
0450 CALL PRINT_ERROR( msgBuf, myThid )
0451 ENDIF
0452 IF ( checkAdvSchSalt ) THEN
0453 WRITE(msgBuf,'(2A,I3)') 'SEAICE_CHECK:',
0454 & ' SEAICEadvSchSalt = ', SEAICEadvSchSalt
0455 CALL PRINT_ERROR( msgBuf, myThid )
0456 ENDIF
dc26f158aa Mart*0457 errCount = errCount + 1
8e92ca36c0 Jean*0458 ENDIF
a7a2228515 Jean*0459 ELSEIF ( DIFF1 .NE. 0. _d 0 ) THEN
0460
0461
0462 WRITE(msgBuf,'(2A,1PE16.8)') 'SEAICE_CHECK: ',
0463 & 'harmonic+biharmonic DIFF1=', DIFF1
0464 CALL PRINT_ERROR( msgBuf, myThid )
0465 WRITE(msgBuf,'(2A,I3)') 'SEAICE_CHECK: ',
0466 & 'not available with SEAICEadvScheme=', SEAICEadvScheme
0467 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0468 errCount = errCount + 1
8e92ca36c0 Jean*0469 ENDIF
1819581090 Mart*0470
37ee17b0db Jean*0471
0472 IF ( DIFF1 .NE. 0. _d 0 .AND. (
0473 & ( SEAICEdiffKhHeff .NE. 0. _d 0 ) .OR.
0474 & ( SEAICEdiffKhArea .NE. 0. _d 0 ) .OR.
0475 & ( SEAICEdiffKhSnow .NE. 0. _d 0 ) .OR.
e54fe3e1f9 Gael*0476 & ( SEAICEdiffKhSalt .NE. 0. _d 0 )
37ee17b0db Jean*0477 & ) ) THEN
0478 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK:',
0479 & ' DIFF1 > 0 and one of the SEAICEdiffKh[] > 0'
0480 CALL PRINT_ERROR( msgBuf, myThid )
0481 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK:',
0482 & ' => Cannot use both type of diffusion'
0483 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0484 errCount = errCount + 1
37ee17b0db Jean*0485 ENDIF
6d78fc5463 Gael*0486
53957712aa Mart*0487 IF ( postSolvTempIter.GT.2 .OR. postSolvTempIter .LT. 0 ) THEN
0488 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK:',
0489 & ' => allowed values for postSolveTempIter: 0, 1, 2'
0490 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0491 errCount = errCount + 1
53957712aa Mart*0492 ENDIF
0493
96da9a2bc2 Gael*0494 IF ( SEAICEpresH0 .LE. 0. _d 0 .OR.
0495 & SEAICEpresPow0 .LT. 0 .OR. SEAICEpresPow1 .LT. 0 ) THEN
0496 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: ',
0497 & 'SEAICEpresH0 (real), SEAICEpresPow0 (integer)'
3efa3cc6e1 Jean*0498 CALL PRINT_ERROR( msgBuf, myThid )
96da9a2bc2 Gael*0499 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: OR SEAICEpresPow1 ',
0500 & '(integer) has been specified as negative (data.seaice)'
3efa3cc6e1 Jean*0501 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0502 errCount = errCount + 1
96da9a2bc2 Gael*0503 ENDIF
f82b316546 Jean*0504
8a37a22def Patr*0505
0ae85bb38a Patr*0506 #ifdef ALLOW_AUTODIFF_TAMC
af61e5eb16 Mart*0507 IF ( SEAICEuseLSR ) THEN
79df32c3f1 Mart*0508 IF ( SEAICEnonLinIterMax .GT. MPSEUDOTIMESTEPS ) THEN
8a37a22def Patr*0509 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK:',
0510 & ' need to increase MPSEUDOTIMESTEPS in SEAICE_PARAMS.h'
0511 CALL PRINT_ERROR( msgBuf, myThid )
0512 WRITE(msgBuf,'(2A,2I4)') 'SEAICE_CHECK:',
79df32c3f1 Mart*0513 & ' MPSEUDOTIMESTEPS, SEAICEnonLinIterMax = ',
0514 & MPSEUDOTIMESTEPS, SEAICEnonLinIterMax
8a37a22def Patr*0515 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0516 errCount = errCount + 1
8a37a22def Patr*0517 ENDIF
0d75a51072 Mart*0518 IF ( SEAICElinearIterMax .GT. SOLV_MAX_FIXED ) THEN
0519 WRITE(msgBuf,'(2A,I10,A,I10)') 'SEAICE_CHECK:',
0520 & 'SEAICElinearIterMax = ', SEAICElinearIterMax,
0521 & ' > SOLV_MAX_FIXED = ', SOLV_MAX_FIXED
0522 CALL PRINT_ERROR( msgBuf, myThid )
0523 WRITE(msgBuf,'(2A,I10,A,I10)') 'SEAICE_CHECK:',
0524 &'either increase SOLV_MAX_FIXED or decrease SEAICElinearIterMax'
0525 CALL PRINT_ERROR( msgBuf, myThid )
0526 STOP 'ABNORMAL END: S/R SEAICE_LSR'
0527 ENDIF
8b7b383de8 Mart*0528 IF ( IMAX_TICE .GT. NMAX_TICE ) THEN
0529 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK:',
0530 & ' need to increase NMAX_TICE in SEAICE_PARAMS.h'
0531 CALL PRINT_ERROR( msgBuf, myThid )
0532 WRITE(msgBuf,'(2A,2I4)') 'SEAICE_CHECK:',
0533 & ' NMAX_TICE, MAX_TICE = ', NMAX_TICE, IMAX_TICE
0534 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0535 errCount = errCount + 1
8b7b383de8 Mart*0536 ENDIF
af61e5eb16 Mart*0537
0538 ENDIF
b0c32e7c62 Jean*0539 IF ( SEAICE_maskRHS ) THEN
0540 WRITE(msgBuf,'(A)') 'SEAICE_CHECK: SEAICE_maskRHS not allowed'
0541 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0542 errCount = errCount + 1
b0c32e7c62 Jean*0543 ENDIF
0ae85bb38a Patr*0544 #endif
8a37a22def Patr*0545
45315406aa Mart*0546
0547 #if ( defined SEAICE_CGRID && defined SEAICE_BGRID_DYNAMICS )
0548 WRITE(msgBuf,'(A,A)')
0549 & 'SEAICE_CHECK: SEAICE_CGRID and SEAICE_BGRID_DYNAMICS ',
0550 & 'cannot be defined at the same time.'
0551 CALL PRINT_ERROR( msgBuf, myThid )
0552 errCount = errCount + 1
0553 #endif
0554 #if
cee16b76ae Dimi*0555 IF (SEAICEuseDYNAMICS) THEN
45315406aa Mart*0556 WRITE(msgBuf,'(A,A)')
0557 & 'SEAICE_CHECK: either SEAICE_CGRID ',
0558 & 'or SEAICE_BGRID_DYNAMICS needed for SEAICEuseDYNAMICS = T'
835bd4f8b2 Jean*0559 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0560 errCount = errCount + 1
cee16b76ae Dimi*0561 ENDIF
6060ec2938 Dimi*0562 #endif
cee16b76ae Dimi*0563
2e05c0b826 Mart*0564 #ifndef SEAICE_ALLOW_MOM_ADVECTION
210ee8461e jm-c 0565 IF ( SEAICEmomAdvection ) THEN
2e05c0b826 Mart*0566 WRITE(msgBuf,'(A)')
0567 & 'SEAICE_ALLOW_MOM_ADVECTION needed for SEAICEmomAdvection'
0568 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0569 errCount = errCount + 1
2e05c0b826 Mart*0570 ENDIF
0571 #endif
0572
ae1fb66b64 Dimi*0573
cee16b76ae Dimi*0574 #ifdef SEAICE_EXTERNAL_FORCING
3efa3cc6e1 Jean*0575 WRITE(msgBuf,'(2A)') '** WARNING ** SEAICE_CHECK: ',
ae1fb66b64 Dimi*0576 & 'SEAICE_EXTERNAL_FORCING option is obsolete:'
3efa3cc6e1 Jean*0577 CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
0578 WRITE(msgBuf,'(2A)') '** WARNING ** SEAICE_CHECK: ',
8c1e355199 Mart*0579 & 'seaice now always uses exf to read input files.'
3efa3cc6e1 Jean*0580 CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
ae1fb66b64 Dimi*0581 #endif
0582
050eb90cc6 Gael*0583
0584 #ifdef SEAICE_GROWTH_LEGACY
0585 WRITE(msgBuf,'(2A)') '** WARNING ** SEAICE_CHECK: ',
0586 & 'CPP flag SEAICE_GROWTH_LEGACY has been retired.'
0587 CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
0588 #endif /* SEAICE_GROWTH_LEGACY */
0589
0590
0591 #ifdef SEAICE_CAP_HEFF
0592 WRITE(msgBuf,'(2A)') '** WARNING ** SEAICE_CHECK: ',
0593 & 'CPP flag SEAICE_CAP_HEFF has been retired.'
0594 CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
0595 #endif /* SEAICE_CAP_HEFF */
0596
94e16c6a45 Dimi*0597
0598 #ifdef SEAICE_MULTICATEGORY
0599 WRITE(msgBuf,'(2A)') '** WARNING ** SEAICE_CHECK: ',
0600 & 'CPP flag SEAICE_MULTICATEGORY has been retired.'
3efa3cc6e1 Jean*0601 CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
94e16c6a45 Dimi*0602 WRITE(msgBuf,'(2A)') '** WARNING ** SEAICE_CHECK: ',
0603 & 'Specify SEAICE_multDim=7 in data.seaice to recover'
3efa3cc6e1 Jean*0604 CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
94e16c6a45 Dimi*0605 WRITE(msgBuf,'(2A)') '** WARNING ** SEAICE_CHECK: ',
0606 & 'previous default SEAICE_MULTICATEGORY setting.'
3efa3cc6e1 Jean*0607 CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
94e16c6a45 Dimi*0608 #endif /* SEAICE_MULTICATEGORY */
0609
8377b8ee87 Mart*0610
136908bfac Ian *0611 #ifdef SEAICE_ALLOW_TD_IF
0612 WRITE(msgBuf,'(A)')
0613 & 'SEAICE_ALLOW_TD_IF option is obsolete:'
0614 CALL PRINT_ERROR( msgBuf, myThid )
0615 WRITE(msgBuf,'(A)')
0616 & 'the seaice*_IF codes are now merged into the main branch.'
0617 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0618 errCount = errCount + 1
1ed503f8a3 Gael*0619 #endif /* SEAICE_ALLOW_TD_IF */
0620
8377b8ee87 Mart*0621
6ec4646d60 Gael*0622 #if defined(SEAICE_DO_OPEN_WATER_GROWTH) || \
1c278edd09 Jean*0623 defined(SEAICE_DO_OPEN_WATER_MELT)
6ec4646d60 Gael*0624 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: ',
0625 & 'SEAICE_DO_OPEN_WATER_GROWTH / MELT options are obsolete'
0626 CALL PRINT_ERROR( msgBuf, myThid )
0627 WRITE(msgBuf,'(2A)') 'they are replaced with run time',
0628 & ' parameter SEAICE_doOpenWaterGrowth / Melt'
0629 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0630 errCount = errCount + 1
6ec4646d60 Gael*0631 #endif /* SEAICE_DO_OPEN_WATER_GROWTH */
0632
8377b8ee87 Mart*0633
6ec4646d60 Gael*0634 #ifdef SEAICE_OCN_MELT_ACT_ON_AREA
0635 WRITE(msgBuf,'(A)')
0636 & 'SEAICE_OCN_MELT_ACT_ON_AREA option is obsolete:'
0637 CALL PRINT_ERROR( msgBuf, myThid )
0638 WRITE(msgBuf,'(A)')
0639 & 'it is now done with SEAICE_areaLossFormula.EQ.1 and 2'
0640 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0641 errCount = errCount + 1
6ec4646d60 Gael*0642 #endif /* SEAICE_OCN_MELT_ACT_ON_AREA */
0643
8377b8ee87 Mart*0644
6ec4646d60 Gael*0645 #ifdef FENTY_AREA_EXPANSION_CONTRACTION
0646 WRITE(msgBuf,'(A)')
0647 & 'FENTY_AREA_EXPANSION_CONTRACTION option is obsolete:'
0648 CALL PRINT_ERROR( msgBuf, myThid )
0649 WRITE(msgBuf,'(A)')
0650 & 'it is now done with SEAICE_areaLoss(Melt)Formula.EQ.1'
0651 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0652 errCount = errCount + 1
6ec4646d60 Gael*0653 #endif /* SEAICE_DO_OPEN_WATER_MELT */
0654
8377b8ee87 Mart*0655
1ed503f8a3 Gael*0656 #ifdef SEAICE_AGE
0657 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: ',
0658 & 'SEAICE_AGE option is obsolete: '
0659 CALL PRINT_ERROR( msgBuf, myThid )
0660 WRITE(msgBuf,'(2A)') 'it now is done',
0661 & ' with SEAICE_SITRACER and siTrName=age'
0662 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0663 errCount = errCount + 1
1ed503f8a3 Gael*0664 #endif /* SEAICE_AGE */
136908bfac Ian *0665
8377b8ee87 Mart*0666
a98c4b8072 Ian *0667 #ifdef SEAICE_SALINITY
0668 WRITE(msgBuf,'(A)')
0669 & 'SEAICE_SALINITY option is obsolete'
0670 CALL PRINT_ERROR( msgBuf, myThid )
0671 WRITE(msgBuf,'(A)')
0672 & 'use SEAICE_VARIABLE_SALINITY instead.'
0673 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0674 errCount = errCount + 1
a98c4b8072 Ian *0675 #endif /* SEAICE_SALINITY */
0676
8377b8ee87 Mart*0677
8c1e355199 Mart*0678 #ifdef SEAICE_OLD_AND_BAD_DISCRETIZATION
0679 WRITE(msgBuf,'(A)')
0680 & 'SEAICE_OLD_AND_BAD_DISCRETIZATION option is obsolete'
0681 CALL PRINT_ERROR( msgBuf, myThid )
0682 WRITE(msgBuf,'(A)')
0683 & 'and has no effect.'
0684 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0685 errCount = errCount + 1
8c1e355199 Mart*0686 #endif /* SEAICE_OLD_AND_BAD_DISCRETIZATION */
0687
ae1fb66b64 Dimi*0688
fa64f6674f Jean*0689
0690
0691 IF ( usePW79thermodynamics ) THEN
95c7d150a4 Ed H*0692 #ifndef ALLOW_EXF
cee16b76ae Dimi*0693 WRITE(msgBuf,'(A)')
95c7d150a4 Ed H*0694 & 'need to define ALLOW_EXF'
835bd4f8b2 Jean*0695 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0696 errCount = errCount + 1
95c7d150a4 Ed H*0697 #else /* ALLOW_EXF */
0ba6d68576 Jean*0698 IF ( .NOT.useEXF ) THEN
0699 WRITE(msgBuf,'(A)')
0700 & 'S/R SEAICE_CHECK: need to set useEXF in data.pkg'
0701 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0702 errCount = errCount + 1
0ba6d68576 Jean*0703 ENDIF
6060ec2938 Dimi*0704 #ifndef ALLOW_ATM_TEMP
b0c32e7c62 Jean*0705 WRITE(msgBuf,'(2A)') 'S/R SEAICE_CHECK: ',
6060ec2938 Dimi*0706 & 'need to define pkg/exf ALLOW_ATM_TEMP'
835bd4f8b2 Jean*0707 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0708 errCount = errCount + 1
6060ec2938 Dimi*0709 #endif
0710 #ifndef ALLOW_DOWNWARD_RADIATION
b0c32e7c62 Jean*0711 WRITE(msgBuf,'(2A)') 'S/R SEAICE_CHECK: ',
6060ec2938 Dimi*0712 & 'need to define pkg/exf ALLOW_DOWNWARD_RADIATION'
835bd4f8b2 Jean*0713 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0714 errCount = errCount + 1
6060ec2938 Dimi*0715 #endif
454a842c16 Mart*0716 #ifdef SEAICE_EXTERNAL_FLUXES
4613bbc38b Dimi*0717 # if
b0c32e7c62 Jean*0718 WRITE(msgBuf,'(2A)') 'S/R SEAICE_CHECK: ',
4613bbc38b Dimi*0719 & 'need to set EXF_READ_EVAP or ALLOW_BULKFORMULAE in pkg/exf'
835bd4f8b2 Jean*0720 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0721 errCount = errCount + 1
4613bbc38b Dimi*0722 # endif /*
0723 IF ( SEAICE_waterAlbedo .NE. UNSET_RL ) THEN
0724 WRITE(msgBuf,'(A)')
0725 & 'SEAICE_waterAlbedo is not used with SEAICE_EXTERNAL_FLUXES'
3efa3cc6e1 Jean*0726 CALL PRINT_ERROR( msgBuf, myThid )
4613bbc38b Dimi*0727 WRITE(msgBuf,'(A)')
0728 & 'Set exf_albedo in data.exf EXF_NML_01 instead'
3efa3cc6e1 Jean*0729 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0730 errCount = errCount + 1
3c7d68edf4 Mart*0731 ENDIF
0732 IF ( lwfluxfile .NE. ' ' .AND. lwdownfile .EQ. ' ' ) THEN
0733 i = ILNBLNK(lwfluxfile)
0734 WRITE(msgBuf,'(A,A)')
0735 & 'lwFlux is read from lwfluxfile = ',lwfluxfile(1:i)
0736 CALL PRINT_ERROR( msgBuf, myThid )
8377b8ee87 Mart*0737 WRITE(msgBuf,'(2A)')
0738 & 'implying that lwdown = 0. For pkg/seaice to work ',
3c7d68edf4 Mart*0739 & 'properly lwdown should be read from lwdownfile!'
0740 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0741 errCount = errCount + 1
3c7d68edf4 Mart*0742 ENDIF
0743 IF ( swfluxfile .NE. ' ' .AND. swdownfile .EQ. ' ' ) THEN
0744 i = ILNBLNK(swfluxfile)
0745 WRITE(msgBuf,'(A,A)')
0746 & 'swFlux is read from swfluxfile = ',swfluxfile(1:i)
0747 CALL PRINT_ERROR( msgBuf, myThid )
8377b8ee87 Mart*0748 WRITE(msgBuf,'(2A)')
0749 & 'implying that swdown = 0. For pkg/seaice to work ',
3c7d68edf4 Mart*0750 & 'properly swdown should be read from swdownfile!'
0751 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0752 errCount = errCount + 1
4613bbc38b Dimi*0753 ENDIF
0754 #else /* if undef SEAICE_EXTERNAL_FLUXES */
454a842c16 Mart*0755 WRITE(msgBuf,'(3A)') 'S/R SEAICE_CHECK: ',
4613bbc38b Dimi*0756 & 'SEAICE_EXTERNAL_FLUXES is undefined, so we assume you ',
0757 & 'know what you are doing.'
454a842c16 Mart*0758 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
3efa3cc6e1 Jean*0759 & SQUEEZE_RIGHT, myThid )
454a842c16 Mart*0760 CALL PRINT_ERROR( msgBuf, myThid )
0761 WRITE(msgBuf,'(2A)') 'S/R SEAICE_CHECK: ',
0762 & 'Use S/R SEAICE_BUDGET_OCEAN to compute fluxes over ocean.'
0763 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
3efa3cc6e1 Jean*0764 & SQUEEZE_RIGHT, myThid )
454a842c16 Mart*0765 CALL PRINT_ERROR( msgBuf, myThid )
0766 #endif /* SEAICE_EXTERNAL_FLUXES */
358649780a Gael*0767 #ifndef SEAICE_CGRID
0768 IF ( .NOT.useAtmWind ) THEN
0769 WRITE(msgBuf,'(2A)') 'S/R SEAICE_CHECK: ',
0770 & 'needs pkg/exf useAtmWind to be true'
0771 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0772 errCount = errCount + 1
358649780a Gael*0773 ENDIF
0ba6d68576 Jean*0774 #endif
d2119dc372 Jean*0775 #ifndef EXF_SEAICE_FRACTION
0776 IF ( SEAICE_tauAreaObsRelax.GT.zeroRL ) THEN
0777 WRITE(msgBuf,'(2A)') 'S/R SEAICE_CHECK: ',
0778 & 'ice-area relaxation needs #define EXF_SEAICE_FRACTION'
0779 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0780 errCount = errCount + 1
d2119dc372 Jean*0781 ENDIF
0782 #endif
95c7d150a4 Ed H*0783 #endif /* ALLOW_EXF */
fa64f6674f Jean*0784
5650936ed9 Jean*0785 ENDIF
6060ec2938 Dimi*0786
210ee8461e jm-c 0787 IF ( ( SEAICEuseDynamics .OR. SEAICEuseFREEDRIFT ) .AND.
0788 & momStepping .AND. .NOT.SEAICEupdateOceanStress ) THEN
0789 WRITE(msgBuf,'(2A)') '** WARNING ** SEAICE_CHECK: ',
0790 & 'SEAICEupdateOceanStress= FALSE will'
0791 CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
0792 WRITE(msgBuf,'(2A)') '** WARNING ** SEAICE_CHECK: ',
0793 & 'give inconsistent Ocean surface stress'
0794 CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
0795 ENDIF
0796
45315406aa Mart*0797 #ifdef SEAICE_CGRID
f76143c445 Mart*0798 IF ( SEAICEuseDynamics ) THEN
8377b8ee87 Mart*0799
f76143c445 Mart*0800 IF ( SEAICEuseJFNK ) THEN
0801 IF ( OLx.LT.3 .OR. OLy.LT.3 ) THEN
0802 WRITE(msgBuf,'(A,A)')
0803 & 'SEAICE_CHECK: cannot use JFNK-solver with',
0804 & ' overlap (OLx,OLy) smaller than 3'
0805 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0806 errCount = errCount + 1
f76143c445 Mart*0807 ENDIF
0808 ELSE
0809 IF ( OLx.LT.2 .OR. OLy.LT.2 ) THEN
0810 WRITE(msgBuf,'(A,A)')
0811 & 'SEAICE_CHECK: cannot use dynamics solver with',
0812 & ' overlap (OLx,OLy) smaller than 2'
0813 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0814 errCount = errCount + 1
f76143c445 Mart*0815 ENDIF
0816 ENDIF
0817 IF ( SEAICE_OLx .GT. OLx-2 .OR. SEAICE_OLy .GT. OLy-2 .OR.
0818 & SEAICE_OLx .LT. 0 .OR. SEAICE_OLy .LT. 0 ) THEN
0819 WRITE(msgBuf,'(A,I2,A,I2)') 'S/R SEAICE_CHECK: SEAICE_OLx/y = ',
0820 & SEAICE_OLx, '/', SEAICE_OLy
0821 CALL PRINT_ERROR( msgBuf, myThid )
0822 WRITE(msgBuf,'(2A,I2,A,I2)')
0823 & 'S/R SEAICE_CHECK: SEAICE_OLx/y cannot be smaller than 0 ',
0824 & 'or larger than OLx/y-2 = ', OLx-2, '/', OLy-2
3efa3cc6e1 Jean*0825 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0826 errCount = errCount + 1
f76143c445 Mart*0827 ENDIF
0828 IF ( SEAICE_2ndOrderBC ) THEN
0829 IF ( OLx.LT.3 .OR. OLy.LT.3 ) THEN
0830 WRITE(msgBuf,'(A,A)')
0831 & 'SEAICE_CHECK: SEAICE_2ndOrderBC = .TRUE. requires',
0832 & ' an overlap (OLx,OLy) of at least 3'
0833 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0834 errCount = errCount + 1
f76143c445 Mart*0835 ENDIF
0836 IF ( SEAICE_OLx .GT. OLx-3 .OR. SEAICE_OLy .GT. OLy-3 ) THEN
0837 WRITE(msgBuf,'(A,I2,A,I2)')
210ee8461e jm-c 0838 & 'S/R SEAICE_CHECK: SEAICE_OLx/y = ',
f76143c445 Mart*0839 & SEAICE_OLx, '/', SEAICE_OLy
0840 CALL PRINT_ERROR( msgBuf, myThid )
0841 WRITE(msgBuf,'(2A,I2,A,I2)')
210ee8461e jm-c 0842 & 'S/R SEAICE_CHECK: with SEAICE_2ndOrderBC, SEAICE_OLx/y',
f76143c445 Mart*0843 & ' cannot be larger than OLx/y-3 = ', OLx-3, '/', OLy-3
0844 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0845 errCount = errCount + 1
f76143c445 Mart*0846 ENDIF
0847 ENDIF
4b491e6964 Mart*0848
dc26f158aa Mart*0849 # ifdef SEAICE_ALLOW_EVP
0850 IF ( SEAICEuseEVP ) THEN
0851 # ifdef ALLOW_AUTODIFF_TAMC
0852 IF ( SEAICEnEVPstarSteps.GT.nEVPstepMax ) THEN
8377b8ee87 Mart*0853 WRITE(msgBuf,'(2A)')
0854 & 'SEAICE_CHECK: need to set nEVPstepMax to >= ',
dc26f158aa Mart*0855 & 'SEAICEnEVPstarSteps'
0856 CALL PRINT_ERROR( msgBuf, myThid )
0857 WRITE(msgBuf,'(A,I4)')
0858 & 'SEAICE_CHECK: SEAICEnEVPstarSteps = ', SEAICEnEVPstarSteps
0859 CALL PRINT_ERROR( msgBuf, myThid )
0860 errCount = errCount + 1
0861 ENDIF
0862 # endif
0863 IF ( .NOT.(SEAICEuseEVPstar.OR.SEAICEuseEVPrev)
0864 & .AND. SEAICEnEVPstarSteps.NE.
0865 & INT(SEAICE_deltaTdyn/SEAICE_deltaTevp) ) THEN
8377b8ee87 Mart*0866 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: SEAICEnEVPstarSteps is ',
dc26f158aa Mart*0867 & 'set in namelist, but SEAICEuseEVPstar = .FALSE.'
0868 CALL PRINT_ERROR( msgBuf, myThid )
0869 errCount = errCount + 1
0870 ENDIF
0871 ENDIF
8377b8ee87 Mart*0872 # else /* SEAICE_ALLOW_EVP */
dc26f158aa Mart*0873 IF ( SEAICEuseEVP ) THEN
0874 WRITE(msgBuf,'(A)')
0875 & 'SEAICE_CHECK: SEAICEuseEVP = .TRUE., so EVP is turned on'
0876 CALL PRINT_ERROR( msgBuf, myThid )
0877 WRITE(msgBuf,'(A)')
0878 & 'SEAICE_CHECK: by setting appropriate runtime parameters,'
0879 CALL PRINT_ERROR( msgBuf, myThid )
8377b8ee87 Mart*0880 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: but cpp-flag ',
dc26f158aa Mart*0881 & 'SEAICE_ALLOW_EVP is not defined in SEAICE_OPTIONS.h'
0882 CALL PRINT_ERROR( msgBuf, myThid )
0883 errCount = errCount + 1
0884 ENDIF
8377b8ee87 Mart*0885 # endif /* SEAICE_ALLOW_EVP */
cf9fa44a59 Patr*0886
45315406aa Mart*0887 # ifdef SEAICE_ALLOW_EVP
dc26f158aa Mart*0888 IF ( SEAICEuseEVP .AND. (SEAICE_eccfr.NE.SEAICE_eccen) ) THEN
8377b8ee87 Mart*0889 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: SEAICEuseEVP = .TRUE., ',
dc26f158aa Mart*0890 & 'so EVP is turned on by setting appropriate'
0891 CALL PRINT_ERROR( msgBuf, myThid )
0892 WRITE(msgBuf,'(A,F5.2,A,F5.2,A)')
0893 & 'SEAICE_CHECK: runtime parameters, but SEAICE_eccfr(=',
0894 & SEAICE_eccfr , ')/=SEAICE_eccen(=', SEAICE_eccen, ')'
0895 CALL PRINT_ERROR( msgBuf, myThid )
8377b8ee87 Mart*0896 WRITE(msgBuf,'(2A)')'SEAICE_CHECK: implies a non-normal flow ',
dc26f158aa Mart*0897 & 'rule for the elliptical yield curve,'
0898 CALL PRINT_ERROR( msgBuf, myThid )
0899 WRITE(msgBuf,'(A)')
0900 & 'SEAICE_CHECK: which is not implemented for EVP.'
0901 CALL PRINT_ERROR( msgBuf, myThid )
0902 errCount = errCount + 1
0903 ENDIF
8377b8ee87 Mart*0904 IF ( SEAICEuseEVP .AND.
0905 & ( SEAICEuseTD .OR. SEAICEusePL .OR.
0906 & SEAICEuseMCE .OR. SEAICEuseMCS ) ) THEN
0907 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: SEAICEuseMCS, ',
dc26f158aa Mart*0908 & 'SEAICEuseTD, SEAICEusePL, or SEAICEuseMCE = .TRUE.,'
c512e371cc drin*0909 CALL PRINT_ERROR( msgBuf, myThid )
8377b8ee87 Mart*0910 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: and SEAICEuseEVP = ',
dc26f158aa Mart*0911 & '.TRUE., but these non-standard rheologies'
0912 CALL PRINT_ERROR( msgBuf, myThid )
0913 WRITE(msgBuf,'(A)')
0914 & 'SEAICE_CHECK: are not implemented for EVP'
0915 CALL PRINT_ERROR( msgBuf, myThid )
0916 errCount = errCount + 1
0917 ENDIF
45315406aa Mart*0918 # endif /* SEAICE_ALLOW_EVP */
c512e371cc drin*0919
143d9ce879 Dami*0920 #ifndef SEAICE_ALLOW_LSR_FLEX
0921 IF ( SEAICEuseLSRflex ) THEN
0922 WRITE(msgBuf,'(A)')
0923 & 'SEAICE_ALLOW_LSR_FLEX needed for SEAICEuseLSRflex'
0924 CALL PRINT_ERROR( msgBuf, myThid )
0925 errCount = errCount + 1
0926 ENDIF
0927 #endif
dc26f158aa Mart*0928
0929 ENDIF
45315406aa Mart*0930 #endif /* SEAICE_CGRID */
dc26f158aa Mart*0931
f82b316546 Jean*0932 #ifndef SEAICE_GLOBAL_3DIAG_SOLVER
0933 IF ( SEAICEuseMultiTileSolver ) THEN
0934 WRITE(msgBuf,'(A)')
0935 & 'SEAICE_CHECK: SEAICEuseMultiTileSolver = .TRUE.'
3efa3cc6e1 Jean*0936 CALL PRINT_ERROR( msgBuf, myThid )
f82b316546 Jean*0937 WRITE(msgBuf,'(2A)') ' but CPP-flag ',
0938 & 'SEAICE_GLOBAL_3DIAG_SOLVER is #undef in SEAICE_OPTIONS.h'
0939 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0940 errCount = errCount + 1
f82b316546 Jean*0941 ENDIF
0942 #endif /* SEAICE_GLOBAL_3DIAG_SOLVER */
0943
d37c75ccbc Mart*0944 #ifndef SEAICE_ALLOW_CLIPVELS
0945 IF ( SEAICE_clipVelocities ) THEN
8c02537f20 Jean*0946 WRITE(msgBuf,'(A)')
d37c75ccbc Mart*0947 & 'SEAICE_CHECK: SEAICE_clipVelocities = .TRUE.'
3efa3cc6e1 Jean*0948 CALL PRINT_ERROR( msgBuf, myThid )
8377b8ee87 Mart*0949 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: but cpp-flag ',
d37c75ccbc Mart*0950 & 'SEAICE_ALLOW_CLIPVELS is not defined in SEAICE_OPTIONS.h'
3efa3cc6e1 Jean*0951 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0952 errCount = errCount + 1
d37c75ccbc Mart*0953 ENDIF
0954 #endif /* SEAICE_ALLOW_CLIPVELS */
0955
fc27138d73 Mart*0956 #ifndef SEAICE_ALLOW_CLIPZETA
0957 IF ( SEAICE_evpDampC .GT. 0. _d 0 .OR.
0958 & SEAICE_zetaMin .GT. 0. _d 0 ) THEN
8377b8ee87 Mart*0959 WRITE(msgBuf,'(2A)')
0960 & 'SEAICE_CHECK: SEAICE_evpDampC and/or SEAICE_zetaMin ',
fc27138d73 Mart*0961 & 'are set in data.seaice'
3efa3cc6e1 Jean*0962 CALL PRINT_ERROR( msgBuf, myThid )
8377b8ee87 Mart*0963 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: but cpp-flag ',
fc27138d73 Mart*0964 & 'SEAICE_ALLOW_CLIPZETA is not defined in SEAICE_OPTIONS.h'
3efa3cc6e1 Jean*0965 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0966 errCount = errCount + 1
fc27138d73 Mart*0967 ENDIF
0968 #endif /* SEAICE_ALLOW_CLIPZETA */
0969
c512e371cc drin*0970 #ifndef SEAICE_ALLOW_TEM
dadd13178c Mart*0971 IF ( SEAICEuseTEM ) THEN
8377b8ee87 Mart*0972 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: SEAICEuseTEM requires ',
c512e371cc drin*0973 & 'that SEAICE_ALLOW_TEM is defined.'
dadd13178c Mart*0974 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0975 errCount = errCount + 1
c512e371cc drin*0976 ENDIF
0977 #endif
0978 #ifndef SEAICE_ALLOW_MCE
0979 IF ( SEAICEuseMCE ) THEN
8377b8ee87 Mart*0980 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: SEAICEuseMCE requires ',
c512e371cc drin*0981 & 'that SEAICE_ALLOW_MCE is defined.'
0982 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0983 errCount = errCount + 1
c512e371cc drin*0984 ENDIF
0985 #endif
0986 #ifndef SEAICE_ALLOW_MCS
0987 IF ( SEAICEuseMCS ) THEN
8377b8ee87 Mart*0988 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: SEAICEuseMCS requires ',
c512e371cc drin*0989 & 'that SEAICE_ALLOW_MCS is defined.'
0990 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0991 errCount = errCount + 1
c512e371cc drin*0992 ENDIF
0993 #endif
0994 #ifndef SEAICE_ALLOW_TEARDROP
0995 IF (SEAICEuseTD ) THEN
8377b8ee87 Mart*0996 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: SEAICEuseTD requires ',
c512e371cc drin*0997 & 'that SEAICE_ALLOW_TEARDROP is defined.'
0998 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*0999 errCount = errCount + 1
c512e371cc drin*1000 ENDIF
1001 IF ( SEAICEusePL ) THEN
8377b8ee87 Mart*1002 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: SEAICEusePL requires ',
c512e371cc drin*1003 & 'that SEAICE_ALLOW_TEARDROP is defined.'
dadd13178c Mart*1004 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*1005 errCount = errCount + 1
dadd13178c Mart*1006 ENDIF
1007 #endif
06de6b2e81 Mart*1008
8377b8ee87 Mart*1009 i = 0
1010 IF ( SEAICEuseTEM ) i = i + 1
1011 IF ( SEAICEuseMCS ) i = i + 1
1012 IF ( SEAICEuseMCE ) i = i + 1
1013 IF ( SEAICEuseTD ) i = i + 1
1014 IF ( SEAICEusePL ) i = i + 1
1015 IF ( i .GT. 1 ) THEN
1016 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: More than one rheology ',
1017 & 'flag = .TRUE.,'
1018 CALL PRINT_ERROR( msgBuf, myThid )
1019 WRITE(msgBuf,'(A)')
1020 & 'SEAICE_CHECK: but only one can be .TRUE. at a time.'
1021 CALL PRINT_ERROR( msgBuf, myThid )
1022 errCount = errCount + 1
1023 ENDIF
1024
45315406aa Mart*1025 #ifdef SEAICE_BGRID_DYNAMICS
8377b8ee87 Mart*1026 IF ( i .GE. 1 ) THEN
1027 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: non-default rheologies ',
c512e371cc drin*1028 & 'require that SEAICE_CGRID is defined.'
1029 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*1030 errCount = errCount + 1
c512e371cc drin*1031 ENDIF
1032
1033 # ifdef SEAICE_TEST_ICE_STRESS_1
06de6b2e81 Mart*1034 WRITE(msgBuf,'(A)')
1035 & 'SEAICE_CHECK: Only relevant for B-grid:'
1036 CALL PRINT_ERROR( msgBuf, myThid )
1037 WRITE(msgBuf,'(A)')
1038 & 'SEAICE_CHECK: SEAICE_TEST_ICE_STRESS_1 is replaced by'
1039 CALL PRINT_ERROR( msgBuf, myThid )
1040 WRITE(msgBuf,'(A)')
1041 & 'SEAICE_CHECK: SEAICE_BICE_STRESS (defined by default)'
1042 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*1043 errCount = errCount + 1
c512e371cc drin*1044 # endif /* SEAICE_TEST_ICE_STRESS_1 */
b0c32e7c62 Jean*1045 IF ( SEAICEuseDYNAMICS.AND.useCubedSphereExchange ) THEN
1046 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: ',
1047 & 'B-grid dynamics not working on Cubed-Sphere grid'
1048 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*1049 errCount = errCount + 1
b0c32e7c62 Jean*1050 ENDIF
1051 IF ( SEAICEuseDYNAMICS.AND.useOBCS ) THEN
1052 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: ',
1053 & 'Open-Boundaries not implemented in B-grid dynamics'
1054 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*1055
b0c32e7c62 Jean*1056 ENDIF
45315406aa Mart*1057 #endif /* SEAICE_BGRID_DYNAMICS */
06de6b2e81 Mart*1058
f5ec4d1505 Gael*1059
1060 #ifndef SEAICE_ALLOW_FREEDRIFT
1061 IF (SEAICEuseFREEDRIFT) THEN
3de1dea93d Jean*1062 WRITE(msgBuf,'(A)')
1063 & 'need to #define SEAICE_ALLOW_FREEDRIFT for SEAICEuseFREEDRIFT'
1064 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*1065 errCount = errCount + 1
3de1dea93d Jean*1066 ENDIF
d63f6ccbee Jean*1067 IF ( LSR_mixIniGuess.GE.0 ) THEN
3de1dea93d Jean*1068 WRITE(msgBuf,'(A)')
1069 & 'need to #define SEAICE_ALLOW_FREEDRIFT to use LSR_mixIniGuess'
1070 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*1071 errCount = errCount + 1
f5ec4d1505 Gael*1072 ENDIF
1073 #endif
1074
a7a2228515 Jean*1075 #ifndef SEAICE_VARIABLE_SALINITY
1076 IF ( SEAICEadvSalt ) THEN
1077 WRITE(msgBuf,'(A)')
1078 & 'SEAICE_CHECK: SEAICEadvSalt = .TRUE. but cpp-flag'
3efa3cc6e1 Jean*1079 CALL PRINT_ERROR( msgBuf, myThid )
8377b8ee87 Mart*1080 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: ',
a7a2228515 Jean*1081 & 'SEAICE_VARIABLE_SALINITY is undef in SEAICE_OPTIONS.h'
3efa3cc6e1 Jean*1082 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*1083 errCount = errCount + 1
a7a2228515 Jean*1084 ENDIF
1085 #endif /* SEAICE_VARIABLE_SALINITY */
1086
3ece2f30f9 Mart*1087 #ifdef SEAICE_ALLOW_JFNK
1088 IF ( SEAICEuseJFNK ) THEN
2e75855dde Mart*1089 IF ( JFNKres_t.NE.UNSET_RL .AND. JFNKres_tFac.NE.UNSET_RL) THEN
1090 WRITE(msgBuf,'(3A)') 'S/R SEAICE_CHECK: JFNKres_t and ',
1091 & 'JFNKres_tFac are both set, so that JFNKres_t will be'
1092 CALL PRINT_ERROR( msgBuf, myThid )
1093 WRITE(msgBuf,'(3A)') 'S/R SEAICE_CHECK: ',
1094 & 'overwritten by JFNKres_tFac*JFNKresidual ',
1095 & 'in each initial Newton iteration.'
1096 CALL PRINT_ERROR( msgBuf, myThid )
5650936ed9 Jean*1097 WRITE(msgBuf,'(2A)')
2e75855dde Mart*1098 & 'S/R SEAICE_CHECK: For safety we stop here. ',
1099 & 'Please unset one of the two parameters.'
1100 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*1101 errCount = errCount + 1
2e75855dde Mart*1102 ELSEIF (JFNKres_t.EQ.UNSET_RL.AND.JFNKres_tFac.EQ.UNSET_RL) THEN
3ece2f30f9 Mart*1103 WRITE(msgBuf,'(2A)') 'S/R SEAICE_CHECK: need to specify ',
2e75855dde Mart*1104 & 'JFNKres_t or JFNKres_tFac for SEAICEuseJFNK=.TRUE.'
3efa3cc6e1 Jean*1105 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*1106 errCount = errCount + 1
3ece2f30f9 Mart*1107 ENDIF
1108 ENDIF
1109 IF ( SEAICEuseJFNK .AND. SEAICEuseEVP ) THEN
f82b316546 Jean*1110 WRITE(msgBuf,'(2A)')
3ece2f30f9 Mart*1111 & 'S/R SEAICE_CHECK: cannot have both SEAICEuseJFNK=.TRUE.',
1112 & 'and SEAICEuseEVP=.TRUE. (i.e. SEAICE_deltaTevp > 0)'
3efa3cc6e1 Jean*1113 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*1114 errCount = errCount + 1
3ece2f30f9 Mart*1115 ENDIF
1116 #else
1117 IF ( SEAICEuseJFNK ) THEN
1118 WRITE(msgBuf,'(A)')
1119 & 'SEAICE_CHECK: SEAICEuseJFNK = .TRUE. but cpp-flag'
3efa3cc6e1 Jean*1120 CALL PRINT_ERROR( msgBuf, myThid )
8377b8ee87 Mart*1121 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: ',
3ece2f30f9 Mart*1122 & 'SEAICE_ALLOW_JFNK is undef in SEAICE_OPTIONS.h'
3efa3cc6e1 Jean*1123 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*1124 errCount = errCount + 1
3ece2f30f9 Mart*1125 ENDIF
1126 #endif /* SEAICE_ALLOW_JFNK */
3f15753c22 Mart*1127 #ifndef SEAICE_ALLOW_KRYLOV
1128 IF ( SEAICEuseKrylov ) THEN
1129 WRITE(msgBuf,'(A)')
1130 & 'SEAICE_CHECK: SEAICEuseKRYLOV = .TRUE. but cpp-flag'
1131 CALL PRINT_ERROR( msgBuf, myThid )
8377b8ee87 Mart*1132 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: ',
3f15753c22 Mart*1133 & 'SEAICE_ALLOW_KRYLOV is undef in SEAICE_OPTIONS.h'
1134 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*1135 errCount = errCount + 1
3f15753c22 Mart*1136 ENDIF
1137 #endif /* SEAICE_ALLOW_KRYLOV */
3ece2f30f9 Mart*1138
702b797d9b Mart*1139 IF ( SEAICEuseDynamics .AND. .NOT.SEAICEuseJFNK ) THEN
e501eee760 Mart*1140 IF ( SEAICEuseBDF2 ) THEN
8377b8ee87 Mart*1141 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: SEAICEuseBDF2 = .TRUE. ',
6cbc659de0 Mart*1142 & 'only allowed with SEAICEuseJFNK = .TRUE.'
dc66f404d9 Mart*1143 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*1144 errCount = errCount + 1
6cbc659de0 Mart*1145 ENDIF
1146 IF ( SEAICEuseIMEX ) THEN
8377b8ee87 Mart*1147 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: SEAICEuseIMEX = .TRUE. ',
6cbc659de0 Mart*1148 & 'only allowed with SEAICEuseJFNK = .TRUE.'
dc66f404d9 Mart*1149 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*1150 errCount = errCount + 1
6cbc659de0 Mart*1151 ENDIF
1152 ENDIF
702b797d9b Mart*1153 IF ( SEAICEuseIMEX ) THEN
8377b8ee87 Mart*1154 WRITE(msgBuf,'(3A)') '** WARNING ** SEAICE_CHECK: ',
1155 & 'SEAICEuseIMEX = .TRUE. ',
702b797d9b Mart*1156 & 'currently has no effect, because the code is missing'
1157 CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
1158 ENDIF
6cbc659de0 Mart*1159
1160 IF ( .NOT.(SEAICEetaZmethod.EQ.0.OR.SEAICEetaZmethod.EQ.3) ) THEN
1161 WRITE(msgBuf,'(A,I2)')
1162 & 'SEAICE_CHECK: SEAICEetaZmethod = ', SEAICEetaZmethod
1163 CALL PRINT_ERROR( msgBuf, myThid )
8377b8ee87 Mart*1164 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: ',
5650936ed9 Jean*1165 & 'is no longer allowed; allowed values are 0 and 3'
6cbc659de0 Mart*1166 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*1167 errCount = errCount + 1
dc66f404d9 Mart*1168 ENDIF
1169
0adbdb4edd Mart*1170 IF ( SEAICEpressReplFac .LT. 0. _d 0 .OR.
1171 & SEAICEpressReplFac .GT. 1. _d 0 ) THEN
5bb179ddc2 Mart*1172 WRITE(msgBuf,'(A,F5.2)')
0adbdb4edd Mart*1173 & 'SEAICE_CHECK: SEAICEpressReplFac = ', SEAICEpressReplFac
1174 CALL PRINT_ERROR( msgBuf, myThid )
8377b8ee87 Mart*1175 WRITE(msgBuf,'(A)') 'SEAICE_CHECK: cannot be < 0 or > 1'
0adbdb4edd Mart*1176 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*1177 errCount = errCount + 1
0adbdb4edd Mart*1178 ENDIF
1179
5867b94c2f Mart*1180
1181 IF ( SEAICEdWatMin .LT. 0. _d 0 ) THEN
1182 WRITE(msgBuf,'(A,A,F5.2,A)') 'SEAICE_CHECK: ',
1183 & 'SEAICEdWatMin (= ', SEAICEdWatMin, ') may not be < 0.'
1184 CALL PRINT_ERROR( msgBuf , myThid)
dc26f158aa Mart*1185 errCount = errCount + 1
5867b94c2f Mart*1186 ENDIF
1187 IF ( SEAICE_waterDrag .EQ. 0. _d 0
1188 & .AND. SEAICEdWatMin .GT. 0. _d 0) THEN
1189 WRITE(msgBuf,'(A,A,F5.2)') '** WARNING ** SEAICE_CHECK: ',
1190 & 'SEAICE_waterDrag = ', SEAICE_waterDrag
1191 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
1192 & SQUEEZE_RIGHT, myThid )
1193 WRITE(msgBuf,'(A,A,F5.2)') '** WARNING ** SEAICE_CHECK: ',
1194 & 'but SEAICEdWatMin = ', SEAICEdWatMin
1195 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
1196 & SQUEEZE_RIGHT, myThid )
1197 WRITE(msgBuf,'(A,A)') '** WARNING ** SEAICE_CHECK: ',
1198 & 'so that the ice-ocean drag will be non-zero'
1199 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
1200 & SQUEEZE_RIGHT, myThid )
1201 ENDIF
1202 #ifdef SEAICE_ALLOW_FREEDRIFT
1203 IF ( SEAICE_waterDrag_South .EQ. 0. _d 0
1204 & .OR. SEAICE_waterDrag .EQ. 0. _d 0 ) THEN
1205 WRITE(msgBuf,'(A,A,A)') 'SEAICE_CHECK: ',
1206 & 'When SEAICE_ALLOW_FREEDRIFT is defined, ',
1207 & 'SEAICE_waterDrag or SEAICE_waterDragSouth may not be zero.'
1208 CALL PRINT_ERROR( msgBuf , myThid)
dc26f158aa Mart*1209 errCount = errCount + 1
5867b94c2f Mart*1210 ENDIF
1211 #endif /* SEAICE_ALLOW_FREEDRIFT */
1212
3f15753c22 Mart*1213 #ifndef SEAICE_ALLOW_BOTTOMDRAG
1214 IF ( SEAICEbasalDragK2 .GT. 0. _d 0 ) THEN
5bb179ddc2 Mart*1215 WRITE(msgBuf,'(A,E12.5)')
3f15753c22 Mart*1216 & 'SEAICE_CHECK: SEAICEbasalDragK2 = ', SEAICEbasalDragK2
1217 CALL PRINT_ERROR( msgBuf, myThid )
8377b8ee87 Mart*1218 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: is greater than 0, ',
3f15753c22 Mart*1219 & 'but SEAICE_ALLOW_BOTTOMDRAG is not defined'
1220 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*1221 errCount = errCount + 1
3f15753c22 Mart*1222 ENDIF
1223 #endif /* SEAICE_ALLOW_BOTTOMDRAG */
1224
5bb179ddc2 Mart*1225 #ifndef SEAICE_ALLOW_SIDEDRAG
1226 IF ( SEAICEsideDrag .NE. 0. _d 0 ) THEN
1227 WRITE(msgBuf,'(A,E12.5,A)')
1228 & 'SEAICE_CHECK: SEAICEsideDrag = ', SEAICEsideDrag,
1229 & ' is set, but SEAICE_ALLOW_SIDEDRAG is not defined'
1230 CALL PRINT_ERROR( msgBuf, myThid )
1231 errCount = errCount + 1
1232 ENDIF
1233 IF ( uCoastLineFile .NE. ' ' ) THEN
1234 i = ILNBLNK(uCoastLineFile)
1235 WRITE(msgBuf,'(3A)')
1236 & 'SEAICE_CHECK: uCoastLineFile = ', uCoastLineFile(1:i),
1237 & ' is set, but SEAICE_ALLOW_SIDEDRAG is not defined'
1238 CALL PRINT_ERROR( msgBuf, myThid )
1239 errCount = errCount + 1
1240 ENDIF
1241 IF( vCoastLineFile .NE. ' ' ) THEN
1242 i = ILNBLNK(vCoastLineFile)
1243 WRITE(msgBuf,'(3A)')
1244 & 'SEAICE_CHECK: vCoastLineFile = ', vCoastLineFile(1:i),
1245 & ' is set, but SEAICE_ALLOW_SIDEDRAG is not defined'
1246 CALL PRINT_ERROR( msgBuf, myThid )
1247 errCount = errCount + 1
1248 ENDIF
1249 #endif
1250
9e44a61c99 Mart*1251 #ifdef SEAICE_ITD
1252
1253
1254
1255
1256 IF ( useThSice ) THEN
8377b8ee87 Mart*1257 WRITE(msgBuf,'(2A)') '** WARNING ** SEAICE_CHECK: ',
9e44a61c99 Mart*1258 & 'SEAICE_ITD is defined, but useThSice = .TRUE.'
1259 CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
1260 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
1261 & SQUEEZE_RIGHT, myThid )
8377b8ee87 Mart*1262 WRITE(msgBuf,'(2A)') '** WARNING ** SEAICE_CHECK: ',
9e44a61c99 Mart*1263 & 'avoids the ice thickness distribution code.'
1264 CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
1265 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
1266 & SQUEEZE_RIGHT, myThid )
8377b8ee87 Mart*1267 WRITE(msgBuf,'(2A)') '** WARNING ** SEAICE_CHECK: ',
fa64f6674f Jean*1268 & 'If you want the ITD code, set useThSice=.FALSE.'
9e44a61c99 Mart*1269 CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid )
1270 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
1271 & SQUEEZE_RIGHT, myThid )
1272 ENDIF
e0fa1cecbf Mart*1273
1274 IF ( .NOT.SEAICEmultiDimAdvection ) THEN
1275 WRITE(msgBuf,'(A,L1)')
1276 & 'SEAICE_CHECK: SEAICEmultiDimAdvection = ',
1277 & SEAICEmultiDimAdvection
1278 CALL PRINT_ERROR( msgBuf, myThid )
8377b8ee87 Mart*1279 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: is not allowed when ',
e0fa1cecbf Mart*1280 & 'SEAICE_ITD is defined'
1281 CALL PRINT_ERROR( msgBuf, myThid )
8377b8ee87 Mart*1282 WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: use a multiDimAdvection ',
e0fa1cecbf Mart*1283 & 'scheme instead'
1284 CALL PRINT_ERROR( msgBuf, myThid )
dc26f158aa Mart*1285 errCount = errCount + 1
e0fa1cecbf Mart*1286 ENDIF
9e44a61c99 Mart*1287 #endif
1288
2b959ba38e Mart*1289 #ifdef ALLOW_SEAICE_COST_SMR_AREA
8377b8ee87 Mart*1290 WRITE(msgBuf,'(2A)')
1291 & 'SEAICE_CHECK: cpp-flag ALLOW_SEAICE_COST_SMR_AREA ',
2b959ba38e Mart*1292 & 'is not allowed anymore.'
1293 CALL PRINT_ERROR( msgBuf, myThid )
1294 WRITE(msgBuf,'(A)')
1295 & 'SEAICE_CHECK: Use pkg/ecco''s generic cost function instead.'
1296 CALL PRINT_ERROR( msgBuf, myThid )
1297 errCount = errCount + 1
1298 #endif
1299
dc26f158aa Mart*1300 IF ( errCount .GE. 1 ) THEN
8377b8ee87 Mart*1301 WRITE(msgBuf,'(A,I3,2A)') 'SEAICE_CHECK: ', errCount,
1302 & ' parameter/CPP-flag combinations are',
1303 & ' inconsistent or incomplete'
dc26f158aa Mart*1304 CALL PRINT_ERROR( msgBuf, myThid )
1305 WRITE(msgBuf,'(A,I3,A)')
1306 & 'SEAICE_CHECK: detected', errCount,' fatal error(s)'
1307 CALL PRINT_ERROR( msgBuf, myThid )
1308 CALL ALL_PROC_DIE( 0 )
1309 STOP 'ABNORMAL END: S/R SEAICE_CHECK'
1310 ENDIF
1311
835bd4f8b2 Jean*1312 _END_MASTER(myThid)
1313
1314 RETURN
1315 END