/[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.68 - (show annotations) (download)
Mon Jul 9 19:20:17 2012 UTC (11 years, 11 months ago) by jmc
Branch: MAIN
Changes since 1.67: +1 -7 lines
remove commented out stop (implicitDiffusion & ALLOW_DEPTH_CONTROL)

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

  ViewVC Help
Powered by ViewVC 1.1.22