1 |
jmc |
1.74 |
C $Header: /u/gcmpack/MITgcm/model/src/config_check.F,v 1.73 2013/07/30 18:51:01 jmc Exp $ |
2 |
jmc |
1.1 |
C $Name: $ |
3 |
|
|
|
4 |
edhill |
1.10 |
#include "PACKAGES_CONFIG.h" |
5 |
jmc |
1.1 |
#include "CPP_OPTIONS.h" |
6 |
jmc |
1.73 |
#ifdef ALLOW_MOM_COMMON |
7 |
|
|
# include "MOM_COMMON_OPTIONS.h" |
8 |
|
|
#endif |
9 |
jmc |
1.1 |
|
10 |
|
|
CBOP |
11 |
|
|
C !ROUTINE: CONFIG_CHECK |
12 |
|
|
C !INTERFACE: |
13 |
|
|
SUBROUTINE CONFIG_CHECK( myThid ) |
14 |
|
|
C !DESCRIPTION: \bv |
15 |
|
|
C *=========================================================* |
16 |
|
|
C | SUBROUTINE CONFIG_CHECK |
17 |
|
|
C | o Check model parameter settings. |
18 |
|
|
C *=========================================================* |
19 |
|
|
C | This routine help to prevent the use of parameters |
20 |
|
|
C | that are not compatible with the model configuration. |
21 |
|
|
C *=========================================================* |
22 |
jmc |
1.33 |
C \ev |
23 |
jmc |
1.1 |
|
24 |
|
|
C !USES: |
25 |
|
|
IMPLICIT NONE |
26 |
|
|
C === Global variables === |
27 |
|
|
#include "SIZE.h" |
28 |
|
|
#include "EEPARAMS.h" |
29 |
|
|
#include "PARAMS.h" |
30 |
|
|
|
31 |
|
|
C !INPUT/OUTPUT PARAMETERS: |
32 |
|
|
C === Routine arguments === |
33 |
|
|
C myThid - Number of this instances of CONFIG_CHECK |
34 |
|
|
INTEGER myThid |
35 |
|
|
CEndOfInterface |
36 |
|
|
|
37 |
|
|
C !LOCAL VARIABLES: |
38 |
|
|
C == Local variables == |
39 |
jmc |
1.53 |
C msgBuf :: Informational/error message buffer |
40 |
jmc |
1.1 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
41 |
jmc |
1.61 |
INTEGER errCount |
42 |
jmc |
1.1 |
CEOP |
43 |
|
|
|
44 |
jmc |
1.69 |
_BEGIN_MASTER(myThid) |
45 |
|
|
WRITE(msgBuf,'(A)') |
46 |
|
|
&'// =======================================================' |
47 |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
48 |
|
|
& SQUEEZE_RIGHT, myThid ) |
49 |
|
|
WRITE(msgBuf,'(A)') '// Check Model config. (CONFIG_CHECK):' |
50 |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
51 |
|
|
& SQUEEZE_RIGHT, myThid ) |
52 |
|
|
_END_MASTER(myThid) |
53 |
|
|
|
54 |
jmc |
1.61 |
C-- MPI + multi-threads: seems to be OK to let master-thread check & stop |
55 |
|
|
C (as long as all procs finish cleanly by calling ALL_PROC_DIE) |
56 |
|
|
_BEGIN_MASTER(myThid) |
57 |
|
|
errCount = 0 |
58 |
|
|
|
59 |
jmc |
1.1 |
C- check that CPP option is "defined" when running-flag parameter is on: |
60 |
|
|
|
61 |
dimitri |
1.43 |
C o If diffKrFile is set, then we should make sure the corresponing |
62 |
|
|
C code is being compiled |
63 |
jmc |
1.50 |
#ifndef ALLOW_3D_DIFFKR |
64 |
dimitri |
1.43 |
IF (diffKrFile.NE.' ') THEN |
65 |
|
|
WRITE(msgBuf,'(A)') |
66 |
|
|
& 'CONFIG_CHECK: diffKrFile is set but never used.' |
67 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
68 |
jmc |
1.70 |
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
69 |
|
|
& 'Re-compile with: "#define ALLOW_3D_DIFFKR"' |
70 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
71 |
jmc |
1.61 |
errCount = errCount + 1 |
72 |
dimitri |
1.43 |
ENDIF |
73 |
|
|
#endif |
74 |
|
|
|
75 |
jmc |
1.73 |
#ifndef ALLOW_SMAG_3D |
76 |
|
|
IF ( useSmag3D ) THEN |
77 |
|
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
78 |
|
|
& 'Cannot set useSmag3D=TRUE when compiled with' |
79 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
80 |
|
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
81 |
|
|
& '"#undef ALLOW_SMAG_3D" in MOM_COMMON_OPTIONS.h' |
82 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
83 |
|
|
errCount = errCount + 1 |
84 |
|
|
ENDIF |
85 |
|
|
#endif |
86 |
|
|
|
87 |
jmc |
1.1 |
#ifndef ALLOW_NONHYDROSTATIC |
88 |
jmc |
1.40 |
IF (use3Dsolver) THEN |
89 |
|
|
WRITE(msgBuf,'(A)') |
90 |
jmc |
1.1 |
& 'CONFIG_CHECK: #undef ALLOW_NONHYDROSTATIC and' |
91 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
92 |
jmc |
1.32 |
IF ( implicitIntGravWave ) WRITE(msgBuf,'(A)') |
93 |
|
|
& 'CONFIG_CHECK: implicitIntGravWave is TRUE' |
94 |
|
|
IF ( nonHydrostatic ) WRITE(msgBuf,'(A)') |
95 |
jmc |
1.1 |
& 'CONFIG_CHECK: nonHydrostatic is TRUE' |
96 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
97 |
jmc |
1.61 |
errCount = errCount + 1 |
98 |
jmc |
1.1 |
ENDIF |
99 |
|
|
#endif |
100 |
|
|
|
101 |
jmc |
1.22 |
#ifndef ALLOW_ADAMSBASHFORTH_3 |
102 |
|
|
IF ( alph_AB.NE.UNSET_RL .OR. beta_AB.NE.UNSET_RL ) THEN |
103 |
|
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
104 |
|
|
& '#undef ALLOW_ADAMSBASHFORTH_3 but alph_AB,beta_AB' |
105 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
106 |
jmc |
1.22 |
WRITE(msgBuf,'(A,1P2E20.7)') |
107 |
|
|
& 'CONFIG_CHECK: are set to:',alph_AB,beta_AB |
108 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
109 |
jmc |
1.61 |
errCount = errCount + 1 |
110 |
jmc |
1.22 |
ENDIF |
111 |
|
|
#endif |
112 |
|
|
|
113 |
jmc |
1.13 |
#ifndef INCLUDE_IMPLVERTADV_CODE |
114 |
jmc |
1.40 |
IF ( momImplVertAdv ) THEN |
115 |
|
|
WRITE(msgBuf,'(A)') |
116 |
jmc |
1.13 |
& 'CONFIG_CHECK: #undef INCLUDE_IMPLVERTADV_CODE' |
117 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
118 |
jmc |
1.13 |
WRITE(msgBuf,'(A)') |
119 |
|
|
& 'CONFIG_CHECK: but momImplVertAdv is TRUE' |
120 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
121 |
jmc |
1.61 |
errCount = errCount + 1 |
122 |
jmc |
1.13 |
ENDIF |
123 |
jmc |
1.40 |
IF ( tempImplVertAdv ) THEN |
124 |
|
|
WRITE(msgBuf,'(A)') |
125 |
jmc |
1.13 |
& 'CONFIG_CHECK: #undef INCLUDE_IMPLVERTADV_CODE' |
126 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
127 |
jmc |
1.13 |
WRITE(msgBuf,'(A)') |
128 |
|
|
& 'CONFIG_CHECK: but tempImplVertAdv is TRUE' |
129 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
130 |
jmc |
1.61 |
errCount = errCount + 1 |
131 |
jmc |
1.13 |
ENDIF |
132 |
jmc |
1.40 |
IF ( saltImplVertAdv ) THEN |
133 |
|
|
WRITE(msgBuf,'(A)') |
134 |
jmc |
1.13 |
& 'CONFIG_CHECK: #undef INCLUDE_IMPLVERTADV_CODE' |
135 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
136 |
jmc |
1.13 |
WRITE(msgBuf,'(A)') |
137 |
|
|
& 'CONFIG_CHECK: but saltImplVertAdv is TRUE' |
138 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
139 |
jmc |
1.61 |
errCount = errCount + 1 |
140 |
jmc |
1.13 |
ENDIF |
141 |
jmc |
1.19 |
IF ( dTtracerLev(1).NE.dTtracerLev(Nr) .AND. implicitDiffusion |
142 |
jmc |
1.40 |
& .AND. ( saltStepping .OR. tempStepping .OR. usePTRACERS ) |
143 |
jmc |
1.19 |
& ) THEN |
144 |
jmc |
1.40 |
WRITE(msgBuf,'(A)') |
145 |
jmc |
1.19 |
& 'CONFIG_CHECK: #undef INCLUDE_IMPLVERTADV_CODE' |
146 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
147 |
jmc |
1.19 |
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
148 |
|
|
& 'but implicitDiffusion=T with non-uniform dTtracerLev' |
149 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
150 |
jmc |
1.61 |
errCount = errCount + 1 |
151 |
jmc |
1.19 |
ENDIF |
152 |
jmc |
1.13 |
#endif |
153 |
|
|
|
154 |
gforget |
1.55 |
#ifdef ALLOW_AUTODIFF_TAMC |
155 |
|
|
IF ( momImplVertAdv ) THEN |
156 |
|
|
WRITE(msgBuf,'(A)') |
157 |
|
|
& 'CONFIG_CHECK: momImplVertAdv is not yet' |
158 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
159 |
|
|
WRITE(msgBuf,'(A)') |
160 |
|
|
& 'CONFIG_CHECK: supported in adjoint mode' |
161 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
162 |
jmc |
1.61 |
errCount = errCount + 1 |
163 |
gforget |
1.55 |
ENDIF |
164 |
|
|
#endif |
165 |
|
|
|
166 |
jmc |
1.58 |
#ifdef ALLOW_DEPTH_CONTROL |
167 |
|
|
IF ( useOBCS ) THEN |
168 |
|
|
WRITE(msgBuf,'(A)') |
169 |
|
|
& 'CONFIG_CHECK: DEPTH_CONTROL code not compatible with OBCS' |
170 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
171 |
jmc |
1.61 |
errCount = errCount + 1 |
172 |
jmc |
1.58 |
ENDIF |
173 |
|
|
#endif |
174 |
|
|
|
175 |
jmc |
1.1 |
#ifndef EXACT_CONSERV |
176 |
jmc |
1.40 |
IF (exactConserv) THEN |
177 |
|
|
WRITE(msgBuf,'(A)') |
178 |
jmc |
1.1 |
& 'CONFIG_CHECK: #undef EXACT_CONSERV and' |
179 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
180 |
jmc |
1.1 |
WRITE(msgBuf,'(A)') |
181 |
|
|
& 'CONFIG_CHECK: exactConserv is TRUE' |
182 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
183 |
jmc |
1.61 |
errCount = errCount + 1 |
184 |
jmc |
1.1 |
ENDIF |
185 |
|
|
#endif |
186 |
|
|
|
187 |
|
|
#ifndef NONLIN_FRSURF |
188 |
jmc |
1.40 |
IF (nonlinFreeSurf.NE.0) THEN |
189 |
|
|
WRITE(msgBuf,'(A)') |
190 |
jmc |
1.1 |
& 'CONFIG_CHECK: #undef NONLIN_FRSURF and' |
191 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
192 |
jmc |
1.1 |
WRITE(msgBuf,'(A)') |
193 |
|
|
& 'CONFIG_CHECK: nonlinFreeSurf is non-zero' |
194 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
195 |
jmc |
1.61 |
errCount = errCount + 1 |
196 |
jmc |
1.1 |
ENDIF |
197 |
|
|
#endif |
198 |
|
|
|
199 |
jmc |
1.9 |
#ifndef NONLIN_FRSURF |
200 |
|
|
IF (select_rStar .NE. 0) THEN |
201 |
jmc |
1.40 |
WRITE(msgBuf,'(A)') |
202 |
jmc |
1.9 |
& 'CONFIG_CHECK: rStar is part of NonLin-FS ' |
203 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
204 |
jmc |
1.9 |
WRITE(msgBuf,'(A)') |
205 |
jmc |
1.56 |
& 'CONFIG_CHECK: ==> set #define NONLIN_FRSURF to use it' |
206 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
207 |
jmc |
1.61 |
errCount = errCount + 1 |
208 |
jmc |
1.9 |
ENDIF |
209 |
|
|
#endif /* NONLIN_FRSURF */ |
210 |
|
|
|
211 |
jmc |
1.56 |
#ifdef DISABLE_RSTAR_CODE |
212 |
|
|
IF ( select_rStar.NE.0 ) THEN |
213 |
|
|
WRITE(msgBuf,'(A)') |
214 |
|
|
& 'CONFIG_CHECK: rStar code disable (DISABLE_RSTAR_CODE defined)' |
215 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
216 |
|
|
WRITE(msgBuf,'(A)') |
217 |
|
|
& 'CONFIG_CHECK: ==> set #undef DISABLE_RSTAR_CODE to use it' |
218 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
219 |
jmc |
1.61 |
errCount = errCount + 1 |
220 |
jmc |
1.56 |
ENDIF |
221 |
|
|
#endif /* DISABLE_RSTAR_CODE */ |
222 |
|
|
|
223 |
|
|
#ifdef DISABLE_SIGMA_CODE |
224 |
|
|
IF ( selectSigmaCoord.NE.0 ) THEN |
225 |
|
|
WRITE(msgBuf,'(A)') |
226 |
|
|
& 'CONFIG_CHECK: Sigma code disable (DISABLE_SIGMA_CODE defined)' |
227 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
228 |
|
|
WRITE(msgBuf,'(A)') |
229 |
|
|
& 'CONFIG_CHECK: ==> set #undef DISABLE_SIGMA_CODE to use it' |
230 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
231 |
jmc |
1.61 |
errCount = errCount + 1 |
232 |
jmc |
1.56 |
ENDIF |
233 |
|
|
#endif /* DISABLE_SIGMA_CODE */ |
234 |
|
|
|
235 |
jmc |
1.1 |
#ifdef USE_NATURAL_BCS |
236 |
jmc |
1.40 |
WRITE(msgBuf,'(A)') |
237 |
jmc |
1.3 |
& 'CONFIG_CHECK: USE_NATURAL_BCS option has been replaced' |
238 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
239 |
jmc |
1.1 |
WRITE(msgBuf,'(A)') |
240 |
jmc |
1.3 |
& 'CONFIG_CHECK: by useRealFreshWaterFlux=TRUE in data file' |
241 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
242 |
jmc |
1.61 |
errCount = errCount + 1 |
243 |
jmc |
1.3 |
#endif |
244 |
|
|
|
245 |
jmc |
1.50 |
#ifndef ALLOW_ADDFLUID |
246 |
|
|
IF ( selectAddFluid.NE.0 ) THEN |
247 |
|
|
WRITE(msgBuf,'(A)') |
248 |
jmc |
1.70 |
& 'CONFIG_CHECK: #undef ALLOW_ADDFLUID (CPP_OPTIONS.h) and' |
249 |
jmc |
1.50 |
CALL PRINT_ERROR( msgBuf, myThid ) |
250 |
|
|
WRITE(msgBuf,'(A,I4,A)') 'CONFIG_CHECK: selectAddFluid=', |
251 |
|
|
& selectAddFluid, ' is not zero' |
252 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
253 |
jmc |
1.61 |
errCount = errCount + 1 |
254 |
jmc |
1.50 |
ENDIF |
255 |
|
|
#endif /* ALLOW_ADDFLUID */ |
256 |
|
|
|
257 |
jmc |
1.4 |
C o If pLoadFile is set, then we should make sure the corresponing |
258 |
|
|
C code is being compiled |
259 |
|
|
#ifndef ATMOSPHERIC_LOADING |
260 |
|
|
IF (pLoadFile.NE.' ') THEN |
261 |
|
|
WRITE(msgBuf,'(A)') |
262 |
|
|
& 'CONFIG_CHECK: pLoadFile is set but you have not' |
263 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
264 |
jmc |
1.4 |
WRITE(msgBuf,'(A)') |
265 |
jmc |
1.70 |
& ' compiled the model with the pressure loading code.' |
266 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
267 |
jmc |
1.15 |
WRITE(msgBuf,'(A)') |
268 |
jmc |
1.70 |
& ' Re-compile with: "#define ATMOSPHERIC_LOADING"' |
269 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
270 |
jmc |
1.61 |
errCount = errCount + 1 |
271 |
jmc |
1.15 |
ENDIF |
272 |
|
|
IF ( useRealFreshWaterFlux .AND. useThSIce ) THEN |
273 |
|
|
WRITE(msgBuf,'(A)') |
274 |
|
|
& 'CONFIG_CHECK: sIceLoad is computed but' |
275 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
276 |
jmc |
1.15 |
WRITE(msgBuf,'(A)') |
277 |
jmc |
1.70 |
& ' pressure loading code is not compiled.' |
278 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
279 |
jmc |
1.15 |
WRITE(msgBuf,'(A)') |
280 |
jmc |
1.70 |
& ' Re-compile with: "#define ATMOSPHERIC_LOADING"' |
281 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
282 |
|
|
errCount = errCount + 1 |
283 |
|
|
ENDIF |
284 |
|
|
#endif |
285 |
|
|
|
286 |
|
|
#ifndef ALLOW_FRICTION_HEATING |
287 |
|
|
IF ( addFrictionHeating ) THEN |
288 |
|
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: addFrictionHeating=T', |
289 |
|
|
& ' but FRICTIONAL_HEATING code is not compiled.' |
290 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
291 |
|
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: Re-compile with:', |
292 |
|
|
& ' "#define ALLOW_FRICTION_HEATING" (CPP_OPTIONS.h)' |
293 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
294 |
jmc |
1.61 |
errCount = errCount + 1 |
295 |
jmc |
1.4 |
ENDIF |
296 |
|
|
#endif |
297 |
|
|
|
298 |
mlosch |
1.31 |
#ifndef ALLOW_BALANCE_FLUXES |
299 |
|
|
IF (balanceEmPmR .OR. balanceQnet) THEN |
300 |
|
|
WRITE(msgBuf,'(A,A)') |
301 |
|
|
& 'CONFIG_CHECK: balanceEmPmR/Qnet is set but balance code ', |
302 |
|
|
& 'is not compiled.' |
303 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
304 |
jmc |
1.70 |
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
305 |
|
|
& 'Re-compile with: ALLOW_BALANCE_FLUXES defined' |
306 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
307 |
jmc |
1.61 |
errCount = errCount + 1 |
308 |
mlosch |
1.31 |
ENDIF |
309 |
|
|
#endif |
310 |
|
|
|
311 |
gforget |
1.66 |
#ifndef ALLOW_BALANCE_RELAX |
312 |
|
|
IF (balanceThetaClimRelax .OR. balanceSaltClimRelax) THEN |
313 |
|
|
WRITE(msgBuf,'(A,A)') |
314 |
|
|
& 'CONFIG_CHECK: balanceTheta/SaltClimRelax is set ', |
315 |
|
|
& 'but balance code is not compiled.' |
316 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
317 |
jmc |
1.70 |
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
318 |
gforget |
1.66 |
& 'Re-compile with ALLOW_BALANCE_RELAX defined' |
319 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
320 |
|
|
errCount = errCount + 1 |
321 |
|
|
ENDIF |
322 |
|
|
#endif |
323 |
|
|
|
324 |
mlosch |
1.52 |
#ifndef ALLOW_SRCG |
325 |
|
|
IF (useSRCGSolver) THEN |
326 |
|
|
WRITE(msgBuf,'(A,A)') |
327 |
|
|
& 'CONFIG_CHECK: useSRCGSolver = .TRUE., but single reduction ', |
328 |
|
|
& 'code is not compiled.' |
329 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
330 |
mlosch |
1.52 |
WRITE(msgBuf,'(A)') |
331 |
|
|
& 'CONFIG_CHECK: Re-compile with ALLOW_SRCG defined' |
332 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
333 |
jmc |
1.61 |
errCount = errCount + 1 |
334 |
mlosch |
1.52 |
ENDIF |
335 |
|
|
#endif /* ALLOW_SRCG */ |
336 |
|
|
|
337 |
jmc |
1.3 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
338 |
|
|
|
339 |
jmc |
1.48 |
C-- Check parameter consistency : |
340 |
jmc |
1.8 |
|
341 |
jmc |
1.59 |
IF ( ( OLx.LT.3 .OR. OLy.LT.3 ) .AND. |
342 |
jmc |
1.28 |
& ( viscC4leithD.NE.0. .OR. viscC4leith.NE.0. |
343 |
|
|
& .OR. viscC4smag.NE.0. .OR. viscA4Grid.NE.0. |
344 |
|
|
& .OR. viscA4D.NE.0. .OR. viscA4Z.NE.0. ) ) THEN |
345 |
jmc |
1.8 |
WRITE(msgBuf,'(A,A)') |
346 |
|
|
& 'CONFIG_CHECK: cannot use Biharmonic Visc. (viscA4) with', |
347 |
jmc |
1.59 |
& ' overlap (OLx,OLy) smaller than 3' |
348 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
349 |
jmc |
1.61 |
errCount = errCount + 1 |
350 |
jmc |
1.33 |
ENDIF |
351 |
jmc |
1.59 |
IF ( ( OLx.LT.3 .OR. OLy.LT.3 ) .AND. |
352 |
jmc |
1.28 |
& ( viscC2leithD.NE.0. .OR. viscC4leithD.NE.0. ) |
353 |
|
|
& ) THEN |
354 |
|
|
WRITE(msgBuf,'(A,A)') |
355 |
|
|
& 'CONFIG_CHECK: cannot use Leith Visc.(div.part) with', |
356 |
jmc |
1.59 |
& ' overlap (OLx,OLy) smaller than 3' |
357 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
358 |
jmc |
1.61 |
errCount = errCount + 1 |
359 |
jmc |
1.33 |
ENDIF |
360 |
jmc |
1.3 |
|
361 |
jmc |
1.62 |
#ifndef DISCONNECTED_TILES |
362 |
|
|
C Overlaps cannot be larger than interior tile except for special cases |
363 |
mlosch |
1.60 |
IF ( sNx.LT.OLx ) THEN |
364 |
|
|
#ifdef ALLOW_EXCH2 |
365 |
|
|
WRITE(msgBuf,'(A)') |
366 |
|
|
& 'CONFIG_CHECK: sNx<OLx not allowed with ALLOW_EXCH2 defined' |
367 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
368 |
jmc |
1.61 |
errCount = errCount + 1 |
369 |
mlosch |
1.60 |
#endif /* ALLOW_EXCH2 */ |
370 |
|
|
IF ( Nx.NE.1 ) THEN |
371 |
|
|
WRITE(msgBuf,'(A)') |
372 |
|
|
& 'CONFIG_CHECK: sNx<OLx not allowed unless Nx=1' |
373 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
374 |
jmc |
1.61 |
errCount = errCount + 1 |
375 |
mlosch |
1.60 |
ENDIF |
376 |
|
|
ENDIF |
377 |
|
|
IF ( sNy.LT.OLy ) THEN |
378 |
|
|
#ifdef ALLOW_EXCH2 |
379 |
|
|
WRITE(msgBuf,'(A)') |
380 |
|
|
& 'CONFIG_CHECK: sNy<OLy not allowed with ALLOW_EXCH2 defined' |
381 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
382 |
jmc |
1.61 |
errCount = errCount + 1 |
383 |
mlosch |
1.60 |
#endif /* ALLOW_EXCH2 */ |
384 |
|
|
IF ( Ny.NE.1 ) THEN |
385 |
|
|
WRITE(msgBuf,'(A)') |
386 |
|
|
& 'CONFIG_CHECK: sNy<OLy not allowed unless Ny=1' |
387 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
388 |
jmc |
1.61 |
errCount = errCount + 1 |
389 |
mlosch |
1.60 |
ENDIF |
390 |
|
|
ENDIF |
391 |
jmc |
1.62 |
#endif /* ndef DISCONNECTED_TILES */ |
392 |
mlosch |
1.60 |
|
393 |
jmc |
1.48 |
C-- Deep-Atmosphere & Anelastic limitations: |
394 |
jmc |
1.40 |
IF ( deepAtmosphere .AND. |
395 |
|
|
& useRealFreshWaterFlux .AND. usingPCoords ) THEN |
396 |
|
|
WRITE(msgBuf,'(A,A)') |
397 |
|
|
& 'CONFIG_CHECK: Deep-Atmosphere not yet implemented with', |
398 |
|
|
& ' real-Fresh-Water option in P-coordinate' |
399 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
400 |
jmc |
1.61 |
errCount = errCount + 1 |
401 |
jmc |
1.40 |
ENDIF |
402 |
|
|
IF ( select_rStar.NE.0 .AND. |
403 |
|
|
& ( deepAtmosphere .OR. |
404 |
|
|
& usingZCoords.AND.rhoRefFile .NE. ' ' ) ) THEN |
405 |
|
|
WRITE(msgBuf,'(A,A)') |
406 |
|
|
& 'CONFIG_CHECK: Deep-Atmosphere or Anelastic', |
407 |
|
|
& ' not yet implemented with rStar' |
408 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
409 |
jmc |
1.61 |
errCount = errCount + 1 |
410 |
jmc |
1.40 |
ENDIF |
411 |
|
|
IF ( vectorInvariantMomentum .AND. |
412 |
|
|
& ( deepAtmosphere .OR. |
413 |
|
|
& usingZCoords.AND.rhoRefFile .NE. ' ' ) ) THEN |
414 |
|
|
WRITE(msgBuf,'(A,A)') |
415 |
|
|
& 'CONFIG_CHECK: Deep-Atmosphere or Anelastic', |
416 |
|
|
& ' not yet implemented in Vector-Invariant momentum code' |
417 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
418 |
jmc |
1.61 |
errCount = errCount + 1 |
419 |
jmc |
1.40 |
ENDIF |
420 |
|
|
|
421 |
jmc |
1.48 |
C-- Free-surface related limitations: |
422 |
jmc |
1.71 |
IF ( cg2dUseMinResSol.LT.0 .OR. cg2dUseMinResSol.GT.1 ) THEN |
423 |
|
|
WRITE(msgBuf,'(A,I10,A)') |
424 |
|
|
& 'CONFIG_CHECK: cg2dUseMinResSol set to unvalid value(=', |
425 |
|
|
& cg2dUseMinResSol, ')' |
426 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
427 |
|
|
errCount = errCount + 1 |
428 |
|
|
ENDIF |
429 |
|
|
|
430 |
jmc |
1.3 |
IF ( rigidLid .AND. implicitFreeSurface ) THEN |
431 |
|
|
WRITE(msgBuf,'(A,A)') |
432 |
|
|
& 'CONFIG_CHECK: Cannot select both implicitFreeSurface', |
433 |
|
|
& ' and rigidLid.' |
434 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
435 |
jmc |
1.61 |
errCount = errCount + 1 |
436 |
jmc |
1.33 |
ENDIF |
437 |
jmc |
1.3 |
|
438 |
|
|
IF (rigidLid .AND. exactConserv) THEN |
439 |
jmc |
1.40 |
WRITE(msgBuf,'(A)') |
440 |
jmc |
1.3 |
& 'CONFIG_CHECK: exactConserv not compatible with' |
441 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
442 |
jmc |
1.1 |
WRITE(msgBuf,'(A)') |
443 |
jmc |
1.3 |
& 'CONFIG_CHECK: rigidLid (meaningless in that case)' |
444 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
445 |
jmc |
1.61 |
errCount = errCount + 1 |
446 |
jmc |
1.1 |
ENDIF |
447 |
|
|
|
448 |
dfer |
1.41 |
IF ( linFSConserveTr .AND. nonlinFreeSurf.NE.0 ) THEN |
449 |
|
|
WRITE(msgBuf,'(A)') |
450 |
|
|
& 'CONFIG_CHECK: Cannot select both a Nonlinear Free Surf.' |
451 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
452 |
dfer |
1.41 |
WRITE(msgBuf,'(A)') |
453 |
|
|
& 'CONFIG_CHECK: and Tracer Correction of Lin. Free Surf.' |
454 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
455 |
jmc |
1.61 |
errCount = errCount + 1 |
456 |
dfer |
1.41 |
ENDIF |
457 |
|
|
|
458 |
jmc |
1.3 |
IF (rigidLid .AND. useRealFreshWaterFlux) THEN |
459 |
jmc |
1.40 |
WRITE(msgBuf,'(A)') |
460 |
jmc |
1.3 |
& 'CONFIG_CHECK: useRealFreshWaterFlux not compatible with' |
461 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
462 |
jmc |
1.1 |
WRITE(msgBuf,'(A)') |
463 |
|
|
& 'CONFIG_CHECK: rigidLid (meaningless in that case)' |
464 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
465 |
jmc |
1.61 |
errCount = errCount + 1 |
466 |
jmc |
1.1 |
ENDIF |
467 |
|
|
|
468 |
|
|
IF (nonlinFreeSurf.NE.0 .AND. .NOT.exactConserv) THEN |
469 |
jmc |
1.40 |
WRITE(msgBuf,'(A)') |
470 |
jmc |
1.1 |
& 'CONFIG_CHECK: nonlinFreeSurf cannot be used' |
471 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
472 |
jmc |
1.1 |
WRITE(msgBuf,'(A)') |
473 |
|
|
& 'CONFIG_CHECK: without exactConserv' |
474 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
475 |
jmc |
1.61 |
errCount = errCount + 1 |
476 |
jmc |
1.1 |
ENDIF |
477 |
|
|
|
478 |
jmc |
1.6 |
IF (select_rStar.NE.0 .AND. .NOT.exactConserv) THEN |
479 |
jmc |
1.40 |
WRITE(msgBuf,'(A)') |
480 |
jmc |
1.6 |
& 'CONFIG_CHECK: r* Coordinate cannot be used' |
481 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
482 |
jmc |
1.6 |
WRITE(msgBuf,'(A)') |
483 |
|
|
& 'CONFIG_CHECK: without exactConserv' |
484 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
485 |
jmc |
1.61 |
errCount = errCount + 1 |
486 |
jmc |
1.6 |
ENDIF |
487 |
|
|
|
488 |
jmc |
1.67 |
IF ( select_rStar.GE.1 .AND. nonlinFreeSurf.LE.0 ) THEN |
489 |
|
|
WRITE(msgBuf,'(2A,I3,A)') 'CONFIG_CHECK: r* Coordinate', |
490 |
|
|
& ' (select_rStar=', select_rStar, ' ) cannot be used' |
491 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
492 |
|
|
WRITE(msgBuf,'(2A,I3,A)') 'CONFIG_CHECK: ', |
493 |
|
|
& ' with Linear FreeSurf (nonlinFreeSurf=', nonlinFreeSurf,' )' |
494 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
495 |
|
|
errCount = errCount + 1 |
496 |
|
|
ENDIF |
497 |
jmc |
1.72 |
IF ( select_rStar.EQ.2 .AND. nonlinFreeSurf.NE.4 ) THEN |
498 |
|
|
C- not consistent to account for the slope of the coordinate when |
499 |
|
|
C ignoring the variations of level-thickness in PhiHyd calculation; |
500 |
|
|
C for now, issue a warning (but might change the code later on): |
501 |
|
|
WRITE(msgBuf,'(2A,I3)') '** WARNING ** CONFIG_CHECK: ', |
502 |
|
|
& 'select_rStar=2 not right with nonlinFreeSurf=', nonlinFreeSurf |
503 |
|
|
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
504 |
|
|
& SQUEEZE_RIGHT, myThid ) |
505 |
|
|
ENDIF |
506 |
jmc |
1.67 |
|
507 |
jmc |
1.56 |
IF ( selectSigmaCoord.NE.0 ) THEN |
508 |
|
|
IF ( fluidIsWater ) THEN |
509 |
|
|
WRITE(msgBuf,'(A)') |
510 |
|
|
& 'CONFIG_CHECK: Sigma-Coords not yet coded for Oceanic set-up' |
511 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
512 |
jmc |
1.61 |
errCount = errCount + 1 |
513 |
jmc |
1.56 |
ENDIF |
514 |
|
|
IF ( nonlinFreeSurf.LE.0 ) THEN |
515 |
|
|
WRITE(msgBuf,'(A)') |
516 |
|
|
& 'CONFIG_CHECK: Sigma-Coords not coded for Lin-FreeSurf' |
517 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
518 |
jmc |
1.61 |
errCount = errCount + 1 |
519 |
jmc |
1.56 |
ENDIF |
520 |
|
|
IF (select_rStar.NE.0 ) THEN |
521 |
|
|
WRITE(msgBuf,'(A)') |
522 |
|
|
& 'CONFIG_CHECK: Sigma-Coords and rStar are not compatible' |
523 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
524 |
jmc |
1.61 |
errCount = errCount + 1 |
525 |
jmc |
1.56 |
ENDIF |
526 |
|
|
WRITE(msgBuf,'(A)') |
527 |
|
|
& 'CONFIG_CHECK: Sigma-Coords code neither complete nor tested' |
528 |
|
|
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
529 |
|
|
& SQUEEZE_RIGHT, myThid ) |
530 |
|
|
ENDIF |
531 |
|
|
|
532 |
jmc |
1.54 |
C- note : not implemented in checkpoint48b but it is done now (since 01-28-03) |
533 |
jmc |
1.7 |
c IF (select_rStar.GT.0 .AND. useOBCS ) THEN |
534 |
|
|
c STOP 'ABNORMAL END: S/R CONFIG_CHECK' |
535 |
|
|
c ENDIF |
536 |
jmc |
1.1 |
|
537 |
jmc |
1.40 |
IF ( nonlinFreeSurf.NE.0 .AND. |
538 |
jmc |
1.70 |
& deltaTFreeSurf.NE.dTtracerLev(1) ) THEN |
539 |
jmc |
1.53 |
WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ', |
540 |
|
|
& 'nonlinFreeSurf might cause problems' |
541 |
jmc |
1.4 |
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
542 |
jmc |
1.53 |
& SQUEEZE_RIGHT, myThid ) |
543 |
|
|
WRITE(msgBuf,'(2A)') '** WARNING ** ', |
544 |
|
|
& 'with different FreeSurf & Tracer time-steps' |
545 |
jmc |
1.4 |
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
546 |
jmc |
1.53 |
& SQUEEZE_RIGHT, myThid ) |
547 |
jmc |
1.3 |
ENDIF |
548 |
|
|
|
549 |
jmc |
1.15 |
IF ( useRealFreshWaterFlux .AND. exactConserv |
550 |
jmc |
1.50 |
& .AND. implicDiv2Dflow.EQ.0. _d 0 |
551 |
jmc |
1.21 |
& .AND. startTime.NE.baseTime .AND. usePickupBeforeC54 ) THEN |
552 |
jmc |
1.40 |
WRITE(msgBuf,'(A)') |
553 |
jmc |
1.3 |
& 'CONFIG_CHECK: RealFreshWaterFlux+implicSurfP=0+exactConserv:' |
554 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
555 |
jmc |
1.3 |
WRITE(msgBuf,'(A)') |
556 |
|
|
& 'CONFIG_CHECK: restart not implemented in this config' |
557 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
558 |
jmc |
1.61 |
errCount = errCount + 1 |
559 |
jmc |
1.3 |
ENDIF |
560 |
|
|
|
561 |
jmc |
1.40 |
IF ( useRealFreshWaterFlux .AND. .NOT.exactConserv |
562 |
jmc |
1.50 |
& .AND. implicDiv2Dflow.NE.1. ) THEN |
563 |
jmc |
1.53 |
WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ', |
564 |
jmc |
1.50 |
& 'RealFreshWater & implicDiv2Dflow < 1' |
565 |
jmc |
1.15 |
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
566 |
jmc |
1.53 |
& SQUEEZE_RIGHT, myThid ) |
567 |
|
|
WRITE(msgBuf,'(2A)') '** WARNING ** works better', |
568 |
jmc |
1.15 |
& ' with exactConserv=.T. (+ #define EXACT_CONSERV)' |
569 |
|
|
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
570 |
jmc |
1.53 |
& SQUEEZE_RIGHT, myThid ) |
571 |
jmc |
1.15 |
ENDIF |
572 |
|
|
|
573 |
|
|
#ifdef EXACT_CONSERV |
574 |
jmc |
1.4 |
IF (useRealFreshWaterFlux .AND. .NOT.exactConserv |
575 |
|
|
& .AND. buoyancyRelation.EQ.'OCEANICP' ) THEN |
576 |
jmc |
1.40 |
WRITE(msgBuf,'(A)') |
577 |
jmc |
1.4 |
& 'CONFIG_CHECK: RealFreshWaterFlux with OCEANICP' |
578 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
579 |
jmc |
1.4 |
WRITE(msgBuf,'(A)') |
580 |
|
|
& 'CONFIG_CHECK: requires exactConserv=T' |
581 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
582 |
jmc |
1.61 |
errCount = errCount + 1 |
583 |
jmc |
1.4 |
ENDIF |
584 |
|
|
#else |
585 |
|
|
IF (useRealFreshWaterFlux |
586 |
|
|
& .AND. buoyancyRelation.EQ.'OCEANICP' ) THEN |
587 |
jmc |
1.53 |
WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ', |
588 |
|
|
& 'E-P effects on wVel are not included' |
589 |
jmc |
1.4 |
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
590 |
jmc |
1.53 |
& SQUEEZE_RIGHT, myThid ) |
591 |
|
|
WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ', |
592 |
|
|
& '==> use #define EXACT_CONSERV to fix it' |
593 |
jmc |
1.5 |
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
594 |
jmc |
1.53 |
& SQUEEZE_RIGHT, myThid ) |
595 |
jmc |
1.5 |
ENDIF |
596 |
jmc |
1.15 |
#endif /* EXACT_CONSERV */ |
597 |
jmc |
1.5 |
|
598 |
jmc |
1.50 |
IF ( selectAddFluid.LT.-1 .OR. selectAddFluid.GT.2 ) THEN |
599 |
|
|
WRITE(msgBuf,'(A,I10,A)') 'CONFIG_CHECK: selectAddFluid=', |
600 |
|
|
& selectAddFluid, ' not allowed' |
601 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
602 |
jmc |
1.50 |
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
603 |
|
|
& 'should be =0 (Off), 1,2 (Add Mass) or -1 (Virtual Flux)' |
604 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
605 |
jmc |
1.61 |
errCount = errCount + 1 |
606 |
jmc |
1.50 |
ENDIF |
607 |
|
|
IF ( selectAddFluid.GE.1 .AND. rigidLid ) THEN |
608 |
|
|
WRITE(msgBuf,'(A)') |
609 |
|
|
& 'CONFIG_CHECK: selectAddFluid > 0 not compatible with' |
610 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
611 |
jmc |
1.50 |
WRITE(msgBuf,'(A)') |
612 |
|
|
& 'CONFIG_CHECK: rigidLid (meaningless in that case)' |
613 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
614 |
jmc |
1.61 |
errCount = errCount + 1 |
615 |
jmc |
1.50 |
ENDIF |
616 |
|
|
IF ( selectAddFluid.GE.1 .AND. .NOT.staggerTimeStep ) THEN |
617 |
jmc |
1.53 |
WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ', |
618 |
|
|
& 'synchronous time-stepping =>' |
619 |
jmc |
1.50 |
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
620 |
jmc |
1.53 |
& SQUEEZE_RIGHT, myThid ) |
621 |
|
|
WRITE(msgBuf,'(2A)') '** WARNING ** ', |
622 |
jmc |
1.50 |
& '1 time-step mismatch in AddFluid effects on T & S' |
623 |
|
|
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
624 |
jmc |
1.53 |
& SQUEEZE_RIGHT, myThid ) |
625 |
|
|
ENDIF |
626 |
|
|
|
627 |
jmc |
1.74 |
C-- Pressure calculation and pressure gradient: |
628 |
|
|
#ifndef INCLUDE_PHIHYD_CALCULATION_CODE |
629 |
|
|
IF ( momPressureForcing .OR. useDynP_inEos_Zc ) THEN |
630 |
|
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
631 |
|
|
& 'missing code to calculate pressure (totPhiHyd)' |
632 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
633 |
|
|
errCount = errCount + 1 |
634 |
|
|
ENDIF |
635 |
|
|
#endif /* INCLUDE_PHIHYD_CALCULATION_CODE */ |
636 |
|
|
IF ( useDynP_inEos_Zc .AND. .NOT.momStepping ) THEN |
637 |
|
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
638 |
|
|
& 'useDynP_inEos_Zc = TRUE but pressure is not computed' |
639 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
640 |
|
|
errCount = errCount + 1 |
641 |
|
|
ENDIF |
642 |
|
|
|
643 |
jmc |
1.53 |
C-- Non-hydrostatic and 3-D solver related limitations: |
644 |
|
|
IF (nonlinFreeSurf.NE.0 .AND. use3Dsolver) THEN |
645 |
|
|
WRITE(msgBuf,'(A)') |
646 |
|
|
& 'CONFIG_CHECK: nonlinFreeSurf not yet implemented' |
647 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
648 |
|
|
WRITE(msgBuf,'(A)') |
649 |
|
|
& 'CONFIG_CHECK: in nonHydrostatic code' |
650 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
651 |
jmc |
1.61 |
errCount = errCount + 1 |
652 |
jmc |
1.53 |
ENDIF |
653 |
|
|
|
654 |
|
|
IF ( implicitNHPress*implicSurfPress*implicDiv2Dflow.NE.1. |
655 |
|
|
& .AND. implicitIntGravWave ) THEN |
656 |
|
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: implicitIntGravWave', |
657 |
|
|
& ' NOT SAFE with non-fully implicit solver' |
658 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
659 |
|
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: To by-pass this', |
660 |
|
|
& 'STOP, comment this test and re-compile config_check' |
661 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
662 |
jmc |
1.61 |
errCount = errCount + 1 |
663 |
jmc |
1.53 |
ENDIF |
664 |
|
|
IF ( nonHydrostatic .AND. .NOT.exactConserv |
665 |
|
|
& .AND. implicDiv2Dflow.NE.1. ) THEN |
666 |
|
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: Needs exactConserv=T', |
667 |
|
|
& ' for nonHydrostatic with implicDiv2Dflow < 1' |
668 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
669 |
jmc |
1.61 |
errCount = errCount + 1 |
670 |
jmc |
1.53 |
ENDIF |
671 |
|
|
IF ( nonHydrostatic .AND. |
672 |
|
|
& implicitNHPress.NE.implicSurfPress ) THEN |
673 |
|
|
WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ', |
674 |
|
|
& ' nonHydrostatic might cause problems with' |
675 |
|
|
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
676 |
|
|
& SQUEEZE_RIGHT, myThid ) |
677 |
|
|
WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ', |
678 |
|
|
& 'different implicitNHPress & implicSurfPress' |
679 |
|
|
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
680 |
|
|
& SQUEEZE_RIGHT, myThid ) |
681 |
|
|
ENDIF |
682 |
|
|
|
683 |
|
|
IF ( implicitViscosity .AND. use3Dsolver ) THEN |
684 |
|
|
WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ', |
685 |
|
|
& 'Implicit viscosity applies to provisional u,vVel' |
686 |
|
|
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
687 |
|
|
& SQUEEZE_RIGHT, myThid ) |
688 |
|
|
WRITE(msgBuf,'(2A)') '** WARNING ** => not consistent with', |
689 |
|
|
& 'final vertical shear (after appling 3-D solver solution' |
690 |
|
|
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
691 |
|
|
& SQUEEZE_RIGHT, myThid ) |
692 |
|
|
ENDIF |
693 |
|
|
IF ( implicitViscosity .AND. nonHydrostatic ) THEN |
694 |
|
|
WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ', |
695 |
|
|
& 'Implicit viscosity not implemented in CALC_GW' |
696 |
|
|
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
697 |
|
|
& SQUEEZE_RIGHT, myThid ) |
698 |
|
|
WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ', |
699 |
|
|
& 'Explicit viscosity might become unstable if too large' |
700 |
|
|
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
701 |
|
|
& SQUEEZE_RIGHT, myThid ) |
702 |
jmc |
1.50 |
ENDIF |
703 |
|
|
|
704 |
jmc |
1.48 |
C-- Momentum related limitations: |
705 |
jmc |
1.47 |
IF ( vectorInvariantMomentum.AND.momStepping ) THEN |
706 |
|
|
IF ( highOrderVorticity.AND.upwindVorticity ) THEN |
707 |
|
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
708 |
|
|
& '"highOrderVorticity" conflicts with "upwindVorticity"' |
709 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
710 |
jmc |
1.61 |
errCount = errCount + 1 |
711 |
jmc |
1.47 |
ENDIF |
712 |
|
|
ENDIF |
713 |
jmc |
1.69 |
IF ( .NOT.vectorInvariantMomentum .AND. momAdvection ) THEN |
714 |
|
|
IF ( usingCurvilinearGrid ) THEN |
715 |
|
|
WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ', |
716 |
|
|
& 'missing metric-terms for CurvilinearGrid' |
717 |
|
|
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
718 |
|
|
& SQUEEZE_RIGHT, myThid ) |
719 |
|
|
ENDIF |
720 |
|
|
IF ( hasWetCSCorners ) THEN |
721 |
|
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: momAdvection ', |
722 |
|
|
& 'in flux-form is wrong on CubedSphere grid (corners)' |
723 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
724 |
|
|
errCount = errCount + 1 |
725 |
|
|
ENDIF |
726 |
|
|
ENDIF |
727 |
jmc |
1.57 |
IF ( selectCoriMap.LT.0 .OR. selectCoriMap.GT.3 ) THEN |
728 |
|
|
WRITE(msgBuf,'(2A,I4)') 'CONFIG_CHECK: ', |
729 |
|
|
& 'Invalid option: selectCoriMap=', selectCoriMap |
730 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
731 |
jmc |
1.61 |
errCount = errCount + 1 |
732 |
jmc |
1.57 |
ENDIF |
733 |
jmc |
1.73 |
IF ( useSmag3D .AND. |
734 |
|
|
& ( usingPCoords .OR. deepAtmosphere .OR. selectSigmaCoord.NE.0 |
735 |
|
|
& .OR. rhoRefFile.NE.' ' .OR. hasWetCSCorners ) |
736 |
|
|
& ) THEN |
737 |
|
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: ', |
738 |
|
|
& 'Smag-3D not yet implemented for this set-up' |
739 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
740 |
|
|
errCount = errCount + 1 |
741 |
|
|
ENDIF |
742 |
jmc |
1.47 |
|
743 |
jmc |
1.9 |
IF (.NOT.useCDscheme .AND. (tauCD.NE.0. .OR. rCD.NE.-1.) ) THEN |
744 |
jmc |
1.40 |
C- jmc: since useCDscheme is a new [04-13-03] flag (default=F), |
745 |
|
|
C put this WARNING to stress that even if CD-scheme parameters |
746 |
|
|
C (tauCD,rCD) are set, CD-scheme is not used without useCDscheme=T |
747 |
jmc |
1.9 |
C- and STOP if using mom_fluxform (following Chris advise). |
748 |
|
|
C- jmc: but ultimately, this block can/will be removed. |
749 |
|
|
IF (.NOT.vectorInvariantMomentum.AND.momStepping) THEN |
750 |
jmc |
1.40 |
WRITE(msgBuf,'(A)') |
751 |
jmc |
1.9 |
& 'CONFIG_CHECK: CD-scheme is OFF but params(tauCD,rCD) are set' |
752 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
753 |
jmc |
1.9 |
WRITE(msgBuf,'(2A)') |
754 |
|
|
& 'CONFIG_CHECK: to turn ON CD-scheme: => "useCDscheme=.TRUE."', |
755 |
jmc |
1.40 |
& ' in "data", namelist PARM01' |
756 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
757 |
jmc |
1.61 |
errCount = errCount + 1 |
758 |
jmc |
1.9 |
ENDIF |
759 |
jmc |
1.53 |
WRITE(msgBuf,'(2A)') '** WARNING ** CONFIG_CHECK: ', |
760 |
|
|
& 'CD-scheme is OFF but params(tauCD,rCD) are set' |
761 |
jmc |
1.5 |
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
762 |
jmc |
1.53 |
& SQUEEZE_RIGHT, myThid ) |
763 |
|
|
WRITE(msgBuf,'(3A)') '** WARNING ** to turn ON CD-scheme:', |
764 |
|
|
& ' => "useCDscheme=.TRUE." in "data", namelist PARM01' |
765 |
jmc |
1.4 |
CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, |
766 |
jmc |
1.53 |
& SQUEEZE_RIGHT, myThid ) |
767 |
jmc |
1.12 |
ENDIF |
768 |
|
|
|
769 |
jmc |
1.69 |
IF ( useCDscheme .AND. hasWetCSCorners ) THEN |
770 |
jmc |
1.12 |
WRITE(msgBuf,'(2A)') |
771 |
|
|
& 'CONFIG_CHECK: CD-scheme not implemented on CubedSphere grid' |
772 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
773 |
jmc |
1.69 |
errCount = errCount + 1 |
774 |
jmc |
1.12 |
ENDIF |
775 |
|
|
|
776 |
jmc |
1.48 |
C-- Time-stepping limitations |
777 |
jmc |
1.40 |
IF ( momForcingOutAB.NE.0 .AND. momForcingOutAB.NE.1 ) THEN |
778 |
jmc |
1.34 |
WRITE(msgBuf,'(A,I10,A)') 'CONFIG_CHECK: momForcingOutAB=', |
779 |
|
|
& momForcingOutAB, ' not allowed' |
780 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
781 |
jmc |
1.34 |
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: momForcingOutAB ', |
782 |
|
|
& 'should be =1 (Out of AB) or =0 (In AB)' |
783 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
784 |
jmc |
1.61 |
errCount = errCount + 1 |
785 |
jmc |
1.34 |
ENDIF |
786 |
jmc |
1.40 |
IF ( tracForcingOutAB.NE.0 .AND. tracForcingOutAB.NE.1 ) THEN |
787 |
jmc |
1.34 |
WRITE(msgBuf,'(A,I10,A)') 'CONFIG_CHECK: tracForcingOutAB=', |
788 |
|
|
& tracForcingOutAB, ' not allowed' |
789 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
790 |
jmc |
1.34 |
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: tracForcingOutAB ', |
791 |
|
|
& 'should be =1 (Out of AB) or =0 (In AB)' |
792 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
793 |
jmc |
1.61 |
errCount = errCount + 1 |
794 |
jmc |
1.4 |
ENDIF |
795 |
jmc |
1.71 |
IF ( addFrictionHeating .AND. .NOT.staggerTimeStep ) THEN |
796 |
|
|
WRITE(msgBuf,'(2A)') 'CONFIG_CHECK: addFrictionHeating', |
797 |
|
|
& ' not yet coded for synchronous time-stepping.' |
798 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
799 |
|
|
errCount = errCount + 1 |
800 |
|
|
ENDIF |
801 |
jmc |
1.1 |
|
802 |
jmc |
1.48 |
C-- Grid limitations: |
803 |
mlosch |
1.44 |
IF ( rotateGrid ) THEN |
804 |
|
|
IF ( .NOT. usingSphericalPolarGrid ) THEN |
805 |
|
|
WRITE(msgBuf,'(2A)') |
806 |
|
|
& 'CONFIG_CHECK: specifying Euler angles makes only ', |
807 |
|
|
& 'sense with usingSphericalGrid=.TRUE.' |
808 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
809 |
jmc |
1.61 |
errCount = errCount + 1 |
810 |
mlosch |
1.44 |
ENDIF |
811 |
gforget |
1.65 |
IF ( useFLT .OR. useZonal_Filt .OR. useECCO ) THEN |
812 |
mlosch |
1.44 |
WRITE(msgBuf,'(2A)') |
813 |
|
|
& 'CONFIG_CHECK: specifying Euler angles will probably ', |
814 |
|
|
& 'not work with pkgs FLT, ZONAL_FLT, ECCO' |
815 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
816 |
jmc |
1.61 |
errCount = errCount + 1 |
817 |
mlosch |
1.44 |
ENDIF |
818 |
|
|
ENDIF |
819 |
|
|
|
820 |
jmc |
1.48 |
C-- Packages conflict |
821 |
|
|
IF ( useMATRIX .AND. useGCHEM ) THEN |
822 |
|
|
WRITE(msgBuf,'(2A)') |
823 |
|
|
& 'CONFIG_CHECK: cannot set both: useMATRIX & useGCHEM' |
824 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
825 |
jmc |
1.61 |
errCount = errCount + 1 |
826 |
jmc |
1.48 |
ENDIF |
827 |
|
|
|
828 |
|
|
IF ( useMATRIX .AND. .NOT.usePTRACERS ) THEN |
829 |
|
|
WRITE(msgBuf,'(2A)') |
830 |
|
|
& 'CONFIG_CHECK: cannot set useMATRIX without ', |
831 |
|
|
& 'setting usePTRACERS' |
832 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
833 |
jmc |
1.61 |
errCount = errCount + 1 |
834 |
jmc |
1.48 |
ENDIF |
835 |
|
|
|
836 |
jmc |
1.50 |
IF ( (useSEAICE .OR. useThSIce) .AND. allowFreezing ) THEN |
837 |
|
|
WRITE(msgBuf,'(2A)') |
838 |
|
|
& 'CONFIG_CHECK: cannot set allowFreezing', |
839 |
|
|
& ' with pkgs SEAICE or THSICE' |
840 |
jmc |
1.53 |
CALL PRINT_ERROR( msgBuf, myThid ) |
841 |
jmc |
1.61 |
errCount = errCount + 1 |
842 |
|
|
ENDIF |
843 |
|
|
|
844 |
|
|
IF ( errCount.GE.1 ) THEN |
845 |
|
|
WRITE(msgBuf,'(A,I3,A)') |
846 |
|
|
& 'CONFIG_CHECK: detected', errCount,' fatal error(s)' |
847 |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
848 |
|
|
CALL ALL_PROC_DIE( 0 ) |
849 |
jmc |
1.50 |
STOP 'ABNORMAL END: S/R CONFIG_CHECK' |
850 |
|
|
ENDIF |
851 |
jmc |
1.61 |
_END_MASTER(myThid) |
852 |
|
|
|
853 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
854 |
jmc |
1.50 |
|
855 |
jmc |
1.61 |
_BEGIN_MASTER(myThid) |
856 |
jmc |
1.49 |
WRITE(msgBuf,'(A)') '// CONFIG_CHECK : Normal End' |
857 |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
858 |
|
|
& SQUEEZE_RIGHT, myThid ) |
859 |
|
|
WRITE(msgBuf,'(A)') |
860 |
|
|
&'// =======================================================' |
861 |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
862 |
|
|
& SQUEEZE_RIGHT, myThid ) |
863 |
|
|
WRITE(msgBuf,'(A)') ' ' |
864 |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
865 |
|
|
& SQUEEZE_RIGHT, myThid ) |
866 |
jmc |
1.61 |
_END_MASTER(myThid) |
867 |
jmc |
1.1 |
|
868 |
|
|
RETURN |
869 |
|
|
END |