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

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

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

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

Legend:
Removed from v.1.45  
changed lines
  Added in v.1.76

  ViewVC Help
Powered by ViewVC 1.1.22