/[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.69 - (show annotations) (download)
Fri Jul 13 23:24:52 2012 UTC (11 years, 10 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64, checkpoint63q, checkpoint63r, checkpoint63s
Changes since 1.68: +27 -10 lines
- add warning if usingCurvilinearGrid and momAdvection in flux-form (missing
  metric terms); stop if hasWetCSCorners=T and momAdvection in flux-form.
- re-activate the stop if useCDscheme and hasWetCSCorners=T (previously if
  useCDscheme and useCubedSphereExchange).

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

  ViewVC Help
Powered by ViewVC 1.1.22