/[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.59 - (show annotations) (download)
Thu Dec 1 14:30:27 2011 UTC (12 years, 6 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint63g, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k
Changes since 1.58: +11 -5 lines
disable implicitDiffusion when compiling with ALLOW_DEPTH_CONTROL

1 C $Header: /u/gcmpack/MITgcm/model/src/config_check.F,v 1.58 2011/03/15 00:15:23 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 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 #ifdef ALLOW_DEPTH_CONTROL
137 IF ( implicitDiffusion ) THEN
138 WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
139 & 'implicitDiffusion not available with DEPTH_CONTROL'
140 CALL PRINT_ERROR( msgBuf, myThid )
141 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
142 ENDIF
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 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
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 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
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 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
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 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
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 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
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 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
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 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
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 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
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 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
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 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
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 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
272 ENDIF
273 #endif
274
275 #ifndef ALLOW_SRCG
276 IF (useSRCGSolver) THEN
277 WRITE(msgBuf,'(A,A)')
278 & 'CONFIG_CHECK: useSRCGSolver = .TRUE., but single reduction ',
279 & 'code is not compiled.'
280 CALL PRINT_ERROR( msgBuf, myThid )
281 WRITE(msgBuf,'(A)')
282 & 'CONFIG_CHECK: Re-compile with ALLOW_SRCG defined'
283 CALL PRINT_ERROR( msgBuf, myThid )
284 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
285 ENDIF
286 #endif /* ALLOW_SRCG */
287
288 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
289
290 C-- Check parameter consistency :
291
292 IF ( ( OLx.LT.3 .OR. OLy.LT.3 ) .AND.
293 & ( viscC4leithD.NE.0. .OR. viscC4leith.NE.0.
294 & .OR. viscC4smag.NE.0. .OR. viscA4Grid.NE.0.
295 & .OR. viscA4D.NE.0. .OR. viscA4Z.NE.0. ) ) THEN
296 WRITE(msgBuf,'(A,A)')
297 & 'CONFIG_CHECK: cannot use Biharmonic Visc. (viscA4) with',
298 & ' overlap (OLx,OLy) smaller than 3'
299 CALL PRINT_ERROR( msgBuf, myThid )
300 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
301 ENDIF
302 IF ( ( OLx.LT.3 .OR. OLy.LT.3 ) .AND.
303 & ( viscC2leithD.NE.0. .OR. viscC4leithD.NE.0. )
304 & ) THEN
305 WRITE(msgBuf,'(A,A)')
306 & 'CONFIG_CHECK: cannot use Leith Visc.(div.part) with',
307 & ' overlap (OLx,OLy) smaller than 3'
308 CALL PRINT_ERROR( msgBuf, myThid )
309 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
310 ENDIF
311
312 C-- Deep-Atmosphere & Anelastic limitations:
313 IF ( deepAtmosphere .AND.
314 & useRealFreshWaterFlux .AND. usingPCoords ) THEN
315 WRITE(msgBuf,'(A,A)')
316 & 'CONFIG_CHECK: Deep-Atmosphere not yet implemented with',
317 & ' real-Fresh-Water option in P-coordinate'
318 CALL PRINT_ERROR( msgBuf, myThid )
319 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
320 ENDIF
321 IF ( select_rStar.NE.0 .AND.
322 & ( deepAtmosphere .OR.
323 & usingZCoords.AND.rhoRefFile .NE. ' ' ) ) THEN
324 WRITE(msgBuf,'(A,A)')
325 & 'CONFIG_CHECK: Deep-Atmosphere or Anelastic',
326 & ' not yet implemented with rStar'
327 CALL PRINT_ERROR( msgBuf, myThid )
328 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
329 ENDIF
330 IF ( vectorInvariantMomentum .AND.
331 & ( deepAtmosphere .OR.
332 & usingZCoords.AND.rhoRefFile .NE. ' ' ) ) THEN
333 WRITE(msgBuf,'(A,A)')
334 & 'CONFIG_CHECK: Deep-Atmosphere or Anelastic',
335 & ' not yet implemented in Vector-Invariant momentum code'
336 CALL PRINT_ERROR( msgBuf, myThid )
337 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
338 ENDIF
339
340 C-- Free-surface related limitations:
341 IF ( rigidLid .AND. implicitFreeSurface ) THEN
342 WRITE(msgBuf,'(A,A)')
343 & 'CONFIG_CHECK: Cannot select both implicitFreeSurface',
344 & ' and rigidLid.'
345 CALL PRINT_ERROR( msgBuf, myThid )
346 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
347 ENDIF
348
349 IF (rigidLid .AND. exactConserv) THEN
350 WRITE(msgBuf,'(A)')
351 & 'CONFIG_CHECK: exactConserv not compatible with'
352 CALL PRINT_ERROR( msgBuf, myThid )
353 WRITE(msgBuf,'(A)')
354 & 'CONFIG_CHECK: rigidLid (meaningless in that case)'
355 CALL PRINT_ERROR( msgBuf, myThid )
356 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
357 ENDIF
358
359 IF ( linFSConserveTr .AND. nonlinFreeSurf.NE.0 ) THEN
360 WRITE(msgBuf,'(A)')
361 & 'CONFIG_CHECK: Cannot select both a Nonlinear Free Surf.'
362 CALL PRINT_ERROR( msgBuf, myThid )
363 WRITE(msgBuf,'(A)')
364 & 'CONFIG_CHECK: and Tracer Correction of Lin. Free Surf.'
365 CALL PRINT_ERROR( msgBuf, myThid )
366 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
367 ENDIF
368
369 IF (rigidLid .AND. useRealFreshWaterFlux) THEN
370 WRITE(msgBuf,'(A)')
371 & 'CONFIG_CHECK: useRealFreshWaterFlux not compatible with'
372 CALL PRINT_ERROR( msgBuf, myThid )
373 WRITE(msgBuf,'(A)')
374 & 'CONFIG_CHECK: rigidLid (meaningless in that case)'
375 CALL PRINT_ERROR( msgBuf, myThid )
376 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
377 ENDIF
378
379 IF (nonlinFreeSurf.NE.0 .AND. .NOT.exactConserv) THEN
380 WRITE(msgBuf,'(A)')
381 & 'CONFIG_CHECK: nonlinFreeSurf cannot be used'
382 CALL PRINT_ERROR( msgBuf, myThid )
383 WRITE(msgBuf,'(A)')
384 & 'CONFIG_CHECK: without exactConserv'
385 CALL PRINT_ERROR( msgBuf, myThid )
386 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
387 ENDIF
388
389 IF (select_rStar.NE.0 .AND. .NOT.exactConserv) THEN
390 WRITE(msgBuf,'(A)')
391 & 'CONFIG_CHECK: r* Coordinate cannot be used'
392 CALL PRINT_ERROR( msgBuf, myThid )
393 WRITE(msgBuf,'(A)')
394 & 'CONFIG_CHECK: without exactConserv'
395 CALL PRINT_ERROR( msgBuf, myThid )
396 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
397 ENDIF
398
399 IF ( selectSigmaCoord.NE.0 ) THEN
400 IF ( fluidIsWater ) THEN
401 WRITE(msgBuf,'(A)')
402 & 'CONFIG_CHECK: Sigma-Coords not yet coded for Oceanic set-up'
403 CALL PRINT_ERROR( msgBuf, myThid )
404 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
405 ENDIF
406 IF ( nonlinFreeSurf.LE.0 ) THEN
407 WRITE(msgBuf,'(A)')
408 & 'CONFIG_CHECK: Sigma-Coords not coded for Lin-FreeSurf'
409 CALL PRINT_ERROR( msgBuf, myThid )
410 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
411 ENDIF
412 IF (select_rStar.NE.0 ) THEN
413 WRITE(msgBuf,'(A)')
414 & 'CONFIG_CHECK: Sigma-Coords and rStar are not compatible'
415 CALL PRINT_ERROR( msgBuf, myThid )
416 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
417 ENDIF
418 WRITE(msgBuf,'(A)')
419 & 'CONFIG_CHECK: Sigma-Coords code neither complete nor tested'
420 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
421 & SQUEEZE_RIGHT, myThid )
422 ENDIF
423
424 C- note : not implemented in checkpoint48b but it is done now (since 01-28-03)
425 c IF (select_rStar.GT.0 .AND. useOBCS ) THEN
426 c STOP 'ABNORMAL END: S/R CONFIG_CHECK'
427 c ENDIF
428
429 IF ( nonlinFreeSurf.NE.0 .AND.
430 & deltaTfreesurf.NE.dTtracerLev(1) ) THEN
431 WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
432 & 'nonlinFreeSurf might cause problems'
433 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
434 & SQUEEZE_RIGHT, myThid )
435 WRITE(msgBuf,'(2A)') '** WARNING ** ',
436 & 'with different FreeSurf & Tracer time-steps'
437 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
438 & SQUEEZE_RIGHT, myThid )
439 ENDIF
440
441 IF ( useRealFreshWaterFlux .AND. exactConserv
442 & .AND. implicDiv2Dflow.EQ.0. _d 0
443 & .AND. startTime.NE.baseTime .AND. usePickupBeforeC54 ) THEN
444 WRITE(msgBuf,'(A)')
445 & 'CONFIG_CHECK: RealFreshWaterFlux+implicSurfP=0+exactConserv:'
446 CALL PRINT_ERROR( msgBuf, myThid )
447 WRITE(msgBuf,'(A)')
448 & 'CONFIG_CHECK: restart not implemented in this config'
449 CALL PRINT_ERROR( msgBuf, myThid )
450 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
451 ENDIF
452
453 IF ( useRealFreshWaterFlux .AND. .NOT.exactConserv
454 & .AND. implicDiv2Dflow.NE.1. ) THEN
455 WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
456 & 'RealFreshWater & implicDiv2Dflow < 1'
457 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
458 & SQUEEZE_RIGHT, myThid )
459 WRITE(msgBuf,'(2A)') '** WARNING ** works better',
460 & ' with exactConserv=.T. (+ #define EXACT_CONSERV)'
461 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
462 & SQUEEZE_RIGHT, myThid )
463 ENDIF
464
465 #ifdef EXACT_CONSERV
466 IF (useRealFreshWaterFlux .AND. .NOT.exactConserv
467 & .AND. buoyancyRelation.EQ.'OCEANICP' ) THEN
468 WRITE(msgBuf,'(A)')
469 & 'CONFIG_CHECK: RealFreshWaterFlux with OCEANICP'
470 CALL PRINT_ERROR( msgBuf, myThid )
471 WRITE(msgBuf,'(A)')
472 & 'CONFIG_CHECK: requires exactConserv=T'
473 CALL PRINT_ERROR( msgBuf, myThid )
474 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
475 ENDIF
476 #else
477 IF (useRealFreshWaterFlux
478 & .AND. buoyancyRelation.EQ.'OCEANICP' ) THEN
479 WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
480 & 'E-P effects on wVel are not included'
481 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
482 & SQUEEZE_RIGHT, myThid )
483 WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
484 & '==> use #define EXACT_CONSERV to fix it'
485 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
486 & SQUEEZE_RIGHT, myThid )
487 ENDIF
488 #endif /* EXACT_CONSERV */
489
490 IF ( selectAddFluid.LT.-1 .OR. selectAddFluid.GT.2 ) THEN
491 WRITE(msgBuf,'(A,I10,A)') 'CONFIG_CHECK: selectAddFluid=',
492 & selectAddFluid, ' not allowed'
493 CALL PRINT_ERROR( msgBuf, myThid )
494 WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
495 & 'should be =0 (Off), 1,2 (Add Mass) or -1 (Virtual Flux)'
496 CALL PRINT_ERROR( msgBuf, myThid )
497 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
498 ENDIF
499 IF ( selectAddFluid.GE.1 .AND. rigidLid ) THEN
500 WRITE(msgBuf,'(A)')
501 & 'CONFIG_CHECK: selectAddFluid > 0 not compatible with'
502 CALL PRINT_ERROR( msgBuf, myThid )
503 WRITE(msgBuf,'(A)')
504 & 'CONFIG_CHECK: rigidLid (meaningless in that case)'
505 CALL PRINT_ERROR( msgBuf, myThid )
506 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
507 ENDIF
508 IF ( selectAddFluid.GE.1 .AND. .NOT.staggerTimeStep ) THEN
509 WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
510 & 'synchronous time-stepping =>'
511 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
512 & SQUEEZE_RIGHT, myThid )
513 WRITE(msgBuf,'(2A)') '** WARNING ** ',
514 & '1 time-step mismatch in AddFluid effects on T & S'
515 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
516 & SQUEEZE_RIGHT, myThid )
517 ENDIF
518
519 C-- Non-hydrostatic and 3-D solver related limitations:
520 IF (nonlinFreeSurf.NE.0 .AND. use3Dsolver) THEN
521 WRITE(msgBuf,'(A)')
522 & 'CONFIG_CHECK: nonlinFreeSurf not yet implemented'
523 CALL PRINT_ERROR( msgBuf, myThid )
524 WRITE(msgBuf,'(A)')
525 & 'CONFIG_CHECK: in nonHydrostatic code'
526 CALL PRINT_ERROR( msgBuf, myThid )
527 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
528 ENDIF
529
530 IF ( implicitNHPress*implicSurfPress*implicDiv2Dflow.NE.1.
531 & .AND. implicitIntGravWave ) THEN
532 WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: implicitIntGravWave',
533 & ' NOT SAFE with non-fully implicit solver'
534 CALL PRINT_ERROR( msgBuf, myThid )
535 WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: To by-pass this',
536 & 'STOP, comment this test and re-compile config_check'
537 CALL PRINT_ERROR( msgBuf, myThid )
538 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
539 ENDIF
540 IF ( nonHydrostatic .AND. .NOT.exactConserv
541 & .AND. implicDiv2Dflow.NE.1. ) THEN
542 WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: Needs exactConserv=T',
543 & ' for nonHydrostatic with implicDiv2Dflow < 1'
544 CALL PRINT_ERROR( msgBuf, myThid )
545 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
546 ENDIF
547 IF ( nonHydrostatic .AND.
548 & implicitNHPress.NE.implicSurfPress ) THEN
549 WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
550 & ' nonHydrostatic might cause problems with'
551 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
552 & SQUEEZE_RIGHT, myThid )
553 WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
554 & 'different implicitNHPress & implicSurfPress'
555 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
556 & SQUEEZE_RIGHT, myThid )
557 ENDIF
558
559 IF ( implicitViscosity .AND. use3Dsolver ) THEN
560 WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
561 & 'Implicit viscosity applies to provisional u,vVel'
562 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
563 & SQUEEZE_RIGHT, myThid )
564 WRITE(msgBuf,'(2A)') '** WARNING ** => not consistent with',
565 & 'final vertical shear (after appling 3-D solver solution'
566 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
567 & SQUEEZE_RIGHT, myThid )
568 ENDIF
569 IF ( implicitViscosity .AND. nonHydrostatic ) THEN
570 WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
571 & 'Implicit viscosity not implemented in CALC_GW'
572 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
573 & SQUEEZE_RIGHT, myThid )
574 WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
575 & 'Explicit viscosity might become unstable if too large'
576 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
577 & SQUEEZE_RIGHT, myThid )
578 ENDIF
579
580 C-- Momentum related limitations:
581 IF ( vectorInvariantMomentum.AND.momStepping ) THEN
582 IF ( highOrderVorticity.AND.upwindVorticity ) THEN
583 WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ',
584 & '"highOrderVorticity" conflicts with "upwindVorticity"'
585 CALL PRINT_ERROR( msgBuf, myThid )
586 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
587 ENDIF
588 ENDIF
589 IF ( selectCoriMap.LT.0 .OR. selectCoriMap.GT.3 ) THEN
590 WRITE(msgBuf,'(2A,I4)') 'CONFIG_CHECK: ',
591 & 'Invalid option: selectCoriMap=', selectCoriMap
592 CALL PRINT_ERROR( msgBuf, myThid )
593 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
594 ENDIF
595
596 IF (.NOT.useCDscheme .AND. (tauCD.NE.0. .OR. rCD.NE.-1.) ) THEN
597 C- jmc: since useCDscheme is a new [04-13-03] flag (default=F),
598 C put this WARNING to stress that even if CD-scheme parameters
599 C (tauCD,rCD) are set, CD-scheme is not used without useCDscheme=T
600 C- and STOP if using mom_fluxform (following Chris advise).
601 C- jmc: but ultimately, this block can/will be removed.
602 IF (.NOT.vectorInvariantMomentum.AND.momStepping) THEN
603 WRITE(msgBuf,'(A)')
604 & 'CONFIG_CHECK: CD-scheme is OFF but params(tauCD,rCD) are set'
605 CALL PRINT_ERROR( msgBuf, myThid )
606 WRITE(msgBuf,'(2A)')
607 & 'CONFIG_CHECK: to turn ON CD-scheme: => "useCDscheme=.TRUE."',
608 & ' in "data", namelist PARM01'
609 CALL PRINT_ERROR( msgBuf, myThid )
610 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
611 ENDIF
612 WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ',
613 & 'CD-scheme is OFF but params(tauCD,rCD) are set'
614 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
615 & SQUEEZE_RIGHT, myThid )
616 WRITE(msgBuf,'(3A)') '** WARNING ** ',
617 & 'to turn ON CD-scheme: => "useCDscheme=.TRUE."',
618 & ' in "data", namelist PARM01'
619 WRITE(msgBuf,'(3A)') '** WARNING ** to turn ON CD-scheme:',
620 & ' => "useCDscheme=.TRUE." in "data", namelist PARM01'
621 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
622 & SQUEEZE_RIGHT, myThid )
623 ENDIF
624
625 IF ( useCDscheme .AND. useCubedSphereExchange ) THEN
626 WRITE(msgBuf,'(2A)')
627 & 'CONFIG_CHECK: CD-scheme not implemented on CubedSphere grid'
628 CALL PRINT_ERROR( msgBuf, myThid )
629 cph STOP 'ABNORMAL END: S/R CONFIG_CHECK'
630 ENDIF
631
632 C-- Time-stepping limitations
633 IF ( momForcingOutAB.NE.0 .AND. momForcingOutAB.NE.1 ) THEN
634 WRITE(msgBuf,'(A,I10,A)') 'CONFIG_CHECK: momForcingOutAB=',
635 & momForcingOutAB, ' not allowed'
636 CALL PRINT_ERROR( msgBuf, myThid )
637 WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: momForcingOutAB ',
638 & 'should be =1 (Out of AB) or =0 (In AB)'
639 CALL PRINT_ERROR( msgBuf, myThid )
640 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
641 ENDIF
642 IF ( tracForcingOutAB.NE.0 .AND. tracForcingOutAB.NE.1 ) THEN
643 WRITE(msgBuf,'(A,I10,A)') 'CONFIG_CHECK: tracForcingOutAB=',
644 & tracForcingOutAB, ' not allowed'
645 CALL PRINT_ERROR( msgBuf, myThid )
646 WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: tracForcingOutAB ',
647 & 'should be =1 (Out of AB) or =0 (In AB)'
648 CALL PRINT_ERROR( msgBuf, myThid )
649 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
650 ENDIF
651
652 C-- Grid limitations:
653 IF ( rotateGrid ) THEN
654 IF ( .NOT. usingSphericalPolarGrid ) THEN
655 WRITE(msgBuf,'(2A)')
656 & 'CONFIG_CHECK: specifying Euler angles makes only ',
657 & 'sense with usingSphericalGrid=.TRUE.'
658 CALL PRINT_ERROR( msgBuf, myThid )
659 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
660 ENDIF
661 IF ( useFLT .OR. useZonal_Filt .OR. useECCO ) THEN
662 WRITE(msgBuf,'(2A)')
663 & 'CONFIG_CHECK: specifying Euler angles will probably ',
664 & 'not work with pkgs FLT, ZONAL_FLT, ECCO'
665 CALL PRINT_ERROR( msgBuf, myThid )
666 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
667 ENDIF
668 #ifdef ALLOW_PROFILES
669 WRITE(msgBuf,'(2A)')
670 & 'CONFIG_CHECK: specifying Euler angles will probably ',
671 & 'not work with pkg profiles'
672 CALL PRINT_ERROR( msgBuf, myThid )
673 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
674 #endif /* ALLOW_PROFILES */
675 ENDIF
676
677 C-- Packages conflict
678 IF ( useMATRIX .AND. useGCHEM ) THEN
679 WRITE(msgBuf,'(2A)')
680 & 'CONFIG_CHECK: cannot set both: useMATRIX & useGCHEM'
681 CALL PRINT_ERROR( msgBuf, myThid )
682 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
683 ENDIF
684
685 IF ( useMATRIX .AND. .NOT.usePTRACERS ) THEN
686 WRITE(msgBuf,'(2A)')
687 & 'CONFIG_CHECK: cannot set useMATRIX without ',
688 & 'setting usePTRACERS'
689 CALL PRINT_ERROR( msgBuf, myThid )
690 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
691 ENDIF
692
693 IF ( (useSEAICE .OR. useThSIce) .AND. allowFreezing ) THEN
694 WRITE(msgBuf,'(2A)')
695 & 'CONFIG_CHECK: cannot set allowFreezing',
696 & ' with pkgs SEAICE or THSICE'
697 CALL PRINT_ERROR( msgBuf, myThid )
698 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
699 ENDIF
700
701 WRITE(msgBuf,'(A)')
702 &'// ======================================================='
703 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
704 & SQUEEZE_RIGHT, myThid )
705 WRITE(msgBuf,'(A)') '// CONFIG_CHECK : Normal End'
706 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
707 & SQUEEZE_RIGHT, myThid )
708 WRITE(msgBuf,'(A)')
709 &'// ======================================================='
710 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
711 & SQUEEZE_RIGHT, myThid )
712 WRITE(msgBuf,'(A)') ' '
713 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
714 & SQUEEZE_RIGHT, myThid )
715
716 RETURN
717 END

  ViewVC Help
Powered by ViewVC 1.1.22