/[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.85 - (hide annotations) (download)
Mon Nov 28 22:57:01 2016 UTC (7 years, 6 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h
Changes since 1.84: +60 -5 lines
add new parameter "selectImplicitDrag" for implicit treatment of bottom drag

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

  ViewVC Help
Powered by ViewVC 1.1.22