/[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.1 by jmc, Thu Jan 31 14:52:28 2002 UTC revision 1.11 by edhill, Tue Oct 28 22:57:59 2003 UTC
# Line 1  Line 1 
1  C $Header$  C $Header$
2  C $Name$  C $Name$
3    
4    #include "PACKAGES_CONFIG.h"
5  #include "CPP_OPTIONS.h"  #include "CPP_OPTIONS.h"
6    
7  CBOP  CBOP
# Line 39  CEOP Line 40  CEOP
40    
41  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:
42    
43    #ifndef ALLOW_CD_CODE
44          IF (useCDscheme) THEN
45            WRITE(msgBuf,'(A)')
46         &   'CONFIG_CHECK: #undef ALLOW_CD_CODE and'
47            CALL PRINT_ERROR( msgBuf , myThid)
48            WRITE(msgBuf,'(A)')
49         &   'CONFIG_CHECK: useCDscheme is TRUE'
50            CALL PRINT_ERROR( msgBuf , myThid)
51            STOP 'ABNORMAL END: S/R CONFIG_CHECK'
52          ENDIF
53    #endif
54    
55  #ifndef ALLOW_NONHYDROSTATIC  #ifndef ALLOW_NONHYDROSTATIC
56        IF (nonHydrostatic) THEN        IF (nonHydrostatic) THEN
57          WRITE(msgBuf,'(A)')          WRITE(msgBuf,'(A)')
58       &   'CONFIG_CHECK: #undef ALLOW_NONHYDROSTATIC and'       &   'CONFIG_CHECK: #undef ALLOW_NONHYDROSTATIC and'
59          CALL PRINT_ERROR( msgBuf , 1)          CALL PRINT_ERROR( msgBuf , myThid)
60          WRITE(msgBuf,'(A)')          WRITE(msgBuf,'(A)')
61       &   'CONFIG_CHECK: nonHydrostatic is TRUE'       &   'CONFIG_CHECK: nonHydrostatic is TRUE'
62          CALL PRINT_ERROR( msgBuf , 1)          CALL PRINT_ERROR( msgBuf , myThid)
63          STOP 'ABNORMAL END: S/R CONFIG_CHECK'          STOP 'ABNORMAL END: S/R CONFIG_CHECK'
64        ENDIF        ENDIF
65  #endif  #endif
# Line 55  C-  check that CPP option is "defined" w Line 68  C-  check that CPP option is "defined" w
68        IF (exactConserv) THEN        IF (exactConserv) THEN
69          WRITE(msgBuf,'(A)')          WRITE(msgBuf,'(A)')
70       &   'CONFIG_CHECK: #undef EXACT_CONSERV and'       &   'CONFIG_CHECK: #undef EXACT_CONSERV and'
71          CALL PRINT_ERROR( msgBuf , 1)          CALL PRINT_ERROR( msgBuf , myThid)
72          WRITE(msgBuf,'(A)')          WRITE(msgBuf,'(A)')
73       &   'CONFIG_CHECK: exactConserv is TRUE'       &   'CONFIG_CHECK: exactConserv is TRUE'
74          CALL PRINT_ERROR( msgBuf , 1)          CALL PRINT_ERROR( msgBuf , myThid)
75          STOP 'ABNORMAL END: S/R CONFIG_CHECK'          STOP 'ABNORMAL END: S/R CONFIG_CHECK'
76        ENDIF        ENDIF
77  #endif  #endif
# Line 67  C-  check that CPP option is "defined" w Line 80  C-  check that CPP option is "defined" w
80        IF (nonlinFreeSurf.NE.0) THEN        IF (nonlinFreeSurf.NE.0) THEN
81          WRITE(msgBuf,'(A)')          WRITE(msgBuf,'(A)')
82       &   'CONFIG_CHECK: #undef NONLIN_FRSURF and'       &   'CONFIG_CHECK: #undef NONLIN_FRSURF and'
83          CALL PRINT_ERROR( msgBuf , 1)          CALL PRINT_ERROR( msgBuf , myThid)
84          WRITE(msgBuf,'(A)')          WRITE(msgBuf,'(A)')
85       &   'CONFIG_CHECK: nonlinFreeSurf is non-zero'       &   'CONFIG_CHECK: nonlinFreeSurf is non-zero'
86          CALL PRINT_ERROR( msgBuf , 1)          CALL PRINT_ERROR( msgBuf , myThid)
87          STOP 'ABNORMAL END: S/R CONFIG_CHECK'          STOP 'ABNORMAL END: S/R CONFIG_CHECK'
88        ENDIF        ENDIF
89  #endif  #endif
90    
91  C-  check parameter consistency :  #ifndef NONLIN_FRSURF
92          IF (select_rStar .NE. 0) THEN
93            WRITE(msgBuf,'(A)')
94         &   'CONFIG_CHECK: rStar is part of NonLin-FS '
95            CALL PRINT_ERROR( msgBuf, myThid)                      
96            WRITE(msgBuf,'(A)')
97         &   'CONFIG_CHECK: ==> use #define NONLIN_FRSURF to use it'
98            CALL PRINT_ERROR( msgBuf, myThid)                      
99            STOP 'ABNORMAL END: S/R CONFIG_CHECK'
100          ENDIF
101    #endif /* NONLIN_FRSURF */
102    
103  #ifdef USE_NATURAL_BCS  #ifdef USE_NATURAL_BCS
       IF (rigidLid) THEN  
104          WRITE(msgBuf,'(A)')          WRITE(msgBuf,'(A)')
105       &   'CONFIG_CHECK: #define USE_NATURAL_BCS and'       &   'CONFIG_CHECK: USE_NATURAL_BCS option has been replaced'
106          CALL PRINT_ERROR( msgBuf , 1)          CALL PRINT_ERROR( msgBuf , myThid)
107          WRITE(msgBuf,'(A)')          WRITE(msgBuf,'(A)')
108       &   'CONFIG_CHECK: rigidLid are not compatible'       &   'CONFIG_CHECK: by useRealFreshWaterFlux=TRUE in data file'
109          CALL PRINT_ERROR( msgBuf , 1)          CALL PRINT_ERROR( msgBuf , myThid)
110            STOP 'ABNORMAL END: S/R CONFIG_CHECK'
111    #endif
112    
113    C     o If pLoadFile is set, then we should make sure the corresponing
114    C       code is being compiled
115    #ifndef ATMOSPHERIC_LOADING
116          IF (pLoadFile.NE.' ') THEN
117            WRITE(msgBuf,'(A)')
118         &  'CONFIG_CHECK: pLoadFile is set but you have not'
119            CALL PRINT_ERROR( msgBuf , myThid)
120            WRITE(msgBuf,'(A)')
121         &  'compiled the model with the pressure loading code.'
122            CALL PRINT_ERROR( msgBuf , myThid)
123            WRITE(msgBuf,'(A,A)')
124         &  'Re-compile with:  #define ATMOSPHERIC_LOADING',
125         &  '              or  -DATMOSPHERIC_LOADING'
126            CALL PRINT_ERROR( msgBuf , myThid)
127          STOP 'ABNORMAL END: S/R CONFIG_CHECK'          STOP 'ABNORMAL END: S/R CONFIG_CHECK'
128        ENDIF        ENDIF
129        IF (exactConserv) THEN  #endif
130          WRITE(msgBuf,'(A)')  
131       &   'CONFIG_CHECK: #define USE_NATURAL_BCS with'  C     o If taveFreq is finite, then we must make sure the diagnostics
132    C       code is being compiled
133    #ifndef ALLOW_TIMEAVE
134    ceh3 needs an IF ( useTIMEAVE ) THEN
135          IF (taveFreq.NE.0.) THEN
136            WRITE(msgBuf,'(A)')
137         &  'CONFIG_CHECK: taveFreq <> 0  but you have'
138          CALL PRINT_ERROR( msgBuf , 1)          CALL PRINT_ERROR( msgBuf , 1)
139          WRITE(msgBuf,'(A)')          WRITE(msgBuf,'(A)')
140       &   'CONFIG_CHECK: exactConserv not yet implemented'       &  'not compiled the model with the diagnostics routines.'
141            CALL PRINT_ERROR( msgBuf , 1)
142            WRITE(msgBuf,'(A,A)')
143         &  'Re-compile with:  #define ALLOW_TIMEAVE',
144         &  '              or  -DALLOW_TIMEAVE'
145          CALL PRINT_ERROR( msgBuf , 1)          CALL PRINT_ERROR( msgBuf , 1)
146          STOP 'ABNORMAL END: S/R CONFIG_CHECK'          STOP 'ABNORMAL END: S/R CONFIG_CHECK'
147        ENDIF        ENDIF
148  #endif  #endif
149    
150    C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
151    
152    C-  check parameter consistency :
153    
154          IF ( viscA4.NE.0. .AND. (Olx.LT.3 .OR. Oly.LT.3)) THEN
155            WRITE(msgBuf,'(A,A)')
156         &  'CONFIG_CHECK: cannot use Biharmonic Visc. (viscA4) with',
157         &  ' overlap (Olx,Oly) smaller than 3'
158            CALL PRINT_ERROR( msgBuf , myThid)
159            STOP 'ABNORMAL END: S/R CONFIG_CHECK'
160          ENDIF                
161    
162          IF ( rigidLid .AND. implicitFreeSurface ) THEN
163            WRITE(msgBuf,'(A,A)')
164         &  'CONFIG_CHECK: Cannot select both implicitFreeSurface',
165         &  ' and rigidLid.'
166            CALL PRINT_ERROR( msgBuf , myThid)
167            STOP 'ABNORMAL END: S/R CONFIG_CHECK'
168          ENDIF                
169    
170        IF (rigidLid .AND. exactConserv) THEN        IF (rigidLid .AND. exactConserv) THEN
171          WRITE(msgBuf,'(A)')          WRITE(msgBuf,'(A)')
172       &   'CONFIG_CHECK: exactConserv not compatible with'       &   'CONFIG_CHECK: exactConserv not compatible with'
173          CALL PRINT_ERROR( msgBuf , 1)          CALL PRINT_ERROR( msgBuf , myThid)
174          WRITE(msgBuf,'(A)')          WRITE(msgBuf,'(A)')
175       &   'CONFIG_CHECK: rigidLid (meaningless in that case)'       &   'CONFIG_CHECK: rigidLid (meaningless in that case)'
176          CALL PRINT_ERROR( msgBuf , 1)          CALL PRINT_ERROR( msgBuf , myThid)
177            STOP 'ABNORMAL END: S/R CONFIG_CHECK'
178          ENDIF
179    
180          IF (rigidLid .AND. useRealFreshWaterFlux) THEN
181            WRITE(msgBuf,'(A)')
182         &   'CONFIG_CHECK: useRealFreshWaterFlux not compatible with'
183            CALL PRINT_ERROR( msgBuf , myThid)
184            WRITE(msgBuf,'(A)')
185         &   'CONFIG_CHECK: rigidLid (meaningless in that case)'
186            CALL PRINT_ERROR( msgBuf , myThid)
187            STOP 'ABNORMAL END: S/R CONFIG_CHECK'
188          ENDIF
189    
190          IF ( (implicSurfPress.NE.1. .OR. implicDiv2DFlow.NE.1.)
191         &    .AND. nonHydrostatic ) THEN
192            WRITE(msgBuf,'(A,A)') 'CONFIG_CHECK: nonHydrostatic',
193         & ' NOT SAFE with non-fully implicit Barotropic solver'
194            CALL PRINT_ERROR( msgBuf , myThid)
195            WRITE(msgBuf,'(A,A)') 'CONFIG_CHECK: To by-pass this',
196         &    'STOP, comment this test and re-compile config_check'
197            CALL PRINT_ERROR( msgBuf , myThid)
198          STOP 'ABNORMAL END: S/R CONFIG_CHECK'          STOP 'ABNORMAL END: S/R CONFIG_CHECK'
199        ENDIF        ENDIF
200    
201        IF (nonlinFreeSurf.NE.0 .AND. .NOT.exactConserv) THEN        IF (nonlinFreeSurf.NE.0 .AND. .NOT.exactConserv) THEN
202          WRITE(msgBuf,'(A)')          WRITE(msgBuf,'(A)')
203       &   'CONFIG_CHECK: nonlinFreeSurf cannot be used'       &   'CONFIG_CHECK: nonlinFreeSurf cannot be used'
204          CALL PRINT_ERROR( msgBuf , 1)          CALL PRINT_ERROR( msgBuf , myThid)
205          WRITE(msgBuf,'(A)')          WRITE(msgBuf,'(A)')
206       &   'CONFIG_CHECK: without exactConserv'       &   'CONFIG_CHECK: without exactConserv'
207          CALL PRINT_ERROR( msgBuf , 1)          CALL PRINT_ERROR( msgBuf , myThid)
208          STOP 'ABNORMAL END: S/R CONFIG_CHECK'          STOP 'ABNORMAL END: S/R CONFIG_CHECK'
209        ENDIF        ENDIF
210    
211  C- note : not implemented in Release1_beta1 but it's done now (since 01-30-02)        IF (select_rStar.NE.0 .AND. .NOT.exactConserv) THEN
       IF (nonlinFreeSurf.NE.0 .AND. useOBCS ) THEN  
212          WRITE(msgBuf,'(A)')          WRITE(msgBuf,'(A)')
213       &   'CONFIG_CHECK: nonlinFreeSurf not yet implemented'       &   'CONFIG_CHECK: r* Coordinate cannot be used'
214          CALL PRINT_ERROR( msgBuf , 1)          CALL PRINT_ERROR( msgBuf , myThid)
215          WRITE(msgBuf,'(A)')          WRITE(msgBuf,'(A)')
216       &   'CONFIG_CHECK: in OBC package'       &   'CONFIG_CHECK: without exactConserv'
217          CALL PRINT_ERROR( msgBuf , 1)          CALL PRINT_ERROR( msgBuf , myThid)
218          STOP 'ABNORMAL END: S/R CONFIG_CHECK'          STOP 'ABNORMAL END: S/R CONFIG_CHECK'
219        ENDIF        ENDIF
220    
221    C- note : not implemented in checkpoint48b but it's done now (since 01-28-03)
222    c     IF (select_rStar.GT.0 .AND. useOBCS ) THEN
223    c       WRITE(msgBuf,'(A)')
224    c    &   'CONFIG_CHECK: r* Coordinate not yet implemented'
225    c       CALL PRINT_ERROR( msgBuf , 1)
226    c       WRITE(msgBuf,'(A)')
227    c    &   'CONFIG_CHECK: in OBC package'
228    c       CALL PRINT_ERROR( msgBuf , 1)
229    c       STOP 'ABNORMAL END: S/R CONFIG_CHECK'
230    c     ENDIF
231    
232        IF (nonlinFreeSurf.NE.0 .AND. nonHydrostatic) THEN        IF (nonlinFreeSurf.NE.0 .AND. nonHydrostatic) THEN
233          WRITE(msgBuf,'(A)')          WRITE(msgBuf,'(A)')
234       &   'CONFIG_CHECK: nonlinFreeSurf not yet implemented'       &   'CONFIG_CHECK: nonlinFreeSurf not yet implemented'
235          CALL PRINT_ERROR( msgBuf , 1)          CALL PRINT_ERROR( msgBuf , myThid)
236          WRITE(msgBuf,'(A)')          WRITE(msgBuf,'(A)')
237       &   'CONFIG_CHECK: in nonHydrostatic code'       &   'CONFIG_CHECK: in nonHydrostatic code'
238          CALL PRINT_ERROR( msgBuf , 1)          CALL PRINT_ERROR( msgBuf , myThid)
239            STOP 'ABNORMAL END: S/R CONFIG_CHECK'
240          ENDIF
241    
242          IF (nonlinFreeSurf.NE.0.AND.deltaTfreesurf.NE.deltaTtracer) THEN
243            WRITE(msgBuf,'(A)')
244         &   'CONFIG_CHECK: WARNING: nonlinFreeSurf might cause problems'
245            CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
246         &                    SQUEEZE_RIGHT , myThid)                      
247            WRITE(msgBuf,'(A)')
248         &   'CONFIG_CHECK: with different FreeSurf & Tracer time-steps'
249            CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
250         &                    SQUEEZE_RIGHT , myThid)                      
251          ENDIF
252    
253          IF (useRealFreshWaterFlux .AND. exactConserv
254         &    .AND.startTime.NE.0. .AND. implicSurfPress.EQ.0. _d 0) THEN
255            WRITE(msgBuf,'(A)')
256         &   'CONFIG_CHECK: RealFreshWaterFlux+implicSurfP=0+exactConserv:'
257            CALL PRINT_ERROR( msgBuf , myThid)
258            WRITE(msgBuf,'(A)')
259         &   'CONFIG_CHECK: restart not implemented in this config'
260            CALL PRINT_ERROR( msgBuf , myThid)
261            STOP 'ABNORMAL END: S/R CONFIG_CHECK'
262          ENDIF
263    
264    #ifdef NONLIN_FRSURF
265          IF (useRealFreshWaterFlux .AND. .NOT.exactConserv
266         &            .AND. buoyancyRelation.EQ.'OCEANICP' ) THEN
267            WRITE(msgBuf,'(A)')
268         &   'CONFIG_CHECK: RealFreshWaterFlux with OCEANICP'
269            CALL PRINT_ERROR( msgBuf , myThid)
270            WRITE(msgBuf,'(A)')
271         &   'CONFIG_CHECK: requires exactConserv=T'
272            CALL PRINT_ERROR( msgBuf , myThid)
273            STOP 'ABNORMAL END: S/R CONFIG_CHECK'
274          ENDIF
275    #else
276          IF (useRealFreshWaterFlux .AND. exactConserv
277         &            .AND. implicSurfPress.NE.1. _d 0 ) THEN
278            WRITE(msgBuf,'(A)')
279         &   'CONFIG_CHECK: Pb with restart in this config'
280            CALL PRINT_ERROR( msgBuf , myThid)
281            WRITE(msgBuf,'(A)')
282         &   'CONFIG_CHECK: ==> use #define NONLIN_FRSURF to fix it'
283            CALL PRINT_ERROR( msgBuf , myThid)
284            STOP 'ABNORMAL END: S/R CONFIG_CHECK'
285          ENDIF
286    
287          IF (useRealFreshWaterFlux
288         &            .AND. buoyancyRelation.EQ.'OCEANICP' ) THEN
289            WRITE(msgBuf,'(A)')
290         &   'CONFIG_CHECK: E-P effects on wVel are not included'
291            CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
292         &                    SQUEEZE_RIGHT , myThid)                      
293            WRITE(msgBuf,'(A)')
294         &   'CONFIG_CHECK: ==> use #define NONLIN_FRSURF to fix it'
295            CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
296         &                    SQUEEZE_RIGHT , myThid)                      
297          ENDIF
298    #endif /* NONLIN_FRSURF */
299    
300          IF (.NOT.useCDscheme .AND. (tauCD.NE.0. .OR. rCD.NE.-1.) ) THEN
301    C- jmc: since useCDscheme is a new [04-13-03] flag (default=F),
302    C       put this WARNING to stress that even if CD-scheme parameters
303    C       (tauCD,rCD) are set, CD-scheme is not used without useCDscheme=T
304    C-    and STOP if using mom_fluxform (following Chris advise).
305    C- jmc: but ultimately, this block can/will be removed.
306           IF (.NOT.vectorInvariantMomentum.AND.momStepping) THEN
307            WRITE(msgBuf,'(A)')
308         &   'CONFIG_CHECK: CD-scheme is OFF but params(tauCD,rCD) are set'
309            CALL PRINT_ERROR( msgBuf , myThid)
310            WRITE(msgBuf,'(2A)')
311         &   'CONFIG_CHECK: to turn ON CD-scheme: => "useCDscheme=.TRUE."',
312         &   ' in "data", namelist PARM01'
313            CALL PRINT_ERROR( msgBuf , myThid)
314          STOP 'ABNORMAL END: S/R CONFIG_CHECK'          STOP 'ABNORMAL END: S/R CONFIG_CHECK'
315           ENDIF
316            WRITE(msgBuf,'(2A)') '**WARNNING** ',
317         &   'CONFIG_CHECK: CD-scheme is OFF but params(tauCD,rCD) are set'
318            CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
319         &                    SQUEEZE_RIGHT , myThid)                      
320            WRITE(msgBuf,'(2A)')
321         &   'CONFIG_CHECK: to turn ON CD-scheme: => "useCDscheme=.TRUE."',
322         &   ' in "data", namelist PARM01'
323            CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
324         &                    SQUEEZE_RIGHT , myThid)                      
325        ENDIF        ENDIF
326    
327        WRITE(msgBuf,'(A)') 'CONFIG_CHECK: OK'        WRITE(msgBuf,'(A)') 'CONFIG_CHECK: OK'

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.22