/[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.56 - (show annotations) (download)
Sat Sep 11 21:24:51 2010 UTC (13 years, 9 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint62k, checkpoint62n, checkpoint62m, checkpoint62l
Changes since 1.55: +51 -2 lines
first check-in of sigma (and hybrid-sigma) coordinate code

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

  ViewVC Help
Powered by ViewVC 1.1.22