/[MITgcm]/MITgcm/model/src/config_check.F
ViewVC logotype

Contents of /MITgcm/model/src/config_check.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.73 - (show annotations) (download)
Tue Jul 30 18:51:01 2013 UTC (10 years, 10 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64m, checkpoint64l
Changes since 1.72: +25 -2 lines
add run-time parameters for isotropic 3-D Smagorinsky (Smag3D)

1 C $Header: /u/gcmpack/MITgcm/model/src/config_check.F,v 1.72 2012/12/30 18:32:52 jmc Exp $
2 C $Name: $
3
4 #include "PACKAGES_CONFIG.h"
5 #include "CPP_OPTIONS.h"
6 #ifdef ALLOW_MOM_COMMON
7 # include "MOM_COMMON_OPTIONS.h"
8 #endif
9
10 CBOP
11 C !ROUTINE: CONFIG_CHECK
12 C !INTERFACE:
13 SUBROUTINE CONFIG_CHECK( myThid )
14 C !DESCRIPTION: \bv
15 C *=========================================================*
16 C | SUBROUTINE CONFIG_CHECK
17 C | o Check model parameter settings.
18 C *=========================================================*
19 C | This routine help to prevent the use of parameters
20 C | that are not compatible with the model configuration.
21 C *=========================================================*
22 C \ev
23
24 C !USES:
25 IMPLICIT NONE
26 C === Global variables ===
27 #include "SIZE.h"
28 #include "EEPARAMS.h"
29 #include "PARAMS.h"
30
31 C !INPUT/OUTPUT PARAMETERS:
32 C === Routine arguments ===
33 C myThid - Number of this instances of CONFIG_CHECK
34 INTEGER myThid
35 CEndOfInterface
36
37 C !LOCAL VARIABLES:
38 C == Local variables ==
39 C msgBuf :: Informational/error message buffer
40 CHARACTER*(MAX_LEN_MBUF) msgBuf
41 INTEGER errCount
42 CEOP
43
44 _BEGIN_MASTER(myThid)
45 WRITE(msgBuf,'(A)')
46 &'// ======================================================='
47 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
48 & SQUEEZE_RIGHT, myThid )
49 WRITE(msgBuf,'(A)') '// Check Model config. (CONFIG_CHECK):'
50 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
51 & SQUEEZE_RIGHT, myThid )
52 _END_MASTER(myThid)
53
54 C-- MPI + multi-threads: seems to be OK to let master-thread check & stop
55 C (as long as all procs finish cleanly by calling ALL_PROC_DIE)
56 _BEGIN_MASTER(myThid)
57 errCount = 0
58
59 C- check that CPP option is "defined" when running-flag parameter is on:
60
61 C o If diffKrFile is set, then we should make sure the corresponing
62 C code is being compiled
63 #ifndef ALLOW_3D_DIFFKR
64 IF (diffKrFile.NE.' ') THEN
65 WRITE(msgBuf,'(A)')
66 & 'CONFIG_CHECK: diffKrFile is set but never used.'
67 CALL PRINT_ERROR( msgBuf, myThid )
68 WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
69 & 'Re-compile with: "#define ALLOW_3D_DIFFKR"'
70 CALL PRINT_ERROR( msgBuf, myThid )
71 errCount = errCount + 1
72 ENDIF
73 #endif
74
75 #ifndef ALLOW_SMAG_3D
76 IF ( useSmag3D ) THEN
77 WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
78 & 'Cannot set useSmag3D=TRUE when compiled with'
79 CALL PRINT_ERROR( msgBuf, myThid )
80 WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
81 & '"#undef ALLOW_SMAG_3D" in MOM_COMMON_OPTIONS.h'
82 CALL PRINT_ERROR( msgBuf, myThid )
83 errCount = errCount + 1
84 ENDIF
85 #endif
86
87 #ifndef ALLOW_NONHYDROSTATIC
88 IF (use3Dsolver) THEN
89 WRITE(msgBuf,'(A)')
90 & 'CONFIG_CHECK: #undef ALLOW_NONHYDROSTATIC and'
91 CALL PRINT_ERROR( msgBuf, myThid )
92 IF ( implicitIntGravWave ) WRITE(msgBuf,'(A)')
93 & 'CONFIG_CHECK: implicitIntGravWave is TRUE'
94 IF ( nonHydrostatic ) WRITE(msgBuf,'(A)')
95 & 'CONFIG_CHECK: nonHydrostatic is TRUE'
96 CALL PRINT_ERROR( msgBuf, myThid )
97 errCount = errCount + 1
98 ENDIF
99 #endif
100
101 #ifndef ALLOW_ADAMSBASHFORTH_3
102 IF ( alph_AB.NE.UNSET_RL .OR. beta_AB.NE.UNSET_RL ) THEN
103 WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
104 & '#undef ALLOW_ADAMSBASHFORTH_3 but alph_AB,beta_AB'
105 CALL PRINT_ERROR( msgBuf, myThid )
106 WRITE(msgBuf,'(A,1P2E20.7)')
107 & 'CONFIG_CHECK: are set to:',alph_AB,beta_AB
108 CALL PRINT_ERROR( msgBuf, myThid )
109 errCount = errCount + 1
110 ENDIF
111 #endif
112
113 #ifndef INCLUDE_IMPLVERTADV_CODE
114 IF ( momImplVertAdv ) THEN
115 WRITE(msgBuf,'(A)')
116 & 'CONFIG_CHECK: #undef INCLUDE_IMPLVERTADV_CODE'
117 CALL PRINT_ERROR( msgBuf, myThid )
118 WRITE(msgBuf,'(A)')
119 & 'CONFIG_CHECK: but momImplVertAdv is TRUE'
120 CALL PRINT_ERROR( msgBuf, myThid )
121 errCount = errCount + 1
122 ENDIF
123 IF ( tempImplVertAdv ) THEN
124 WRITE(msgBuf,'(A)')
125 & 'CONFIG_CHECK: #undef INCLUDE_IMPLVERTADV_CODE'
126 CALL PRINT_ERROR( msgBuf, myThid )
127 WRITE(msgBuf,'(A)')
128 & 'CONFIG_CHECK: but tempImplVertAdv is TRUE'
129 CALL PRINT_ERROR( msgBuf, myThid )
130 errCount = errCount + 1
131 ENDIF
132 IF ( saltImplVertAdv ) THEN
133 WRITE(msgBuf,'(A)')
134 & 'CONFIG_CHECK: #undef INCLUDE_IMPLVERTADV_CODE'
135 CALL PRINT_ERROR( msgBuf, myThid )
136 WRITE(msgBuf,'(A)')
137 & 'CONFIG_CHECK: but saltImplVertAdv is TRUE'
138 CALL PRINT_ERROR( msgBuf, myThid )
139 errCount = errCount + 1
140 ENDIF
141 IF ( dTtracerLev(1).NE.dTtracerLev(Nr) .AND. implicitDiffusion
142 & .AND. ( saltStepping .OR. tempStepping .OR. usePTRACERS )
143 & ) THEN
144 WRITE(msgBuf,'(A)')
145 & 'CONFIG_CHECK: #undef INCLUDE_IMPLVERTADV_CODE'
146 CALL PRINT_ERROR( msgBuf, myThid )
147 WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
148 & 'but implicitDiffusion=T with non-uniform dTtracerLev'
149 CALL PRINT_ERROR( msgBuf, myThid )
150 errCount = errCount + 1
151 ENDIF
152 #endif
153
154 #ifdef ALLOW_AUTODIFF_TAMC
155 IF ( momImplVertAdv ) THEN
156 WRITE(msgBuf,'(A)')
157 & 'CONFIG_CHECK: momImplVertAdv is not yet'
158 CALL PRINT_ERROR( msgBuf, myThid )
159 WRITE(msgBuf,'(A)')
160 & 'CONFIG_CHECK: supported in adjoint mode'
161 CALL PRINT_ERROR( msgBuf, myThid )
162 errCount = errCount + 1
163 ENDIF
164 #endif
165
166 #ifdef ALLOW_DEPTH_CONTROL
167 IF ( useOBCS ) THEN
168 WRITE(msgBuf,'(A)')
169 & 'CONFIG_CHECK: DEPTH_CONTROL code not compatible with OBCS'
170 CALL PRINT_ERROR( msgBuf, myThid )
171 errCount = errCount + 1
172 ENDIF
173 #endif
174
175 #ifndef EXACT_CONSERV
176 IF (exactConserv) THEN
177 WRITE(msgBuf,'(A)')
178 & 'CONFIG_CHECK: #undef EXACT_CONSERV and'
179 CALL PRINT_ERROR( msgBuf, myThid )
180 WRITE(msgBuf,'(A)')
181 & 'CONFIG_CHECK: exactConserv is TRUE'
182 CALL PRINT_ERROR( msgBuf, myThid )
183 errCount = errCount + 1
184 ENDIF
185 #endif
186
187 #ifndef NONLIN_FRSURF
188 IF (nonlinFreeSurf.NE.0) THEN
189 WRITE(msgBuf,'(A)')
190 & 'CONFIG_CHECK: #undef NONLIN_FRSURF and'
191 CALL PRINT_ERROR( msgBuf, myThid )
192 WRITE(msgBuf,'(A)')
193 & 'CONFIG_CHECK: nonlinFreeSurf is non-zero'
194 CALL PRINT_ERROR( msgBuf, myThid )
195 errCount = errCount + 1
196 ENDIF
197 #endif
198
199 #ifndef NONLIN_FRSURF
200 IF (select_rStar .NE. 0) THEN
201 WRITE(msgBuf,'(A)')
202 & 'CONFIG_CHECK: rStar is part of NonLin-FS '
203 CALL PRINT_ERROR( msgBuf, myThid )
204 WRITE(msgBuf,'(A)')
205 & 'CONFIG_CHECK: ==> set #define NONLIN_FRSURF to use it'
206 CALL PRINT_ERROR( msgBuf, myThid )
207 errCount = errCount + 1
208 ENDIF
209 #endif /* NONLIN_FRSURF */
210
211 #ifdef DISABLE_RSTAR_CODE
212 IF ( select_rStar.NE.0 ) THEN
213 WRITE(msgBuf,'(A)')
214 & 'CONFIG_CHECK: rStar code disable (DISABLE_RSTAR_CODE defined)'
215 CALL PRINT_ERROR( msgBuf, myThid )
216 WRITE(msgBuf,'(A)')
217 & 'CONFIG_CHECK: ==> set #undef DISABLE_RSTAR_CODE to use it'
218 CALL PRINT_ERROR( msgBuf, myThid )
219 errCount = errCount + 1
220 ENDIF
221 #endif /* DISABLE_RSTAR_CODE */
222
223 #ifdef DISABLE_SIGMA_CODE
224 IF ( selectSigmaCoord.NE.0 ) THEN
225 WRITE(msgBuf,'(A)')
226 & 'CONFIG_CHECK: Sigma code disable (DISABLE_SIGMA_CODE defined)'
227 CALL PRINT_ERROR( msgBuf, myThid )
228 WRITE(msgBuf,'(A)')
229 & 'CONFIG_CHECK: ==> set #undef DISABLE_SIGMA_CODE to use it'
230 CALL PRINT_ERROR( msgBuf, myThid )
231 errCount = errCount + 1
232 ENDIF
233 #endif /* DISABLE_SIGMA_CODE */
234
235 #ifdef USE_NATURAL_BCS
236 WRITE(msgBuf,'(A)')
237 & 'CONFIG_CHECK: USE_NATURAL_BCS option has been replaced'
238 CALL PRINT_ERROR( msgBuf, myThid )
239 WRITE(msgBuf,'(A)')
240 & 'CONFIG_CHECK: by useRealFreshWaterFlux=TRUE in data file'
241 CALL PRINT_ERROR( msgBuf, myThid )
242 errCount = errCount + 1
243 #endif
244
245 #ifndef ALLOW_ADDFLUID
246 IF ( selectAddFluid.NE.0 ) THEN
247 WRITE(msgBuf,'(A)')
248 & 'CONFIG_CHECK: #undef ALLOW_ADDFLUID (CPP_OPTIONS.h) and'
249 CALL PRINT_ERROR( msgBuf, myThid )
250 WRITE(msgBuf,'(A,I4,A)') 'CONFIG_CHECK: selectAddFluid=',
251 & selectAddFluid, ' is not zero'
252 CALL PRINT_ERROR( msgBuf, myThid )
253 errCount = errCount + 1
254 ENDIF
255 #endif /* ALLOW_ADDFLUID */
256
257 C o If pLoadFile is set, then we should make sure the corresponing
258 C code is being compiled
259 #ifndef ATMOSPHERIC_LOADING
260 IF (pLoadFile.NE.' ') THEN
261 WRITE(msgBuf,'(A)')
262 & 'CONFIG_CHECK: pLoadFile is set but you have not'
263 CALL PRINT_ERROR( msgBuf, myThid )
264 WRITE(msgBuf,'(A)')
265 & ' compiled the model with the pressure loading code.'
266 CALL PRINT_ERROR( msgBuf, myThid )
267 WRITE(msgBuf,'(A)')
268 & ' Re-compile with: "#define ATMOSPHERIC_LOADING"'
269 CALL PRINT_ERROR( msgBuf, myThid )
270 errCount = errCount + 1
271 ENDIF
272 IF ( useRealFreshWaterFlux .AND. useThSIce ) THEN
273 WRITE(msgBuf,'(A)')
274 & 'CONFIG_CHECK: sIceLoad is computed but'
275 CALL PRINT_ERROR( msgBuf, myThid )
276 WRITE(msgBuf,'(A)')
277 & ' pressure loading code is not compiled.'
278 CALL PRINT_ERROR( msgBuf, myThid )
279 WRITE(msgBuf,'(A)')
280 & ' Re-compile with: "#define ATMOSPHERIC_LOADING"'
281 CALL PRINT_ERROR( msgBuf, myThid )
282 errCount = errCount + 1
283 ENDIF
284 #endif
285
286 #ifndef ALLOW_FRICTION_HEATING
287 IF ( addFrictionHeating ) THEN
288 WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: addFrictionHeating=T',
289 & ' but FRICTIONAL_HEATING code is not compiled.'
290 CALL PRINT_ERROR( msgBuf, myThid )
291 WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: Re-compile with:',
292 & ' "#define ALLOW_FRICTION_HEATING" (CPP_OPTIONS.h)'
293 CALL PRINT_ERROR( msgBuf, myThid )
294 errCount = errCount + 1
295 ENDIF
296 #endif
297
298 #ifndef ALLOW_BALANCE_FLUXES
299 IF (balanceEmPmR .OR. balanceQnet) THEN
300 WRITE(msgBuf,'(A,A)')
301 & 'CONFIG_CHECK: balanceEmPmR/Qnet is set but balance code ',
302 & 'is not compiled.'
303 CALL PRINT_ERROR( msgBuf, myThid )
304 WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
305 & 'Re-compile with: ALLOW_BALANCE_FLUXES defined'
306 CALL PRINT_ERROR( msgBuf, myThid )
307 errCount = errCount + 1
308 ENDIF
309 #endif
310
311 #ifndef ALLOW_BALANCE_RELAX
312 IF (balanceThetaClimRelax .OR. balanceSaltClimRelax) THEN
313 WRITE(msgBuf,'(A,A)')
314 & 'CONFIG_CHECK: balanceTheta/SaltClimRelax is set ',
315 & 'but balance code is not compiled.'
316 CALL PRINT_ERROR( msgBuf, myThid )
317 WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
318 & 'Re-compile with ALLOW_BALANCE_RELAX defined'
319 CALL PRINT_ERROR( msgBuf, myThid )
320 errCount = errCount + 1
321 ENDIF
322 #endif
323
324 #ifndef ALLOW_SRCG
325 IF (useSRCGSolver) THEN
326 WRITE(msgBuf,'(A,A)')
327 & 'CONFIG_CHECK: useSRCGSolver = .TRUE., but single reduction ',
328 & 'code is not compiled.'
329 CALL PRINT_ERROR( msgBuf, myThid )
330 WRITE(msgBuf,'(A)')
331 & 'CONFIG_CHECK: Re-compile with ALLOW_SRCG defined'
332 CALL PRINT_ERROR( msgBuf, myThid )
333 errCount = errCount + 1
334 ENDIF
335 #endif /* ALLOW_SRCG */
336
337 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
338
339 C-- Check parameter consistency :
340
341 IF ( ( OLx.LT.3 .OR. OLy.LT.3 ) .AND.
342 & ( viscC4leithD.NE.0. .OR. viscC4leith.NE.0.
343 & .OR. viscC4smag.NE.0. .OR. viscA4Grid.NE.0.
344 & .OR. viscA4D.NE.0. .OR. viscA4Z.NE.0. ) ) THEN
345 WRITE(msgBuf,'(A,A)')
346 & 'CONFIG_CHECK: cannot use Biharmonic Visc. (viscA4) with',
347 & ' overlap (OLx,OLy) smaller than 3'
348 CALL PRINT_ERROR( msgBuf, myThid )
349 errCount = errCount + 1
350 ENDIF
351 IF ( ( OLx.LT.3 .OR. OLy.LT.3 ) .AND.
352 & ( viscC2leithD.NE.0. .OR. viscC4leithD.NE.0. )
353 & ) THEN
354 WRITE(msgBuf,'(A,A)')
355 & 'CONFIG_CHECK: cannot use Leith Visc.(div.part) with',
356 & ' overlap (OLx,OLy) smaller than 3'
357 CALL PRINT_ERROR( msgBuf, myThid )
358 errCount = errCount + 1
359 ENDIF
360
361 #ifndef DISCONNECTED_TILES
362 C Overlaps cannot be larger than interior tile except for special cases
363 IF ( sNx.LT.OLx ) THEN
364 #ifdef ALLOW_EXCH2
365 WRITE(msgBuf,'(A)')
366 & 'CONFIG_CHECK: sNx<OLx not allowed with ALLOW_EXCH2 defined'
367 CALL PRINT_ERROR( msgBuf, myThid )
368 errCount = errCount + 1
369 #endif /* ALLOW_EXCH2 */
370 IF ( Nx.NE.1 ) THEN
371 WRITE(msgBuf,'(A)')
372 & 'CONFIG_CHECK: sNx<OLx not allowed unless Nx=1'
373 CALL PRINT_ERROR( msgBuf, myThid )
374 errCount = errCount + 1
375 ENDIF
376 ENDIF
377 IF ( sNy.LT.OLy ) THEN
378 #ifdef ALLOW_EXCH2
379 WRITE(msgBuf,'(A)')
380 & 'CONFIG_CHECK: sNy<OLy not allowed with ALLOW_EXCH2 defined'
381 CALL PRINT_ERROR( msgBuf, myThid )
382 errCount = errCount + 1
383 #endif /* ALLOW_EXCH2 */
384 IF ( Ny.NE.1 ) THEN
385 WRITE(msgBuf,'(A)')
386 & 'CONFIG_CHECK: sNy<OLy not allowed unless Ny=1'
387 CALL PRINT_ERROR( msgBuf, myThid )
388 errCount = errCount + 1
389 ENDIF
390 ENDIF
391 #endif /* ndef DISCONNECTED_TILES */
392
393 C-- Deep-Atmosphere & Anelastic limitations:
394 IF ( deepAtmosphere .AND.
395 & useRealFreshWaterFlux .AND. usingPCoords ) THEN
396 WRITE(msgBuf,'(A,A)')
397 & 'CONFIG_CHECK: Deep-Atmosphere not yet implemented with',
398 & ' real-Fresh-Water option in P-coordinate'
399 CALL PRINT_ERROR( msgBuf, myThid )
400 errCount = errCount + 1
401 ENDIF
402 IF ( select_rStar.NE.0 .AND.
403 & ( deepAtmosphere .OR.
404 & usingZCoords.AND.rhoRefFile .NE. ' ' ) ) THEN
405 WRITE(msgBuf,'(A,A)')
406 & 'CONFIG_CHECK: Deep-Atmosphere or Anelastic',
407 & ' not yet implemented with rStar'
408 CALL PRINT_ERROR( msgBuf, myThid )
409 errCount = errCount + 1
410 ENDIF
411 IF ( vectorInvariantMomentum .AND.
412 & ( deepAtmosphere .OR.
413 & usingZCoords.AND.rhoRefFile .NE. ' ' ) ) THEN
414 WRITE(msgBuf,'(A,A)')
415 & 'CONFIG_CHECK: Deep-Atmosphere or Anelastic',
416 & ' not yet implemented in Vector-Invariant momentum code'
417 CALL PRINT_ERROR( msgBuf, myThid )
418 errCount = errCount + 1
419 ENDIF
420
421 C-- Free-surface related limitations:
422 IF ( cg2dUseMinResSol.LT.0 .OR. cg2dUseMinResSol.GT.1 ) THEN
423 WRITE(msgBuf,'(A,I10,A)')
424 & 'CONFIG_CHECK: cg2dUseMinResSol set to unvalid value(=',
425 & cg2dUseMinResSol, ')'
426 CALL PRINT_ERROR( msgBuf, myThid )
427 errCount = errCount + 1
428 ENDIF
429
430 IF ( rigidLid .AND. implicitFreeSurface ) THEN
431 WRITE(msgBuf,'(A,A)')
432 & 'CONFIG_CHECK: Cannot select both implicitFreeSurface',
433 & ' and rigidLid.'
434 CALL PRINT_ERROR( msgBuf, myThid )
435 errCount = errCount + 1
436 ENDIF
437
438 IF (rigidLid .AND. exactConserv) THEN
439 WRITE(msgBuf,'(A)')
440 & 'CONFIG_CHECK: exactConserv not compatible with'
441 CALL PRINT_ERROR( msgBuf, myThid )
442 WRITE(msgBuf,'(A)')
443 & 'CONFIG_CHECK: rigidLid (meaningless in that case)'
444 CALL PRINT_ERROR( msgBuf, myThid )
445 errCount = errCount + 1
446 ENDIF
447
448 IF ( linFSConserveTr .AND. nonlinFreeSurf.NE.0 ) THEN
449 WRITE(msgBuf,'(A)')
450 & 'CONFIG_CHECK: Cannot select both a Nonlinear Free Surf.'
451 CALL PRINT_ERROR( msgBuf, myThid )
452 WRITE(msgBuf,'(A)')
453 & 'CONFIG_CHECK: and Tracer Correction of Lin. Free Surf.'
454 CALL PRINT_ERROR( msgBuf, myThid )
455 errCount = errCount + 1
456 ENDIF
457
458 IF (rigidLid .AND. useRealFreshWaterFlux) THEN
459 WRITE(msgBuf,'(A)')
460 & 'CONFIG_CHECK: useRealFreshWaterFlux not compatible with'
461 CALL PRINT_ERROR( msgBuf, myThid )
462 WRITE(msgBuf,'(A)')
463 & 'CONFIG_CHECK: rigidLid (meaningless in that case)'
464 CALL PRINT_ERROR( msgBuf, myThid )
465 errCount = errCount + 1
466 ENDIF
467
468 IF (nonlinFreeSurf.NE.0 .AND. .NOT.exactConserv) THEN
469 WRITE(msgBuf,'(A)')
470 & 'CONFIG_CHECK: nonlinFreeSurf cannot be used'
471 CALL PRINT_ERROR( msgBuf, myThid )
472 WRITE(msgBuf,'(A)')
473 & 'CONFIG_CHECK: without exactConserv'
474 CALL PRINT_ERROR( msgBuf, myThid )
475 errCount = errCount + 1
476 ENDIF
477
478 IF (select_rStar.NE.0 .AND. .NOT.exactConserv) THEN
479 WRITE(msgBuf,'(A)')
480 & 'CONFIG_CHECK: r* Coordinate cannot be used'
481 CALL PRINT_ERROR( msgBuf, myThid )
482 WRITE(msgBuf,'(A)')
483 & 'CONFIG_CHECK: without exactConserv'
484 CALL PRINT_ERROR( msgBuf, myThid )
485 errCount = errCount + 1
486 ENDIF
487
488 IF ( select_rStar.GE.1 .AND. nonlinFreeSurf.LE.0 ) THEN
489 WRITE(msgBuf,'(2A,I3,A)') 'CONFIG_CHECK: r* Coordinate',
490 & ' (select_rStar=', select_rStar, ' ) cannot be used'
491 CALL PRINT_ERROR( msgBuf, myThid )
492 WRITE(msgBuf,'(2A,I3,A)') 'CONFIG_CHECK: ',
493 & ' with Linear FreeSurf (nonlinFreeSurf=', nonlinFreeSurf,' )'
494 CALL PRINT_ERROR( msgBuf, myThid )
495 errCount = errCount + 1
496 ENDIF
497 IF ( select_rStar.EQ.2 .AND. nonlinFreeSurf.NE.4 ) THEN
498 C- not consistent to account for the slope of the coordinate when
499 C ignoring the variations of level-thickness in PhiHyd calculation;
500 C for now, issue a warning (but might change the code later on):
501 WRITE(msgBuf,'(2A,I3)') '** WARNING ** CONFIG_CHECK: ',
502 & 'select_rStar=2 not right with nonlinFreeSurf=', nonlinFreeSurf
503 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
504 & SQUEEZE_RIGHT, myThid )
505 ENDIF
506
507 IF ( selectSigmaCoord.NE.0 ) THEN
508 IF ( fluidIsWater ) THEN
509 WRITE(msgBuf,'(A)')
510 & 'CONFIG_CHECK: Sigma-Coords not yet coded for Oceanic set-up'
511 CALL PRINT_ERROR( msgBuf, myThid )
512 errCount = errCount + 1
513 ENDIF
514 IF ( nonlinFreeSurf.LE.0 ) THEN
515 WRITE(msgBuf,'(A)')
516 & 'CONFIG_CHECK: Sigma-Coords not coded for Lin-FreeSurf'
517 CALL PRINT_ERROR( msgBuf, myThid )
518 errCount = errCount + 1
519 ENDIF
520 IF (select_rStar.NE.0 ) THEN
521 WRITE(msgBuf,'(A)')
522 & 'CONFIG_CHECK: Sigma-Coords and rStar are not compatible'
523 CALL PRINT_ERROR( msgBuf, myThid )
524 errCount = errCount + 1
525 ENDIF
526 WRITE(msgBuf,'(A)')
527 & 'CONFIG_CHECK: Sigma-Coords code neither complete nor tested'
528 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
529 & SQUEEZE_RIGHT, myThid )
530 ENDIF
531
532 C- note : not implemented in checkpoint48b but it is done now (since 01-28-03)
533 c IF (select_rStar.GT.0 .AND. useOBCS ) THEN
534 c STOP 'ABNORMAL END: S/R CONFIG_CHECK'
535 c ENDIF
536
537 IF ( nonlinFreeSurf.NE.0 .AND.
538 & deltaTFreeSurf.NE.dTtracerLev(1) ) THEN
539 WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
540 & 'nonlinFreeSurf might cause problems'
541 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
542 & SQUEEZE_RIGHT, myThid )
543 WRITE(msgBuf,'(2A)') '** WARNING ** ',
544 & 'with different FreeSurf & Tracer time-steps'
545 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
546 & SQUEEZE_RIGHT, myThid )
547 ENDIF
548
549 IF ( useRealFreshWaterFlux .AND. exactConserv
550 & .AND. implicDiv2Dflow.EQ.0. _d 0
551 & .AND. startTime.NE.baseTime .AND. usePickupBeforeC54 ) THEN
552 WRITE(msgBuf,'(A)')
553 & 'CONFIG_CHECK: RealFreshWaterFlux+implicSurfP=0+exactConserv:'
554 CALL PRINT_ERROR( msgBuf, myThid )
555 WRITE(msgBuf,'(A)')
556 & 'CONFIG_CHECK: restart not implemented in this config'
557 CALL PRINT_ERROR( msgBuf, myThid )
558 errCount = errCount + 1
559 ENDIF
560
561 IF ( useRealFreshWaterFlux .AND. .NOT.exactConserv
562 & .AND. implicDiv2Dflow.NE.1. ) THEN
563 WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
564 & 'RealFreshWater & implicDiv2Dflow < 1'
565 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
566 & SQUEEZE_RIGHT, myThid )
567 WRITE(msgBuf,'(2A)') '** WARNING ** works better',
568 & ' with exactConserv=.T. (+ #define EXACT_CONSERV)'
569 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
570 & SQUEEZE_RIGHT, myThid )
571 ENDIF
572
573 #ifdef EXACT_CONSERV
574 IF (useRealFreshWaterFlux .AND. .NOT.exactConserv
575 & .AND. buoyancyRelation.EQ.'OCEANICP' ) THEN
576 WRITE(msgBuf,'(A)')
577 & 'CONFIG_CHECK: RealFreshWaterFlux with OCEANICP'
578 CALL PRINT_ERROR( msgBuf, myThid )
579 WRITE(msgBuf,'(A)')
580 & 'CONFIG_CHECK: requires exactConserv=T'
581 CALL PRINT_ERROR( msgBuf, myThid )
582 errCount = errCount + 1
583 ENDIF
584 #else
585 IF (useRealFreshWaterFlux
586 & .AND. buoyancyRelation.EQ.'OCEANICP' ) THEN
587 WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
588 & 'E-P effects on wVel are not included'
589 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
590 & SQUEEZE_RIGHT, myThid )
591 WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
592 & '==> use #define EXACT_CONSERV to fix it'
593 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
594 & SQUEEZE_RIGHT, myThid )
595 ENDIF
596 #endif /* EXACT_CONSERV */
597
598 IF ( selectAddFluid.LT.-1 .OR. selectAddFluid.GT.2 ) THEN
599 WRITE(msgBuf,'(A,I10,A)') 'CONFIG_CHECK: selectAddFluid=',
600 & selectAddFluid, ' not allowed'
601 CALL PRINT_ERROR( msgBuf, myThid )
602 WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
603 & 'should be =0 (Off), 1,2 (Add Mass) or -1 (Virtual Flux)'
604 CALL PRINT_ERROR( msgBuf, myThid )
605 errCount = errCount + 1
606 ENDIF
607 IF ( selectAddFluid.GE.1 .AND. rigidLid ) THEN
608 WRITE(msgBuf,'(A)')
609 & 'CONFIG_CHECK: selectAddFluid > 0 not compatible with'
610 CALL PRINT_ERROR( msgBuf, myThid )
611 WRITE(msgBuf,'(A)')
612 & 'CONFIG_CHECK: rigidLid (meaningless in that case)'
613 CALL PRINT_ERROR( msgBuf, myThid )
614 errCount = errCount + 1
615 ENDIF
616 IF ( selectAddFluid.GE.1 .AND. .NOT.staggerTimeStep ) THEN
617 WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
618 & 'synchronous time-stepping =>'
619 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
620 & SQUEEZE_RIGHT, myThid )
621 WRITE(msgBuf,'(2A)') '** WARNING ** ',
622 & '1 time-step mismatch in AddFluid effects on T & S'
623 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
624 & SQUEEZE_RIGHT, myThid )
625 ENDIF
626
627 C-- Non-hydrostatic and 3-D solver related limitations:
628 IF (nonlinFreeSurf.NE.0 .AND. use3Dsolver) THEN
629 WRITE(msgBuf,'(A)')
630 & 'CONFIG_CHECK: nonlinFreeSurf not yet implemented'
631 CALL PRINT_ERROR( msgBuf, myThid )
632 WRITE(msgBuf,'(A)')
633 & 'CONFIG_CHECK: in nonHydrostatic code'
634 CALL PRINT_ERROR( msgBuf, myThid )
635 errCount = errCount + 1
636 ENDIF
637
638 IF ( implicitNHPress*implicSurfPress*implicDiv2Dflow.NE.1.
639 & .AND. implicitIntGravWave ) THEN
640 WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: implicitIntGravWave',
641 & ' NOT SAFE with non-fully implicit solver'
642 CALL PRINT_ERROR( msgBuf, myThid )
643 WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: To by-pass this',
644 & 'STOP, comment this test and re-compile config_check'
645 CALL PRINT_ERROR( msgBuf, myThid )
646 errCount = errCount + 1
647 ENDIF
648 IF ( nonHydrostatic .AND. .NOT.exactConserv
649 & .AND. implicDiv2Dflow.NE.1. ) THEN
650 WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: Needs exactConserv=T',
651 & ' for nonHydrostatic with implicDiv2Dflow < 1'
652 CALL PRINT_ERROR( msgBuf, myThid )
653 errCount = errCount + 1
654 ENDIF
655 IF ( nonHydrostatic .AND.
656 & implicitNHPress.NE.implicSurfPress ) THEN
657 WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
658 & ' nonHydrostatic might cause problems with'
659 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
660 & SQUEEZE_RIGHT, myThid )
661 WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
662 & 'different implicitNHPress & implicSurfPress'
663 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
664 & SQUEEZE_RIGHT, myThid )
665 ENDIF
666
667 IF ( implicitViscosity .AND. use3Dsolver ) THEN
668 WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
669 & 'Implicit viscosity applies to provisional u,vVel'
670 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
671 & SQUEEZE_RIGHT, myThid )
672 WRITE(msgBuf,'(2A)') '** WARNING ** => not consistent with',
673 & 'final vertical shear (after appling 3-D solver solution'
674 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
675 & SQUEEZE_RIGHT, myThid )
676 ENDIF
677 IF ( implicitViscosity .AND. nonHydrostatic ) THEN
678 WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
679 & 'Implicit viscosity not implemented in CALC_GW'
680 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
681 & SQUEEZE_RIGHT, myThid )
682 WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
683 & 'Explicit viscosity might become unstable if too large'
684 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
685 & SQUEEZE_RIGHT, myThid )
686 ENDIF
687
688 C-- Momentum related limitations:
689 IF ( vectorInvariantMomentum.AND.momStepping ) THEN
690 IF ( highOrderVorticity.AND.upwindVorticity ) THEN
691 WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
692 & '"highOrderVorticity" conflicts with "upwindVorticity"'
693 CALL PRINT_ERROR( msgBuf, myThid )
694 errCount = errCount + 1
695 ENDIF
696 ENDIF
697 IF ( .NOT.vectorInvariantMomentum .AND. momAdvection ) THEN
698 IF ( usingCurvilinearGrid ) THEN
699 WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
700 & 'missing metric-terms for CurvilinearGrid'
701 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
702 & SQUEEZE_RIGHT, myThid )
703 ENDIF
704 IF ( hasWetCSCorners ) THEN
705 WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: momAdvection ',
706 & 'in flux-form is wrong on CubedSphere grid (corners)'
707 CALL PRINT_ERROR( msgBuf, myThid )
708 errCount = errCount + 1
709 ENDIF
710 ENDIF
711 IF ( selectCoriMap.LT.0 .OR. selectCoriMap.GT.3 ) THEN
712 WRITE(msgBuf,'(2A,I4)') 'CONFIG_CHECK: ',
713 & 'Invalid option: selectCoriMap=', selectCoriMap
714 CALL PRINT_ERROR( msgBuf, myThid )
715 errCount = errCount + 1
716 ENDIF
717 IF ( useSmag3D .AND.
718 & ( usingPCoords .OR. deepAtmosphere .OR. selectSigmaCoord.NE.0
719 & .OR. rhoRefFile.NE.' ' .OR. hasWetCSCorners )
720 & ) THEN
721 WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
722 & 'Smag-3D not yet implemented for this set-up'
723 CALL PRINT_ERROR( msgBuf, myThid )
724 errCount = errCount + 1
725 ENDIF
726
727 IF (.NOT.useCDscheme .AND. (tauCD.NE.0. .OR. rCD.NE.-1.) ) THEN
728 C- jmc: since useCDscheme is a new [04-13-03] flag (default=F),
729 C put this WARNING to stress that even if CD-scheme parameters
730 C (tauCD,rCD) are set, CD-scheme is not used without useCDscheme=T
731 C- and STOP if using mom_fluxform (following Chris advise).
732 C- jmc: but ultimately, this block can/will be removed.
733 IF (.NOT.vectorInvariantMomentum.AND.momStepping) THEN
734 WRITE(msgBuf,'(A)')
735 & 'CONFIG_CHECK: CD-scheme is OFF but params(tauCD,rCD) are set'
736 CALL PRINT_ERROR( msgBuf, myThid )
737 WRITE(msgBuf,'(2A)')
738 & 'CONFIG_CHECK: to turn ON CD-scheme: => "useCDscheme=.TRUE."',
739 & ' in "data", namelist PARM01'
740 CALL PRINT_ERROR( msgBuf, myThid )
741 errCount = errCount + 1
742 ENDIF
743 WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
744 & 'CD-scheme is OFF but params(tauCD,rCD) are set'
745 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
746 & SQUEEZE_RIGHT, myThid )
747 WRITE(msgBuf,'(3A)') '** WARNING ** to turn ON CD-scheme:',
748 & ' => "useCDscheme=.TRUE." in "data", namelist PARM01'
749 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
750 & SQUEEZE_RIGHT, myThid )
751 ENDIF
752
753 IF ( useCDscheme .AND. hasWetCSCorners ) THEN
754 WRITE(msgBuf,'(2A)')
755 & 'CONFIG_CHECK: CD-scheme not implemented on CubedSphere grid'
756 CALL PRINT_ERROR( msgBuf, myThid )
757 errCount = errCount + 1
758 ENDIF
759
760 C-- Time-stepping limitations
761 IF ( momForcingOutAB.NE.0 .AND. momForcingOutAB.NE.1 ) THEN
762 WRITE(msgBuf,'(A,I10,A)') 'CONFIG_CHECK: momForcingOutAB=',
763 & momForcingOutAB, ' not allowed'
764 CALL PRINT_ERROR( msgBuf, myThid )
765 WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: momForcingOutAB ',
766 & 'should be =1 (Out of AB) or =0 (In AB)'
767 CALL PRINT_ERROR( msgBuf, myThid )
768 errCount = errCount + 1
769 ENDIF
770 IF ( tracForcingOutAB.NE.0 .AND. tracForcingOutAB.NE.1 ) THEN
771 WRITE(msgBuf,'(A,I10,A)') 'CONFIG_CHECK: tracForcingOutAB=',
772 & tracForcingOutAB, ' not allowed'
773 CALL PRINT_ERROR( msgBuf, myThid )
774 WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: tracForcingOutAB ',
775 & 'should be =1 (Out of AB) or =0 (In AB)'
776 CALL PRINT_ERROR( msgBuf, myThid )
777 errCount = errCount + 1
778 ENDIF
779 IF ( addFrictionHeating .AND. .NOT.staggerTimeStep ) THEN
780 WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: addFrictionHeating',
781 & ' not yet coded for synchronous time-stepping.'
782 CALL PRINT_ERROR( msgBuf, myThid )
783 errCount = errCount + 1
784 ENDIF
785
786 C-- Grid limitations:
787 IF ( rotateGrid ) THEN
788 IF ( .NOT. usingSphericalPolarGrid ) THEN
789 WRITE(msgBuf,'(2A)')
790 & 'CONFIG_CHECK: specifying Euler angles makes only ',
791 & 'sense with usingSphericalGrid=.TRUE.'
792 CALL PRINT_ERROR( msgBuf, myThid )
793 errCount = errCount + 1
794 ENDIF
795 IF ( useFLT .OR. useZonal_Filt .OR. useECCO ) THEN
796 WRITE(msgBuf,'(2A)')
797 & 'CONFIG_CHECK: specifying Euler angles will probably ',
798 & 'not work with pkgs FLT, ZONAL_FLT, ECCO'
799 CALL PRINT_ERROR( msgBuf, myThid )
800 errCount = errCount + 1
801 ENDIF
802 ENDIF
803
804 C-- Packages conflict
805 IF ( useMATRIX .AND. useGCHEM ) THEN
806 WRITE(msgBuf,'(2A)')
807 & 'CONFIG_CHECK: cannot set both: useMATRIX & useGCHEM'
808 CALL PRINT_ERROR( msgBuf, myThid )
809 errCount = errCount + 1
810 ENDIF
811
812 IF ( useMATRIX .AND. .NOT.usePTRACERS ) THEN
813 WRITE(msgBuf,'(2A)')
814 & 'CONFIG_CHECK: cannot set useMATRIX without ',
815 & 'setting usePTRACERS'
816 CALL PRINT_ERROR( msgBuf, myThid )
817 errCount = errCount + 1
818 ENDIF
819
820 IF ( (useSEAICE .OR. useThSIce) .AND. allowFreezing ) THEN
821 WRITE(msgBuf,'(2A)')
822 & 'CONFIG_CHECK: cannot set allowFreezing',
823 & ' with pkgs SEAICE or THSICE'
824 CALL PRINT_ERROR( msgBuf, myThid )
825 errCount = errCount + 1
826 ENDIF
827
828 IF ( errCount.GE.1 ) THEN
829 WRITE(msgBuf,'(A,I3,A)')
830 & 'CONFIG_CHECK: detected', errCount,' fatal error(s)'
831 CALL PRINT_ERROR( msgBuf, myThid )
832 CALL ALL_PROC_DIE( 0 )
833 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
834 ENDIF
835 _END_MASTER(myThid)
836
837 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
838
839 _BEGIN_MASTER(myThid)
840 WRITE(msgBuf,'(A)') '// CONFIG_CHECK : Normal End'
841 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
842 & SQUEEZE_RIGHT, myThid )
843 WRITE(msgBuf,'(A)')
844 &'// ======================================================='
845 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
846 & SQUEEZE_RIGHT, myThid )
847 WRITE(msgBuf,'(A)') ' '
848 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
849 & SQUEEZE_RIGHT, myThid )
850 _END_MASTER(myThid)
851
852 RETURN
853 END

  ViewVC Help
Powered by ViewVC 1.1.22