/[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.67 - (show annotations) (download)
Sat Jul 7 16:31:46 2012 UTC (11 years, 11 months ago) by jmc
Branch: MAIN
Changes since 1.66: +11 -1 lines
stop if  select_rStar > 0 and Linear FreeSurf (nonlinFreeSurf =< 0)

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

  ViewVC Help
Powered by ViewVC 1.1.22