/[MITgcm]/MITgcm/model/src/config_check.F
ViewVC logotype

Annotation of /MITgcm/model/src/config_check.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.61 - (hide annotations) (download)
Mon Apr 2 15:54:52 2012 UTC (12 years, 1 month ago) by jmc
Branch: MAIN
CVS Tags: checkpoint63l, checkpoint63m
Changes since 1.60: +77 -58 lines
collect the errors and stop cleanly at the end by calling ALL_PROC_DIE

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

  ViewVC Help
Powered by ViewVC 1.1.22