/[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.53 - (show annotations) (download)
Mon Nov 30 22:22:04 2009 UTC (14 years, 6 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint62c, checkpoint62a, checkpoint62, checkpoint62b, checkpoint61z
Changes since 1.52: +162 -121 lines
update non-hydrostatic related parameter checking ;
add warning if using implicitViscosity & non-hydrostatic.

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

  ViewVC Help
Powered by ViewVC 1.1.22