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

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.68

  ViewVC Help
Powered by ViewVC 1.1.22