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

Legend:
Removed from v.1.51  
changed lines
  Added in v.1.72

  ViewVC Help
Powered by ViewVC 1.1.22