1 |
heimbach |
1.40 |
C $Header: /u/gcmpack/MITgcm/model/src/packages_check.F,v 1.39 2007/03/07 00:00:06 jmc Exp $ |
2 |
adcroft |
1.6 |
C $Name: $ |
3 |
adcroft |
1.1 |
|
4 |
edhill |
1.16 |
#include "PACKAGES_CONFIG.h" |
5 |
adcroft |
1.1 |
#include "CPP_OPTIONS.h" |
6 |
|
|
|
7 |
cnh |
1.9 |
CBOP |
8 |
|
|
C !ROUTINE: PACKAGES_CHECK |
9 |
|
|
C !INTERFACE: |
10 |
heimbach |
1.2 |
SUBROUTINE PACKAGES_CHECK( myThid ) |
11 |
cnh |
1.9 |
C !DESCRIPTION: \bv |
12 |
|
|
C *==========================================================* |
13 |
jmc |
1.39 |
C | SUBROUTINE PACKAGES_CHECK |
14 |
|
|
C | o Check runtime activated packages have been built in. |
15 |
cnh |
1.9 |
C *==========================================================* |
16 |
jmc |
1.39 |
C | All packages can be selected/deselected at build time |
17 |
|
|
C | ( when code is compiled ) and activated/deactivated at |
18 |
|
|
C | runtime. This routine does a quick check to trap packages |
19 |
|
|
C | that were activated at runtime but that were not compiled |
20 |
|
|
C | in at build time. |
21 |
cnh |
1.9 |
C *==========================================================* |
22 |
|
|
C \ev |
23 |
|
|
|
24 |
|
|
C !USES: |
25 |
adcroft |
1.1 |
IMPLICIT NONE |
26 |
|
|
C === Global variables === |
27 |
|
|
#include "SIZE.h" |
28 |
|
|
#include "EEPARAMS.h" |
29 |
|
|
#include "PARAMS.h" |
30 |
|
|
|
31 |
cnh |
1.9 |
C !INPUT/OUTPUT PARAMETERS: |
32 |
adcroft |
1.1 |
C === Routine arguments === |
33 |
cnh |
1.9 |
C myThid :: Number of this instances |
34 |
adcroft |
1.1 |
INTEGER myThid |
35 |
|
|
|
36 |
cnh |
1.9 |
C !LOCAL VARIABLES: |
37 |
adcroft |
1.1 |
C === Local variables === |
38 |
jmc |
1.39 |
C msgBuf :: Informational/error meesage buffer |
39 |
|
|
CHARACTER*(MAX_LEN_MBUF) msgBuf |
40 |
cnh |
1.9 |
CEOP |
41 |
adcroft |
1.1 |
|
42 |
jmc |
1.39 |
C--- Start with non-standard packages (without or with non standard flag) |
43 |
|
|
|
44 |
|
|
#ifndef ALLOW_MNC |
45 |
|
|
IF (useMNC) THEN |
46 |
|
|
WRITE(msgBuf,'(2A)') '***WARNING***', |
47 |
|
|
& ' PACKAGES_CHECK: useMNC is TRUE' |
48 |
|
|
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
49 |
|
|
& SQUEEZE_RIGHT , myThid) |
50 |
|
|
WRITE(msgBuf,'(2A)') '***WARNING***', |
51 |
|
|
& ' but pkg/mnc has not been compiled (#undef ALLOW_MNC)' |
52 |
|
|
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
53 |
|
|
& SQUEEZE_RIGHT , myThid) |
54 |
|
|
ENDIF |
55 |
|
|
#endif |
56 |
|
|
|
57 |
|
|
#ifndef ALLOW_MOM_VECINV |
58 |
|
|
IF ( momStepping .AND. vectorInvariantMomentum ) THEN |
59 |
|
|
WRITE(msgBuf,'(2A)') |
60 |
|
|
& 'PACKAGES_CHECK: cannot step forward Momentum', |
61 |
|
|
& ' without pkg/mom_vecinv' |
62 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
63 |
|
|
WRITE(msgBuf,'(2A)') 'PACKAGES_CHECK: ', |
64 |
|
|
& 'Re-compile with pkg "mom_vecinv" in packages.conf' |
65 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
66 |
|
|
STOP 'ABNORMAL END: S/R PACKAGES_CHECK' |
67 |
|
|
ENDIF |
68 |
|
|
#endif |
69 |
|
|
#ifndef ALLOW_MOM_FLUXFORM |
70 |
|
|
IF ( momStepping .AND. .NOT.vectorInvariantMomentum ) THEN |
71 |
|
|
WRITE(msgBuf,'(2A)') |
72 |
|
|
& 'PACKAGES_CHECK: cannot step forward Momentum', |
73 |
|
|
& ' without pkg/mom_fluxform' |
74 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
75 |
|
|
WRITE(msgBuf,'(2A)') 'PACKAGES_CHECK: ', |
76 |
|
|
& 'Re-compile with pkg "mom_fluxform" in packages.conf' |
77 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
78 |
|
|
STOP 'ABNORMAL END: S/R PACKAGES_CHECK' |
79 |
|
|
ENDIF |
80 |
|
|
#endif |
81 |
|
|
|
82 |
|
|
#ifdef ALLOW_GENERIC_ADVDIFF |
83 |
|
|
IF (useGAD) CALL GAD_CHECK( myThid ) |
84 |
|
|
#else |
85 |
|
|
IF ( tempStepping .OR. saltStepping ) THEN |
86 |
|
|
WRITE(msgBuf,'(2A)') |
87 |
|
|
& 'PACKAGES_CHECK: cannot step forward Temp or Salt', |
88 |
|
|
& ' without pkg/generic_advdiff' |
89 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
90 |
|
|
WRITE(msgBuf,'(2A)') 'PACKAGES_CHECK: ', |
91 |
|
|
& 'Re-compile with pkg "generic_advdiff" in packages.conf' |
92 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
93 |
|
|
STOP 'ABNORMAL END: S/R PACKAGES_CHECK' |
94 |
|
|
ENDIF |
95 |
|
|
#endif |
96 |
|
|
|
97 |
|
|
#ifndef ALLOW_CD_CODE |
98 |
|
|
IF (useCDscheme) THEN |
99 |
|
|
WRITE(msgBuf,'(2A)') 'PACKAGES_CHECK: ', |
100 |
|
|
& 'useCDscheme is TRUE but pkg/cd_code has not been compiled' |
101 |
|
|
CALL PRINT_ERROR( msgBuf , myThid) |
102 |
|
|
STOP 'ABNORMAL END: S/R PACKAGES_CHECK' |
103 |
|
|
ENDIF |
104 |
|
|
#endif |
105 |
|
|
|
106 |
|
|
#ifndef ALLOW_MONITOR |
107 |
|
|
C If monitorFreq is finite, make sure the pkg/monitor is being compiled |
108 |
|
|
IF (monitorFreq.NE.0.) THEN |
109 |
|
|
WRITE(msgBuf,'(2A)') 'PACKAGES_CHECK: ', |
110 |
|
|
& 'monitorFreq <> 0 but pkg/monitor has not been compiled' |
111 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
112 |
|
|
WRITE(msgBuf,'(2A)') 'PACKAGES_CHECK: ', |
113 |
|
|
& 'Re-compile with pkg "monitor" in packages.conf' |
114 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
115 |
|
|
STOP 'ABNORMAL END: S/R PACKAGES_CHECK' |
116 |
|
|
ENDIF |
117 |
|
|
#endif |
118 |
|
|
|
119 |
|
|
#ifndef ALLOW_TIMEAVE |
120 |
|
|
C If taveFreq is finite, make sure the pkg/timeave is being compiled |
121 |
|
|
IF (taveFreq.NE.0.) THEN |
122 |
|
|
WRITE(msgBuf,'(2A)') 'PACKAGES_CHECK: ', |
123 |
|
|
& 'taveFreq <> 0 but pkg/timeave has been not compiled' |
124 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
125 |
|
|
WRITE(msgBuf,'(2A)') 'PACKAGES_CHECK: ', |
126 |
|
|
& 'Re-compile with pkg "timeave" in packages.conf' |
127 |
|
|
CALL PRINT_ERROR( msgBuf , 1) |
128 |
|
|
STOP 'ABNORMAL END: S/R PACKAGES_CHECK' |
129 |
|
|
ENDIF |
130 |
|
|
#endif |
131 |
|
|
|
132 |
|
|
C--- Continue with standard packages (with standard usePKG flag) |
133 |
|
|
|
134 |
adcroft |
1.28 |
#ifdef ALLOW_RUNCLOCK |
135 |
|
|
IF (useRunClock) CALL RUNCLOCK_CHECK( myThid ) |
136 |
|
|
#else |
137 |
|
|
IF (useRunClock) CALL PACKAGES_CHECK_ERROR('RUNCLOCK', myThid) |
138 |
|
|
#endif |
139 |
|
|
|
140 |
heimbach |
1.3 |
#ifdef ALLOW_KPP |
141 |
|
|
IF (useKPP) CALL KPP_CHECK( myThid ) |
142 |
adcroft |
1.1 |
#else |
143 |
heimbach |
1.5 |
IF (useKPP) CALL PACKAGES_CHECK_ERROR('KPP', myThid) |
144 |
adcroft |
1.1 |
#endif |
145 |
|
|
|
146 |
mlosch |
1.22 |
#ifdef ALLOW_PP81 |
147 |
|
|
IF (usePP81) CALL PP81_CHECK( myThid ) |
148 |
|
|
#else |
149 |
|
|
IF (usePP81) CALL PACKAGES_CHECK_ERROR('PP81', myThid) |
150 |
|
|
#endif |
151 |
|
|
|
152 |
|
|
#ifdef ALLOW_MY82 |
153 |
|
|
IF (useMY82) CALL MY82_CHECK( myThid ) |
154 |
|
|
#else |
155 |
|
|
IF (useMY82) CALL PACKAGES_CHECK_ERROR('MY82', myThid) |
156 |
|
|
#endif |
157 |
|
|
|
158 |
mlosch |
1.23 |
#ifdef ALLOW_GGL90 |
159 |
|
|
IF (useGGL90) CALL GGL90_CHECK( myThid ) |
160 |
|
|
#else |
161 |
|
|
IF (useGGL90) CALL PACKAGES_CHECK_ERROR('GGL90', myThid) |
162 |
|
|
#endif |
163 |
|
|
|
164 |
|
|
#ifdef ALLOW_OPPS |
165 |
|
|
IF (useOPPS) CALL OPPS_CHECK( myThid ) |
166 |
|
|
#else |
167 |
|
|
IF (useOPPS) CALL PACKAGES_CHECK_ERROR('OPPS', myThid) |
168 |
|
|
#endif |
169 |
|
|
|
170 |
heimbach |
1.3 |
#ifdef ALLOW_GMREDI |
171 |
|
|
IF (useGMRedi) CALL GMREDI_CHECK( myThid ) |
172 |
|
|
#else |
173 |
heimbach |
1.5 |
IF (useGMRedi) CALL PACKAGES_CHECK_ERROR('GMREDI', myThid) |
174 |
adcroft |
1.1 |
#endif |
175 |
|
|
|
176 |
adcroft |
1.6 |
#ifdef ALLOW_OBCS |
177 |
|
|
IF (useOBCS) CALL OBCS_CHECK( myThid ) |
178 |
|
|
#else |
179 |
|
|
IF (useOBCS) CALL PACKAGES_CHECK_ERROR('OBCS', myThid) |
180 |
jmc |
1.17 |
#endif |
181 |
|
|
|
182 |
|
|
#ifndef ALLOW_BULK_FORCE |
183 |
jmc |
1.21 |
IF (useBulkForce) CALL PACKAGES_CHECK_ERROR('BULK?FORCE',myThid) |
184 |
jmc |
1.17 |
#endif |
185 |
|
|
|
186 |
heimbach |
1.40 |
#ifdef ALLOW_THSICE |
187 |
|
|
IF (useThSIce) CALL THSICE_CHECK( myThid ) |
188 |
|
|
#else |
189 |
jmc |
1.21 |
IF (useThSIce) CALL PACKAGES_CHECK_ERROR('THSICE', myThid) |
190 |
jmc |
1.7 |
#endif |
191 |
|
|
|
192 |
jscott |
1.37 |
#ifndef ALLOW_ATM2D |
193 |
|
|
IF (useATM2D) CALL PACKAGES_CHECK_ERROR('ATM2D', myThid) |
194 |
|
|
#endif |
195 |
|
|
|
196 |
jmc |
1.7 |
#ifndef ALLOW_AIM |
197 |
|
|
IF (useAIM) CALL PACKAGES_CHECK_ERROR('AIM', myThid) |
198 |
jmc |
1.14 |
#endif |
199 |
|
|
|
200 |
|
|
#ifndef ALLOW_LAND |
201 |
|
|
IF (useLand) CALL PACKAGES_CHECK_ERROR('LAND', myThid) |
202 |
adcroft |
1.11 |
#endif |
203 |
|
|
|
204 |
|
|
#ifndef ALLOW_PTRACERS |
205 |
|
|
IF (usePTRACERS) CALL PACKAGES_CHECK_ERROR('PTRACERS', myThid) |
206 |
jmc |
1.10 |
#endif |
207 |
|
|
|
208 |
jmc |
1.30 |
#ifndef ALLOW_MATRIX |
209 |
|
|
IF (useMATRIX) CALL PACKAGES_CHECK_ERROR('MATRIX', myThid) |
210 |
|
|
#endif |
211 |
|
|
|
212 |
mlosch |
1.25 |
#ifdef ALLOW_GCHEM |
213 |
|
|
IF (useGCHEM) CALL GCHEM_CHECK( myThid ) |
214 |
|
|
#else |
215 |
|
|
IF (useGCHEM) CALL PACKAGES_CHECK_ERROR('GCHEM', myThid) |
216 |
|
|
#endif |
217 |
|
|
|
218 |
jmc |
1.33 |
#ifndef ALLOW_OFFLINE |
219 |
|
|
IF (useOffLine) CALL PACKAGES_CHECK_ERROR('OFFLINE', myThid) |
220 |
|
|
#endif |
221 |
|
|
|
222 |
jmc |
1.10 |
#ifndef ALLOW_SHAP_FILT |
223 |
|
|
IF (useSHAP_FILT) CALL PACKAGES_CHECK_ERROR('SHAP_FILT', myThid) |
224 |
|
|
#endif |
225 |
|
|
|
226 |
|
|
#ifndef ALLOW_ZONAL_FILT |
227 |
|
|
IF (useZONAL_FILT) CALL PACKAGES_CHECK_ERROR('ZONAL_FILT',myThid) |
228 |
adcroft |
1.8 |
#endif |
229 |
|
|
|
230 |
|
|
#ifndef ALLOW_FLT |
231 |
|
|
IF (useFLT) CALL PACKAGES_CHECK_ERROR('FLT', myThid) |
232 |
dimitri |
1.13 |
#endif |
233 |
|
|
|
234 |
|
|
#ifdef ALLOW_SBO |
235 |
|
|
IF (useSBO) CALL SBO_CHECK( myThid ) |
236 |
|
|
#else |
237 |
|
|
IF (useSBO) CALL PACKAGES_CHECK_ERROR('SBO', myThid) |
238 |
heimbach |
1.12 |
#endif |
239 |
|
|
|
240 |
|
|
#ifdef ALLOW_SEAICE |
241 |
|
|
IF (useSEAICE) CALL SEAICE_CHECK( myThid ) |
242 |
|
|
#else |
243 |
|
|
IF (useSEAICE) CALL PACKAGES_CHECK_ERROR('SEAICE', myThid) |
244 |
edhill |
1.20 |
#endif |
245 |
|
|
|
246 |
mlosch |
1.32 |
#ifdef ALLOW_SHELFICE |
247 |
|
|
IF (useShelfIce) CALL SHELFICE_CHECK( myThid ) |
248 |
|
|
#else |
249 |
|
|
IF (useShelfIce) CALL PACKAGES_CHECK_ERROR('SHELFICE', myThid) |
250 |
|
|
#endif |
251 |
|
|
|
252 |
heimbach |
1.19 |
#ifdef ALLOW_AUTODIFF |
253 |
heimbach |
1.24 |
CALL AUTODIFF_CHECK( myThid ) |
254 |
heimbach |
1.26 |
#endif |
255 |
|
|
|
256 |
|
|
#ifdef ALLOW_CTRL |
257 |
heimbach |
1.15 |
CALL CTRL_CHECK( myThid ) |
258 |
heimbach |
1.26 |
#endif |
259 |
|
|
|
260 |
|
|
#ifdef ALLOW_COST |
261 |
heimbach |
1.15 |
CALL COST_CHECK( myThid ) |
262 |
adcroft |
1.6 |
#endif |
263 |
|
|
|
264 |
heimbach |
1.29 |
#ifdef ALLOW_GRDCHK |
265 |
heimbach |
1.34 |
IF (useGRDCHK) CALL GRDCHK_CHECK( myThid ) |
266 |
heimbach |
1.29 |
#endif |
267 |
|
|
|
268 |
jmc |
1.27 |
#ifdef ALLOW_DIAGNOSTICS |
269 |
|
|
IF (useDiagnostics) CALL DIAGNOSTICS_CHECK( myThid ) |
270 |
|
|
#else |
271 |
jmc |
1.33 |
IF (useDiagnostics) |
272 |
jmc |
1.27 |
& CALL PACKAGES_CHECK_ERROR('DIAGNOSTICS', myThid ) |
273 |
|
|
#endif |
274 |
|
|
|
275 |
edhill |
1.36 |
#ifdef ALLOW_REGRID |
276 |
|
|
IF (useREGRID) CALL REGRID_CHECK( myThid ) |
277 |
|
|
#else |
278 |
|
|
IF (useREGRID) CALL PACKAGES_CHECK_ERROR('REGRID', myThid) |
279 |
|
|
#endif |
280 |
|
|
|
281 |
heimbach |
1.35 |
#ifdef ALLOW_MYPACKAGE |
282 |
|
|
IF (useMYPACKAGE) CALL MYPACKAGE_CHECK( myThid ) |
283 |
|
|
#else |
284 |
|
|
IF (useMYPACKAGE) CALL PACKAGES_CHECK_ERROR('MYPACKAGE', myThid) |
285 |
|
|
#endif |
286 |
|
|
|
287 |
adcroft |
1.6 |
RETURN |
288 |
|
|
END |