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