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

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

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


Revision 1.9.2.1 - (hide annotations) (download)
Thu Oct 2 18:10:45 2003 UTC (20 years, 7 months ago) by edhill
Branch: branch-genmake2
Changes since 1.9: +3 -1 lines
 o included PACKAGES_CONFIG.h in all files where the ALLOW_${PKG_NAME}
     defines are used
 o added comments where IF ( use${PKG_NAME} ) statements will probably
     be needed -- or need to be edited

1 edhill 1.9.2.1 C $Header: /u/u3/gcmpack/MITgcm/model/src/config_check.F,v 1.9 2003/04/17 13:16:23 jmc Exp $
2 jmc 1.1 C $Name: $
3    
4 edhill 1.9.2.1 #include "PACKAGES_CONFIG.h"
5 jmc 1.1 #include "CPP_OPTIONS.h"
6    
7     CBOP
8     C !ROUTINE: CONFIG_CHECK
9     C !INTERFACE:
10     SUBROUTINE CONFIG_CHECK( myThid )
11     C !DESCRIPTION: \bv
12     C *=========================================================*
13     C | SUBROUTINE CONFIG_CHECK
14     C | o Check model parameter settings.
15     C *=========================================================*
16     C | This routine help to prevent the use of parameters
17     C | that are not compatible with the model configuration.
18     C *=========================================================*
19     C \ev
20    
21     C !USES:
22     IMPLICIT NONE
23     C === Global variables ===
24     #include "SIZE.h"
25     #include "EEPARAMS.h"
26     #include "PARAMS.h"
27     c #include "GRID.h"
28    
29     C !INPUT/OUTPUT PARAMETERS:
30     C === Routine arguments ===
31     C myThid - Number of this instances of CONFIG_CHECK
32     INTEGER myThid
33     CEndOfInterface
34    
35     C !LOCAL VARIABLES:
36     C == Local variables ==
37     C msgBuf :: Informational/error meesage buffer
38     CHARACTER*(MAX_LEN_MBUF) msgBuf
39     CEOP
40    
41     C- check that CPP option is "defined" when running-flag parameter is on:
42    
43 jmc 1.9 #ifndef INCLUDE_CD_CODE
44     IF (useCDscheme) THEN
45     WRITE(msgBuf,'(A)')
46     & 'CONFIG_CHECK: #undef INCLUDE_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 jmc 1.1 #ifndef ALLOW_NONHYDROSTATIC
56     IF (nonHydrostatic) THEN
57     WRITE(msgBuf,'(A)')
58     & 'CONFIG_CHECK: #undef ALLOW_NONHYDROSTATIC and'
59 jmc 1.3 CALL PRINT_ERROR( msgBuf , myThid)
60 jmc 1.1 WRITE(msgBuf,'(A)')
61     & 'CONFIG_CHECK: nonHydrostatic is TRUE'
62 jmc 1.3 CALL PRINT_ERROR( msgBuf , myThid)
63 jmc 1.1 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
64     ENDIF
65     #endif
66    
67     #ifndef EXACT_CONSERV
68     IF (exactConserv) THEN
69     WRITE(msgBuf,'(A)')
70     & 'CONFIG_CHECK: #undef EXACT_CONSERV and'
71 jmc 1.3 CALL PRINT_ERROR( msgBuf , myThid)
72 jmc 1.1 WRITE(msgBuf,'(A)')
73     & 'CONFIG_CHECK: exactConserv is TRUE'
74 jmc 1.3 CALL PRINT_ERROR( msgBuf , myThid)
75 jmc 1.1 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
76     ENDIF
77     #endif
78    
79     #ifndef NONLIN_FRSURF
80     IF (nonlinFreeSurf.NE.0) THEN
81     WRITE(msgBuf,'(A)')
82     & 'CONFIG_CHECK: #undef NONLIN_FRSURF and'
83 jmc 1.3 CALL PRINT_ERROR( msgBuf , myThid)
84 jmc 1.1 WRITE(msgBuf,'(A)')
85     & 'CONFIG_CHECK: nonlinFreeSurf is non-zero'
86 jmc 1.3 CALL PRINT_ERROR( msgBuf , myThid)
87 jmc 1.1 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
88     ENDIF
89     #endif
90    
91 jmc 1.9 #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 jmc 1.1 #ifdef USE_NATURAL_BCS
104     WRITE(msgBuf,'(A)')
105 jmc 1.3 & 'CONFIG_CHECK: USE_NATURAL_BCS option has been replaced'
106     CALL PRINT_ERROR( msgBuf , myThid)
107 jmc 1.1 WRITE(msgBuf,'(A)')
108 jmc 1.3 & 'CONFIG_CHECK: by useRealFreshWaterFlux=TRUE in data file'
109     CALL PRINT_ERROR( msgBuf , myThid)
110 jmc 1.1 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
111 jmc 1.3 #endif
112    
113 jmc 1.4 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'
128     ENDIF
129     #endif
130    
131     C o If taveFreq is finite, then we must make sure the diagnostics
132     C code is being compiled
133     #ifndef ALLOW_TIMEAVE
134 edhill 1.9.2.1 ceh3 needs an IF ( useTIMEAVE ) THEN
135 jmc 1.4 IF (taveFreq.NE.0.) THEN
136     WRITE(msgBuf,'(A)')
137     & 'CONFIG_CHECK: taveFreq <> 0 but you have'
138     CALL PRINT_ERROR( msgBuf , 1)
139     WRITE(msgBuf,'(A)')
140     & '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)
146     STOP 'ABNORMAL END: S/R CONFIG_CHECK'
147     ENDIF
148     #endif
149    
150 jmc 1.3 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
151    
152     C- check parameter consistency :
153 jmc 1.8
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 jmc 1.3
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
171 jmc 1.1 WRITE(msgBuf,'(A)')
172 jmc 1.3 & 'CONFIG_CHECK: exactConserv not compatible with'
173     CALL PRINT_ERROR( msgBuf , myThid)
174 jmc 1.1 WRITE(msgBuf,'(A)')
175 jmc 1.3 & 'CONFIG_CHECK: rigidLid (meaningless in that case)'
176     CALL PRINT_ERROR( msgBuf , myThid)
177 jmc 1.1 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
178     ENDIF
179    
180 jmc 1.3 IF (rigidLid .AND. useRealFreshWaterFlux) THEN
181 jmc 1.1 WRITE(msgBuf,'(A)')
182 jmc 1.3 & 'CONFIG_CHECK: useRealFreshWaterFlux not compatible with'
183     CALL PRINT_ERROR( msgBuf , myThid)
184 jmc 1.1 WRITE(msgBuf,'(A)')
185     & 'CONFIG_CHECK: rigidLid (meaningless in that case)'
186 jmc 1.3 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 jmc 1.1 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
199     ENDIF
200    
201     IF (nonlinFreeSurf.NE.0 .AND. .NOT.exactConserv) THEN
202     WRITE(msgBuf,'(A)')
203     & 'CONFIG_CHECK: nonlinFreeSurf cannot be used'
204 jmc 1.3 CALL PRINT_ERROR( msgBuf , myThid)
205 jmc 1.1 WRITE(msgBuf,'(A)')
206     & 'CONFIG_CHECK: without exactConserv'
207 jmc 1.3 CALL PRINT_ERROR( msgBuf , myThid)
208 jmc 1.1 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
209     ENDIF
210    
211 jmc 1.6 IF (select_rStar.NE.0 .AND. .NOT.exactConserv) THEN
212     WRITE(msgBuf,'(A)')
213     & 'CONFIG_CHECK: r* Coordinate cannot be used'
214     CALL PRINT_ERROR( msgBuf , myThid)
215     WRITE(msgBuf,'(A)')
216     & 'CONFIG_CHECK: without exactConserv'
217     CALL PRINT_ERROR( msgBuf , myThid)
218     STOP 'ABNORMAL END: S/R CONFIG_CHECK'
219     ENDIF
220    
221 jmc 1.7 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 jmc 1.1
232     IF (nonlinFreeSurf.NE.0 .AND. nonHydrostatic) THEN
233     WRITE(msgBuf,'(A)')
234     & 'CONFIG_CHECK: nonlinFreeSurf not yet implemented'
235 jmc 1.3 CALL PRINT_ERROR( msgBuf , myThid)
236 jmc 1.1 WRITE(msgBuf,'(A)')
237     & 'CONFIG_CHECK: in nonHydrostatic code'
238 jmc 1.3 CALL PRINT_ERROR( msgBuf , myThid)
239 jmc 1.1 STOP 'ABNORMAL END: S/R CONFIG_CHECK'
240     ENDIF
241 jmc 1.3
242 jmc 1.4 IF (nonlinFreeSurf.NE.0.AND.deltaTfreesurf.NE.deltaTtracer) THEN
243 jmc 1.3 WRITE(msgBuf,'(A)')
244 jmc 1.4 & '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 jmc 1.3 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 jmc 1.4 #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 jmc 1.3 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 jmc 1.4
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 jmc 1.5 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
296     & SQUEEZE_RIGHT , myThid)
297     ENDIF
298 jmc 1.9 #endif /* NONLIN_FRSURF */
299 jmc 1.5
300 jmc 1.9 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'
315     ENDIF
316     WRITE(msgBuf,'(2A)') '**WARNNING** ',
317     & 'CONFIG_CHECK: CD-scheme is OFF but params(tauCD,rCD) are set'
318 jmc 1.5 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
319     & SQUEEZE_RIGHT , myThid)
320 jmc 1.9 WRITE(msgBuf,'(2A)')
321     & 'CONFIG_CHECK: to turn ON CD-scheme: => "useCDscheme=.TRUE."',
322     & ' in "data", namelist PARM01'
323 jmc 1.4 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
324     & SQUEEZE_RIGHT , myThid)
325     ENDIF
326 jmc 1.1
327     WRITE(msgBuf,'(A)') 'CONFIG_CHECK: OK'
328     CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,
329     & SQUEEZE_RIGHT,myThid)
330    
331     RETURN
332     END

  ViewVC Help
Powered by ViewVC 1.1.22