1 |
C $Header: /u/gcmpack/models/MITgcmUV/model/src/config_check.F,v 1.2 2002/01/31 15:02:18 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "CPP_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: CONFIG_CHECK |
8 |
C !INTERFACE: |
9 |
SUBROUTINE CONFIG_CHECK( myThid ) |
10 |
C !DESCRIPTION: \bv |
11 |
C *=========================================================* |
12 |
C | SUBROUTINE CONFIG_CHECK |
13 |
C | o Check model parameter settings. |
14 |
C *=========================================================* |
15 |
C | This routine help to prevent the use of parameters |
16 |
C | that are not compatible with the model configuration. |
17 |
C *=========================================================* |
18 |
C \ev |
19 |
|
20 |
C !USES: |
21 |
IMPLICIT NONE |
22 |
C === Global variables === |
23 |
#include "SIZE.h" |
24 |
#include "EEPARAMS.h" |
25 |
#include "PARAMS.h" |
26 |
c #include "GRID.h" |
27 |
|
28 |
C !INPUT/OUTPUT PARAMETERS: |
29 |
C === Routine arguments === |
30 |
C myThid - Number of this instances of CONFIG_CHECK |
31 |
INTEGER myThid |
32 |
CEndOfInterface |
33 |
|
34 |
C !LOCAL VARIABLES: |
35 |
C == Local variables == |
36 |
C msgBuf :: Informational/error meesage buffer |
37 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
38 |
CEOP |
39 |
|
40 |
C- check that CPP option is "defined" when running-flag parameter is on: |
41 |
|
42 |
#ifndef ALLOW_NONHYDROSTATIC |
43 |
IF (nonHydrostatic) THEN |
44 |
WRITE(msgBuf,'(A)') |
45 |
& 'CONFIG_CHECK: #undef ALLOW_NONHYDROSTATIC and' |
46 |
CALL PRINT_ERROR( msgBuf , myThid) |
47 |
WRITE(msgBuf,'(A)') |
48 |
& 'CONFIG_CHECK: nonHydrostatic is TRUE' |
49 |
CALL PRINT_ERROR( msgBuf , myThid) |
50 |
STOP 'ABNORMAL END: S/R CONFIG_CHECK' |
51 |
ENDIF |
52 |
#endif |
53 |
|
54 |
#ifndef EXACT_CONSERV |
55 |
IF (exactConserv) THEN |
56 |
WRITE(msgBuf,'(A)') |
57 |
& 'CONFIG_CHECK: #undef EXACT_CONSERV and' |
58 |
CALL PRINT_ERROR( msgBuf , myThid) |
59 |
WRITE(msgBuf,'(A)') |
60 |
& 'CONFIG_CHECK: exactConserv is TRUE' |
61 |
CALL PRINT_ERROR( msgBuf , myThid) |
62 |
STOP 'ABNORMAL END: S/R CONFIG_CHECK' |
63 |
ENDIF |
64 |
#endif |
65 |
|
66 |
#ifndef NONLIN_FRSURF |
67 |
IF (nonlinFreeSurf.NE.0) THEN |
68 |
WRITE(msgBuf,'(A)') |
69 |
& 'CONFIG_CHECK: #undef NONLIN_FRSURF and' |
70 |
CALL PRINT_ERROR( msgBuf , myThid) |
71 |
WRITE(msgBuf,'(A)') |
72 |
& 'CONFIG_CHECK: nonlinFreeSurf is non-zero' |
73 |
CALL PRINT_ERROR( msgBuf , myThid) |
74 |
STOP 'ABNORMAL END: S/R CONFIG_CHECK' |
75 |
ENDIF |
76 |
#endif |
77 |
|
78 |
#ifdef USE_NATURAL_BCS |
79 |
WRITE(msgBuf,'(A)') |
80 |
& 'CONFIG_CHECK: USE_NATURAL_BCS option has been replaced' |
81 |
CALL PRINT_ERROR( msgBuf , myThid) |
82 |
WRITE(msgBuf,'(A)') |
83 |
& 'CONFIG_CHECK: by useRealFreshWaterFlux=TRUE in data file' |
84 |
CALL PRINT_ERROR( msgBuf , myThid) |
85 |
STOP 'ABNORMAL END: S/R CONFIG_CHECK' |
86 |
#endif |
87 |
|
88 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
89 |
|
90 |
C- check parameter consistency : |
91 |
|
92 |
IF ( rigidLid .AND. implicitFreeSurface ) THEN |
93 |
WRITE(msgBuf,'(A,A)') |
94 |
& 'CONFIG_CHECK: Cannot select both implicitFreeSurface', |
95 |
& ' and rigidLid.' |
96 |
CALL PRINT_ERROR( msgBuf , myThid) |
97 |
STOP 'ABNORMAL END: S/R CONFIG_CHECK' |
98 |
ENDIF |
99 |
|
100 |
IF (rigidLid .AND. exactConserv) THEN |
101 |
WRITE(msgBuf,'(A)') |
102 |
& 'CONFIG_CHECK: exactConserv not compatible with' |
103 |
CALL PRINT_ERROR( msgBuf , myThid) |
104 |
WRITE(msgBuf,'(A)') |
105 |
& 'CONFIG_CHECK: rigidLid (meaningless in that case)' |
106 |
CALL PRINT_ERROR( msgBuf , myThid) |
107 |
STOP 'ABNORMAL END: S/R CONFIG_CHECK' |
108 |
ENDIF |
109 |
|
110 |
IF (rigidLid .AND. useRealFreshWaterFlux) THEN |
111 |
WRITE(msgBuf,'(A)') |
112 |
& 'CONFIG_CHECK: useRealFreshWaterFlux not compatible with' |
113 |
CALL PRINT_ERROR( msgBuf , myThid) |
114 |
WRITE(msgBuf,'(A)') |
115 |
& 'CONFIG_CHECK: rigidLid (meaningless in that case)' |
116 |
CALL PRINT_ERROR( msgBuf , myThid) |
117 |
STOP 'ABNORMAL END: S/R CONFIG_CHECK' |
118 |
ENDIF |
119 |
|
120 |
IF ( (implicSurfPress.NE.1. .OR. implicDiv2DFlow.NE.1.) |
121 |
& .AND. nonHydrostatic ) THEN |
122 |
WRITE(msgBuf,'(A,A)') 'CONFIG_CHECK: nonHydrostatic', |
123 |
& ' NOT SAFE with non-fully implicit Barotropic solver' |
124 |
CALL PRINT_ERROR( msgBuf , myThid) |
125 |
WRITE(msgBuf,'(A,A)') 'CONFIG_CHECK: To by-pass this', |
126 |
& 'STOP, comment this test and re-compile config_check' |
127 |
CALL PRINT_ERROR( msgBuf , myThid) |
128 |
STOP 'ABNORMAL END: S/R CONFIG_CHECK' |
129 |
ENDIF |
130 |
|
131 |
IF (nonlinFreeSurf.NE.0 .AND. .NOT.exactConserv) THEN |
132 |
WRITE(msgBuf,'(A)') |
133 |
& 'CONFIG_CHECK: nonlinFreeSurf cannot be used' |
134 |
CALL PRINT_ERROR( msgBuf , myThid) |
135 |
WRITE(msgBuf,'(A)') |
136 |
& 'CONFIG_CHECK: without exactConserv' |
137 |
CALL PRINT_ERROR( msgBuf , myThid) |
138 |
STOP 'ABNORMAL END: S/R CONFIG_CHECK' |
139 |
ENDIF |
140 |
|
141 |
C- note : not implemented in Release1_beta1 but it's done now (since 01-30-02) |
142 |
c IF (nonlinFreeSurf.NE.0 .AND. useOBCS ) THEN |
143 |
c WRITE(msgBuf,'(A)') |
144 |
c & 'CONFIG_CHECK: nonlinFreeSurf not yet implemented' |
145 |
c CALL PRINT_ERROR( msgBuf , 1) |
146 |
c WRITE(msgBuf,'(A)') |
147 |
c & 'CONFIG_CHECK: in OBC package' |
148 |
c CALL PRINT_ERROR( msgBuf , 1) |
149 |
c STOP 'ABNORMAL END: S/R CONFIG_CHECK' |
150 |
c ENDIF |
151 |
|
152 |
IF (nonlinFreeSurf.NE.0 .AND. nonHydrostatic) THEN |
153 |
WRITE(msgBuf,'(A)') |
154 |
& 'CONFIG_CHECK: nonlinFreeSurf not yet implemented' |
155 |
CALL PRINT_ERROR( msgBuf , myThid) |
156 |
WRITE(msgBuf,'(A)') |
157 |
& 'CONFIG_CHECK: in nonHydrostatic code' |
158 |
CALL PRINT_ERROR( msgBuf , myThid) |
159 |
STOP 'ABNORMAL END: S/R CONFIG_CHECK' |
160 |
ENDIF |
161 |
|
162 |
IF (nonlinFreeSurf.NE.0 .AND. deltaTmom.NE.deltaTtracer) THEN |
163 |
WRITE(msgBuf,'(A)') |
164 |
& 'CONFIG_CHECK: WARNING: nonlinFreeSurf might cause' |
165 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
166 |
& SQUEEZE_RIGHT , 1) |
167 |
WRITE(msgBuf,'(A)') |
168 |
& 'CONFIG_CHECK: problems with different time-steps' |
169 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
170 |
& SQUEEZE_RIGHT , 1) |
171 |
ENDIF |
172 |
|
173 |
IF (useRealFreshWaterFlux .AND. exactConserv |
174 |
& .AND.startTime.NE.0. .AND. implicSurfPress.EQ.0. _d 0) THEN |
175 |
WRITE(msgBuf,'(A)') |
176 |
& 'CONFIG_CHECK: RealFreshWaterFlux+implicSurfP=0+exactConserv:' |
177 |
CALL PRINT_ERROR( msgBuf , myThid) |
178 |
WRITE(msgBuf,'(A)') |
179 |
& 'CONFIG_CHECK: restart not implemented in this config' |
180 |
CALL PRINT_ERROR( msgBuf , myThid) |
181 |
STOP 'ABNORMAL END: S/R CONFIG_CHECK' |
182 |
ENDIF |
183 |
|
184 |
#ifndef NONLIN_FRSURF |
185 |
IF (useRealFreshWaterFlux .AND. exactConserv |
186 |
& .AND. implicSurfPress.NE.1. _d 0 ) THEN |
187 |
WRITE(msgBuf,'(A)') |
188 |
& 'CONFIG_CHECK: Pb with restart in this config' |
189 |
CALL PRINT_ERROR( msgBuf , myThid) |
190 |
WRITE(msgBuf,'(A)') |
191 |
& 'CONFIG_CHECK: ==> use #define NONLIN_FRSURF to fix it' |
192 |
CALL PRINT_ERROR( msgBuf , myThid) |
193 |
STOP 'ABNORMAL END: S/R CONFIG_CHECK' |
194 |
ENDIF |
195 |
#endif |
196 |
|
197 |
WRITE(msgBuf,'(A)') 'CONFIG_CHECK: OK' |
198 |
CALL PRINT_MESSAGE(msgBuf,standardMessageUnit, |
199 |
& SQUEEZE_RIGHT,myThid) |
200 |
|
201 |
RETURN |
202 |
END |