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

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

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

revision 1.33 by jmc, Fri Mar 17 03:55:43 2006 UTC revision 1.49 by jmc, Sat Mar 13 00:26:21 2010 UTC
# Line 10  C     !INTERFACE: Line 10  C     !INTERFACE:
10        SUBROUTINE PACKAGES_CHECK( myThid )        SUBROUTINE PACKAGES_CHECK( myThid )
11  C     !DESCRIPTION: \bv  C     !DESCRIPTION: \bv
12  C     *==========================================================*  C     *==========================================================*
13  C     | SUBROUTINE PACKAGES_CHECK                                  C     | SUBROUTINE PACKAGES_CHECK
14  C     | o Check runtime activated packages have been built in.      C     | o Check runtime activated packages have been built in.
15  C     *==========================================================*  C     *==========================================================*
16  C     | All packages can be selected/deselected at build time      C     | All packages can be selected/deselected at build time
17  C     | ( when code is compiled ) and activated/deactivated at      C     | ( when code is compiled ) and activated/deactivated at
18  C     | runtime. This routine does a quick check to trap packages  C     | runtime. This routine does a quick check to trap packages
19  C     | that were activated at runtime but that were not compiled  C     | that were activated at runtime but that were not compiled
20  C     | in at build time.                                          C     | in at build time.
21  C     *==========================================================*  C     *==========================================================*
22  C     \ev  C     \ev
23    
# Line 35  C     myThid ::  Number of this instance Line 35  C     myThid ::  Number of this instance
35    
36  C     !LOCAL VARIABLES:  C     !LOCAL VARIABLES:
37  C     === Local variables ===  C     === Local variables ===
38  C     msgBuf      :: Informational/error meesage buffer  C     msgBuf :: Informational/error message buffer
39  c     CHARACTER*(MAX_LEN_MBUF) msgBuf        CHARACTER*(MAX_LEN_MBUF) msgBuf
40  CEOP  CEOP
41    
42          WRITE(msgBuf,'(A)')
43         &'== Packages configuration : Check & print summary =='
44          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
45         &                    SQUEEZE_RIGHT, myThid )
46          WRITE(msgBuf,'(A)') ' '
47          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
48         &                    SQUEEZE_RIGHT, myThid )
49    
50    C---  Start with non-standard packages (without or with non standard flag)
51    
52    #ifndef ALLOW_MNC
53          IF (useMNC) THEN
54            WRITE(msgBuf,'(2A)') '***WARNING***',
55         &   ' PACKAGES_CHECK: useMNC is TRUE'
56            CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
57         &       SQUEEZE_RIGHT , myThid)
58            WRITE(msgBuf,'(2A)') '***WARNING***',
59         &   ' but pkg/mnc has not been compiled (#undef ALLOW_MNC)'
60            CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
61         &       SQUEEZE_RIGHT , myThid)
62          ENDIF
63    #endif
64    
65    #ifndef ALLOW_MOM_VECINV
66          IF ( momStepping .AND. vectorInvariantMomentum ) THEN
67            WRITE(msgBuf,'(2A)')
68         &   'PACKAGES_CHECK: cannot step forward Momentum',
69         &   ' without pkg/mom_vecinv'
70            CALL PRINT_ERROR( msgBuf , myThid )
71            WRITE(msgBuf,'(2A)') 'PACKAGES_CHECK: ',
72         &   'Re-compile with pkg "mom_vecinv" in packages.conf'
73            CALL PRINT_ERROR( msgBuf , myThid )
74            STOP 'ABNORMAL END: S/R PACKAGES_CHECK'
75          ENDIF
76    #endif
77    #ifndef ALLOW_MOM_FLUXFORM
78          IF ( momStepping .AND. .NOT.vectorInvariantMomentum ) THEN
79            WRITE(msgBuf,'(2A)')
80         &   'PACKAGES_CHECK: cannot step forward Momentum',
81         &   ' without pkg/mom_fluxform'
82            CALL PRINT_ERROR( msgBuf , myThid )
83            WRITE(msgBuf,'(2A)') 'PACKAGES_CHECK: ',
84         &   'Re-compile with pkg "mom_fluxform" in packages.conf'
85            CALL PRINT_ERROR( msgBuf , myThid )
86            STOP 'ABNORMAL END: S/R PACKAGES_CHECK'
87          ENDIF
88    #endif
89    
90    #ifdef ALLOW_GENERIC_ADVDIFF
91          IF (useGAD) CALL GAD_CHECK( myThid )
92    #else
93          IF ( tempStepping .OR. saltStepping ) THEN
94            WRITE(msgBuf,'(2A)')
95         &  'PACKAGES_CHECK: cannot step forward Temp or Salt',
96         &  ' without pkg/generic_advdiff'
97            CALL PRINT_ERROR( msgBuf , myThid )
98            WRITE(msgBuf,'(2A)') 'PACKAGES_CHECK: ',
99         &  'Re-compile with pkg "generic_advdiff" in packages.conf'
100            CALL PRINT_ERROR( msgBuf , myThid )
101            STOP 'ABNORMAL END: S/R PACKAGES_CHECK'
102          ENDIF
103    #endif
104    
105    #ifndef ALLOW_MONITOR
106    C     If monitorFreq is finite, make sure the pkg/monitor is being compiled
107          IF (monitorFreq.NE.0.) CALL PACKAGES_ERROR_MSG(
108         &                  'MONITOR', 'monitorFreq <> 0', myThid )
109    #endif
110    
111    #ifndef ALLOW_TIMEAVE
112    C     If taveFreq is finite, make sure the pkg/timeave is being compiled
113          IF (taveFreq.NE.0.) CALL PACKAGES_ERROR_MSG(
114         &                  'TIMEAVE', 'taveFreq <> 0', myThid )
115    #endif
116    
117    #ifndef ALLOW_CD_CODE
118          IF (useCDscheme) CALL PACKAGES_ERROR_MSG(
119         &                  'CD_CODE', 'useCDscheme=.T.', myThid )
120    #endif
121    
122    C---  Continue with standard packages (with standard usePKG flag)
123    
124  #ifdef ALLOW_RUNCLOCK  #ifdef ALLOW_RUNCLOCK
125        IF (useRunClock) CALL RUNCLOCK_CHECK( myThid )        IF (useRunClock) CALL RUNCLOCK_CHECK( myThid )
126  #else  #else
127        IF (useRunClock) CALL PACKAGES_CHECK_ERROR('RUNCLOCK', myThid)        IF (useRunClock) CALL PACKAGES_ERROR_MSG('RunClock',' ',myThid)
128  #endif  #endif
129    
130  #ifdef ALLOW_KPP  #ifdef ALLOW_KPP
131        IF (useKPP) CALL KPP_CHECK( myThid )        IF (useKPP) CALL KPP_CHECK( myThid )
132  #else  #else
133        IF (useKPP) CALL PACKAGES_CHECK_ERROR('KPP', myThid)        IF (useKPP) CALL PACKAGES_ERROR_MSG('KPP',' ',myThid)
134  #endif  #endif
135    
136  #ifdef ALLOW_PP81  #ifdef ALLOW_PP81
137        IF (usePP81) CALL PP81_CHECK( myThid )        IF (usePP81) CALL PP81_CHECK( myThid )
138  #else  #else
139        IF (usePP81) CALL PACKAGES_CHECK_ERROR('PP81', myThid)        IF (usePP81) CALL PACKAGES_ERROR_MSG('PP81',' ',myThid)
140  #endif  #endif
141    
142  #ifdef ALLOW_MY82  #ifdef ALLOW_MY82
143        IF (useMY82) CALL MY82_CHECK( myThid )        IF (useMY82) CALL MY82_CHECK( myThid )
144  #else  #else
145        IF (useMY82) CALL PACKAGES_CHECK_ERROR('MY82', myThid)        IF (useMY82) CALL PACKAGES_ERROR_MSG('MY82',' ',myThid)
146  #endif  #endif
147    
148  #ifdef ALLOW_GGL90  #ifdef ALLOW_GGL90
149        IF (useGGL90) CALL GGL90_CHECK( myThid )        IF (useGGL90) CALL GGL90_CHECK( myThid )
150  #else  #else
151        IF (useGGL90) CALL PACKAGES_CHECK_ERROR('GGL90', myThid)        IF (useGGL90) CALL PACKAGES_ERROR_MSG('GGL90',' ',myThid)
152  #endif  #endif
153    
154  #ifdef ALLOW_OPPS  #ifdef ALLOW_OPPS
155        IF (useOPPS) CALL OPPS_CHECK( myThid )        IF (useOPPS) CALL OPPS_CHECK( myThid )
156  #else  #else
157        IF (useOPPS) CALL PACKAGES_CHECK_ERROR('OPPS', myThid)        IF (useOPPS) CALL PACKAGES_ERROR_MSG('OPPS',' ',myThid)
158  #endif  #endif
159    
160  #ifdef ALLOW_GMREDI  #ifdef ALLOW_GMREDI
161        IF (useGMRedi) CALL GMREDI_CHECK( myThid )        IF (useGMRedi) CALL GMREDI_CHECK( myThid )
162  #else  #else
163        IF (useGMRedi) CALL PACKAGES_CHECK_ERROR('GMREDI', myThid)        IF (useGMRedi) CALL PACKAGES_ERROR_MSG('GMRedi',' ',myThid)
164    #endif
165    
166    #ifndef ALLOW_DOWN_SLOPE
167          IF (useDOWN_SLOPE)
168         &            CALL PACKAGES_ERROR_MSG('DOWN_SLOPE',' ',myThid)
169  #endif  #endif
170    
171  #ifdef ALLOW_OBCS  #ifdef ALLOW_OBCS
172        IF (useOBCS) CALL OBCS_CHECK( myThid )        IF (useOBCS) CALL OBCS_CHECK( myThid )
173  #else  #else
174        IF (useOBCS) CALL PACKAGES_CHECK_ERROR('OBCS', myThid)        IF (useOBCS) CALL PACKAGES_ERROR_MSG('OBCS',' ',myThid)
175    #endif
176    
177    #ifndef ALLOW_EXF
178          IF (useEXF) CALL PACKAGES_ERROR_MSG('EXF',' ',myThid)
179  #endif  #endif
180    
181  #ifndef ALLOW_BULK_FORCE  #ifndef ALLOW_BULK_FORCE
182        IF (useBulkForce) CALL PACKAGES_CHECK_ERROR('BULK?FORCE',myThid)        IF (useBulkForce) CALL PACKAGES_ERROR_MSG(
183         &                  'BULK_FORCE', 'useBulkForce=.T.', myThid )
184  #endif  #endif
185    
186  #ifndef ALLOW_THSICE  #ifndef ALLOW_EBM
187        IF (useThSIce) CALL PACKAGES_CHECK_ERROR('THSICE', myThid)        IF (useEBM) CALL PACKAGES_ERROR_MSG('EBM',' ',myThid)
188    #endif
189    
190    #ifndef ALLOW_CHEAPAML
191          IF (useCheapAML) CALL PACKAGES_ERROR_MSG('CheapAML',' ',myThid)
192    #endif
193    
194    #ifdef ALLOW_THSICE
195          IF (useThSIce) CALL THSICE_CHECK( myThid )
196    #else
197          IF (useThSIce) CALL PACKAGES_ERROR_MSG('ThSIce',' ',myThid)
198    #endif
199    
200    #ifndef ALLOW_ATM2D
201          IF (useATM2D) CALL PACKAGES_ERROR_MSG('ATM2D',' ',myThid)
202  #endif  #endif
203    
204  #ifndef ALLOW_AIM  #ifndef ALLOW_AIM
205        IF (useAIM) CALL PACKAGES_CHECK_ERROR('AIM', myThid)        IF (useAIM) CALL PACKAGES_ERROR_MSG('AIM',' ',myThid)
206  #endif  #endif
207    
208  #ifndef ALLOW_LAND  #ifndef ALLOW_LAND
209        IF (useLand) CALL PACKAGES_CHECK_ERROR('LAND', myThid)        IF (useLand) CALL PACKAGES_ERROR_MSG('Land',' ',myThid)
210  #endif  #endif
211    
212  #ifndef ALLOW_PTRACERS  #ifndef ALLOW_FIZHI
213        IF (usePTRACERS) CALL PACKAGES_CHECK_ERROR('PTRACERS', myThid)        IF (useFizhi) CALL PACKAGES_ERROR_MSG('Fizhi',' ',myThid)
214  #endif  #endif
215    
216  #ifndef ALLOW_MATRIX  #ifndef ALLOW_GRIDALT
217        IF (useMATRIX) CALL PACKAGES_CHECK_ERROR('MATRIX', myThid)        IF (useGridAlt) CALL PACKAGES_ERROR_MSG('GridAlt',' ',myThid)
218    #endif
219    
220    #ifndef ALLOW_PTRACERS
221          IF (usePTRACERS) CALL PACKAGES_ERROR_MSG('PTRACERS',' ',myThid)
222  #endif  #endif
223    
224  #ifdef ALLOW_GCHEM  #ifdef ALLOW_GCHEM
225        IF (useGCHEM) CALL GCHEM_CHECK( myThid )        IF (useGCHEM) CALL GCHEM_CHECK( myThid )
226  #else  #else
227        IF (useGCHEM) CALL PACKAGES_CHECK_ERROR('GCHEM', myThid)        IF (useGCHEM) CALL PACKAGES_ERROR_MSG('GCHEM',' ',myThid)
228    #endif
229    
230    #ifndef ALLOW_RBCS
231          IF (useRBCS) CALL PACKAGES_ERROR_MSG('RBCS',' ',myThid)
232  #endif  #endif
233    
234  #ifndef ALLOW_OFFLINE  #ifndef ALLOW_OFFLINE
235        IF (useOffLine) CALL PACKAGES_CHECK_ERROR('OFFLINE', myThid)        IF (useOffLine) CALL PACKAGES_ERROR_MSG('OffLine',' ',myThid)
236    #endif
237    
238    #ifndef ALLOW_MATRIX
239          IF (useMATRIX) CALL PACKAGES_ERROR_MSG('MATRIX',' ',myThid)
240  #endif  #endif
241    
242  #ifndef ALLOW_SHAP_FILT  #ifndef ALLOW_SHAP_FILT
243        IF (useSHAP_FILT) CALL PACKAGES_CHECK_ERROR('SHAP_FILT', myThid)        IF (useSHAP_FILT)
244         &   CALL PACKAGES_ERROR_MSG( 'SHAP_FILT', ' ', myThid )
245  #endif  #endif
246    
247  #ifndef ALLOW_ZONAL_FILT  #ifndef ALLOW_ZONAL_FILT
248        IF (useZONAL_FILT) CALL PACKAGES_CHECK_ERROR('ZONAL_FILT',myThid)        IF (useZONAL_FILT)
249         &   CALL PACKAGES_ERROR_MSG( 'ZONAL_FILT', ' ', myThid )
250  #endif  #endif
251    
252  #ifndef ALLOW_FLT  #ifndef ALLOW_FLT
253        IF (useFLT) CALL PACKAGES_CHECK_ERROR('FLT', myThid)        IF (useFLT) CALL PACKAGES_ERROR_MSG('FLT',' ',myThid)
254  #endif  #endif
255    
256  #ifdef ALLOW_SBO  #ifdef ALLOW_SBO
257        IF (useSBO) CALL SBO_CHECK( myThid )        IF (useSBO) CALL SBO_CHECK( myThid )
258  #else  #else
259        IF (useSBO) CALL PACKAGES_CHECK_ERROR('SBO', myThid)        IF (useSBO) CALL PACKAGES_ERROR_MSG('SBO',' ',myThid)
260  #endif  #endif
261    
262  #ifdef ALLOW_SEAICE  #ifdef ALLOW_SEAICE
263        IF (useSEAICE) CALL SEAICE_CHECK( myThid )        IF (useSEAICE) CALL SEAICE_CHECK( myThid )
264  #else  #else
265        IF (useSEAICE) CALL PACKAGES_CHECK_ERROR('SEAICE', myThid)        IF (useSEAICE) CALL PACKAGES_ERROR_MSG('SEAICE',' ',myThid)
266    #endif
267    
268    #ifdef ALLOW_SALT_PLUME
269          IF (useSALT_PLUME)CALL SALT_PLUME_CHECK( myThid )
270    #else
271          IF (useSALT_PLUME)CALL PACKAGES_ERROR_MSG('SALT_PLUME',' ',myThid)
272  #endif  #endif
273    
274  #ifdef ALLOW_SHELFICE  #ifdef ALLOW_SHELFICE
275        IF (useShelfIce) CALL SHELFICE_CHECK( myThid )        IF (useShelfIce) CALL SHELFICE_CHECK( myThid )
276  #else  #else
277        IF (useShelfIce) CALL PACKAGES_CHECK_ERROR('SHELFICE', myThid)        IF (useShelfIce) CALL PACKAGES_ERROR_MSG('ShelfIce',' ',myThid)
278  #endif  #endif
279    
280  #ifndef ALLOW_CD_CODE  #ifdef ALLOW_ICEFRONT
281        IF (useCDscheme) CALL PACKAGES_CHECK_ERROR('CD_CODE', myThid)        IF (useICEFRONT) CALL ICEFRONT_CHECK( myThid )
282    #else
283          IF (useICEFRONT) CALL PACKAGES_ERROR_MSG('ICEFRONT',' ',myThid)
284  #endif  #endif
285    
286  #ifdef ALLOW_AUTODIFF  #ifdef ALLOW_AUTODIFF
# Line 168  CEOP Line 296  CEOP
296  #endif  #endif
297    
298  #ifdef ALLOW_GRDCHK  #ifdef ALLOW_GRDCHK
299        CALL GRDCHK_CHECK( myThid )        IF (useGRDCHK) CALL GRDCHK_CHECK( myThid )
300    #endif
301    
302    #ifndef ALLOW_SMOOTH
303          IF (useSMOOTH) CALL PACKAGES_ERROR_MSG('SMOOTH',' ',myThid)
304  #endif  #endif
305    
306  #ifdef ALLOW_DIAGNOSTICS  #ifdef ALLOW_DIAGNOSTICS
307        IF (useDiagnostics) CALL DIAGNOSTICS_CHECK( myThid )        IF (useDiagnostics) CALL DIAGNOSTICS_CHECK( myThid )
308  #else  #else
309        IF (useDiagnostics)        IF (useDiagnostics)
310       &   CALL PACKAGES_CHECK_ERROR('DIAGNOSTICS', myThid )       &   CALL PACKAGES_ERROR_MSG( 'Diagnostics', ' ', myThid )
311    #endif
312    
313    #ifdef ALLOW_REGRID
314          IF (useREGRID) CALL REGRID_CHECK( myThid )
315    #else
316          IF (useREGRID) CALL PACKAGES_ERROR_MSG('REGRID',' ',myThid)
317    #endif
318    
319    #ifdef ALLOW_LAYERS
320          IF ( useLayers ) CALL LAYERS_CHECK( myThid )
321    #else
322          IF ( useLayers ) CALL PACKAGES_ERROR_MSG('LAYERS',' ',myThid)
323    #endif /* ALLOW_LAYERS */
324    
325    #ifdef ALLOW_NEST_CHILD
326          IF (useNEST_CHILD) CALL NEST_CHILD_CHECK( myThid )
327    #else
328          IF (useNEST_CHILD) CALL PACKAGES_ERROR_MSG(
329         & 'NEST_CHILD',' ',myThid)
330    #endif
331    
332    #ifdef ALLOW_NEST_PARENT
333          IF (useNEST_PARENT) CALL NEST_PARENT_CHECK( myThid )
334    #else
335          IF (useNEST_PARENT) CALL PACKAGES_ERROR_MSG(
336         & 'NEST_PARENT',' ',myThid)
337    #endif
338    
339    #ifndef ALLOW_EMBED_FILES
340          IF (useEMBED_FILES) CALL PACKAGES_ERROR_MSG(
341         &                                  'EMBED_FILES',' ',myThid)
342  #endif  #endif
343    
344    #ifdef ALLOW_MYPACKAGE
345          IF (useMYPACKAGE) CALL MYPACKAGE_CHECK( myThid )
346    #else
347          IF (useMYPACKAGE) CALL PACKAGES_ERROR_MSG('MYPACKAGE',' ',myThid)
348    #endif
349    
350    #ifdef ALLOW_ECCO
351          CALL ECCO_CHECK( myThid )
352    #endif
353    
354    C---  Exclusive packages (which cannot be used together):
355          IF ( useEXF .AND. useBulkForce ) THEN
356            WRITE(msgBuf,'(2A)') 'PACKAGES_CHECK: ',
357         &  'both useEXF and useBulkForce are set'
358            CALL PRINT_ERROR( msgBuf , myThid )
359            WRITE(msgBuf,'(2A)') 'PACKAGES_CHECK: ',
360         &  ' but cannot be used together => need to select only one.'
361            CALL PRINT_ERROR( msgBuf , myThid )
362            STOP 'ABNORMAL END: S/R PACKAGES_CHECK'
363          ENDIF
364    
365        RETURN        RETURN
366        END        END

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

  ViewVC Help
Powered by ViewVC 1.1.22