1 |
C $Header: /u/gcmpack/MITgcm/pkg/seaice/seaice_readparms.F,v 1.33 2006/03/02 16:09:47 mlosch Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "PACKAGES_CONFIG.h" |
5 |
#include "SEAICE_OPTIONS.h" |
6 |
|
7 |
SUBROUTINE SEAICE_READPARMS( myThid ) |
8 |
C /==========================================================\ |
9 |
C | SUBROUTINE SEAICE_READPARMS | |
10 |
C | o Routine to read in file data.seaice | |
11 |
C \==========================================================/ |
12 |
IMPLICIT NONE |
13 |
|
14 |
C === Global variables === |
15 |
#include "SIZE.h" |
16 |
#include "EEPARAMS.h" |
17 |
#include "PARAMS.h" |
18 |
#include "GRID.h" |
19 |
#include "SEAICE_PARAMS.h" |
20 |
#ifdef ALLOW_COST |
21 |
# include "SEAICE_COST.h" |
22 |
#endif |
23 |
#ifdef ALLOW_MNC |
24 |
# include "MNC_PARAMS.h" |
25 |
#endif |
26 |
#ifdef ALLOW_CAL |
27 |
# include "cal.h" |
28 |
#endif |
29 |
|
30 |
C === Routine arguments === |
31 |
C myThid - Number of this instance of SEAICE_READPARMS |
32 |
INTEGER myThid |
33 |
|
34 |
C === Local variables === |
35 |
C msgBuf - Informational/error meesage buffer |
36 |
C errIO - IO error flag |
37 |
C iUnit - Work variable for IO unit number |
38 |
|
39 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
40 |
INTEGER errIO, iUnit |
41 |
|
42 |
C-- SEAICE parameters |
43 |
NAMELIST /SEAICE_PARM01/ |
44 |
& SEAICEwriteState, SEAICEuseDYNAMICS, |
45 |
& SEAICEuseFluxForm, |
46 |
& LAD, IMAX_TICE, |
47 |
& SEAICEadvScheme, |
48 |
& SEAICE_deltaTtherm, SEAICE_deltaTdyn, |
49 |
& SEAICE_dumpFreq, SEAICE_taveFreq, SEAICE_initialHEFF, |
50 |
& SEAICE_rhoAir, SEAICE_rhoIce, |
51 |
& SEAICE_drag, SEAICE_waterDrag, SEAICE_dryIceAlb, |
52 |
& SEAICE_wetIceAlb, SEAICE_drySnowAlb, SEAICE_wetSnowAlb, |
53 |
& SEAICE_waterAlbedo, SEAICE_strength, SEAICE_eccen, |
54 |
& SEAICE_sensHeat, SEAICE_latentWater, SEAICE_latentIce, |
55 |
& SEAICE_iceConduct, SEAICE_snowConduct, SEAICE_emissivity, |
56 |
& SEAICE_snowThick, SEAICE_shortwave, SEAICE_freeze, OCEAN_drag, |
57 |
& uwindFile, vwindFile, atempFile, aqhFile, lwdownFile, |
58 |
& swdownFile, precipFile, evapFile, runoffFile, HeffFile, |
59 |
& LSR_ERROR, DIFF1, A22, HO, |
60 |
& WindForcingStart, WindForcingEnd, WindForcingPeriod, |
61 |
& FluxForcingStart, FluxForcingEnd, FluxForcingPeriod, |
62 |
& SSTForcingStart, SSTForcingEnd, SSTForcingPeriod, |
63 |
& SSSForcingStart, SSSForcingEnd, SSSForcingPeriod, |
64 |
& StartingYear, EndingYear, |
65 |
& SEAICE_airTurnAngle, SEAICE_waterTurnAngle, |
66 |
& MAX_HEFF, MIN_ATEMP, MIN_LWDOWN, MAX_TICE, MIN_TICE, |
67 |
& SEAICE_EPS, SEAICE_EPS_SQ, |
68 |
& SEAICE_tave_mnc |
69 |
c & SEAICE_tave_mnc, SEAICE_dump_mnc, SEAICE_mon_mnc |
70 |
|
71 |
#ifdef ALLOW_COST |
72 |
NAMELIST /SEAICE_PARM02/ |
73 |
& mult_ice, cost_ice_flag, |
74 |
& costIceStart1, costIceStart2, |
75 |
& costIceEnd1, costIceEnd2, |
76 |
& cost_ice_flag, |
77 |
& mult_smrarea, smrareadatfile, smrareabarfile, |
78 |
& wsmrarea0, wmean_smrarea, smrarea_errfile, |
79 |
& smrareastartdate1, smrareastartdate2, smrareaperiod |
80 |
#endif |
81 |
|
82 |
_BEGIN_MASTER(myThid) |
83 |
|
84 |
write(msgbuf,'(A)') |
85 |
&' ' |
86 |
call print_message( msgbuf, standardmessageunit, |
87 |
& SQUEEZE_RIGHT , mythid) |
88 |
WRITE(msgBuf,'(A)') ' SEAICE_READPARMS: opening data.seaice' |
89 |
call print_message( msgbuf, standardmessageunit, |
90 |
& SQUEEZE_RIGHT , mythid) |
91 |
|
92 |
CALL OPEN_COPY_DATA_FILE( |
93 |
I 'data.seaice', 'SEAICE_READPARMS', |
94 |
O iUnit, |
95 |
I myThid ) |
96 |
|
97 |
C-- set default sea ice parameters |
98 |
SEAICEwriteState = .FALSE. |
99 |
#ifdef SEAICE_ALLOW_DYNAMICS |
100 |
SEAICEuseDYNAMICS = .TRUE. |
101 |
#else |
102 |
SEAICEuseDYNAMICS = .FALSE. |
103 |
#endif |
104 |
SEAICEuseFluxForm = .FALSE. |
105 |
SEAICEadvScheme = 2 |
106 |
SEAICE_deltaTtherm = dTtracerLev(1) |
107 |
SEAICE_deltaTdyn = dTtracerLev(1) |
108 |
SEAICE_dumpFreq = dumpFreq |
109 |
SEAICE_taveFreq = taveFreq |
110 |
#ifdef ALLOW_MNC |
111 |
SEAICE_tave_mnc = timeave_mnc |
112 |
SEAICE_dump_mnc = snapshot_mnc |
113 |
SEAICE_mon_mnc = monitor_mnc |
114 |
#else |
115 |
SEAICE_tave_mnc = .FALSE. |
116 |
SEAICE_dump_mnc = .FALSE. |
117 |
SEAICE_mon_mnc = .FALSE. |
118 |
#endif |
119 |
SEAICE_initialHEFF = ZERO |
120 |
SEAICE_rhoAir = 1.3 _d 0 |
121 |
SEAICE_rhoIce = 0.91 _d +03 |
122 |
SEAICE_drag = 0.002 _d 0 |
123 |
OCEAN_drag = 0.001 _d 0 |
124 |
SEAICE_waterDrag = 5.5 _d 0 |
125 |
SEAICE_dryIceAlb = 0.75 _d 0 |
126 |
SEAICE_wetIceAlb = 0.66 _d 0 |
127 |
SEAICE_drySnowAlb = 0.84 _d 0 |
128 |
SEAICE_wetSnowAlb = 0.7 _d 0 |
129 |
SEAICE_waterAlbedo = 0.1 _d +00 |
130 |
SEAICE_strength = 2.75 _d +04 |
131 |
SEAICE_eccen = 2. _d 0 |
132 |
C SEAICE_sensHeat = 1.75 _d -03 * 1004 * 1.3 |
133 |
SEAICE_sensHeat = 2.284 _d +00 |
134 |
C SEAICE_latentWater = 1.75 _d -03 * 2.500 _d 06 * 1.3 |
135 |
SEAICE_latentWater = 5.6875 _d +03 |
136 |
C SEAICE_latentIce = 1.75 _d -03 * 2.834 _d 06 * 1.3 |
137 |
SEAICE_latentIce = 6.4474 _d +03 |
138 |
SEAICE_iceConduct = 2.1656 _d +00 |
139 |
SEAICE_snowConduct = 3.1 _d -01 |
140 |
SEAICE_emissivity = 5.5 _d -08 |
141 |
SEAICE_snowThick = 0.15 _d 0 |
142 |
SEAICE_shortwave = 0.30 _d 0 |
143 |
SEAICE_freeze = -1.96 _d 0 |
144 |
uwindFile = ' ' |
145 |
vwindFile = ' ' |
146 |
atempFile = ' ' |
147 |
aqhFile = ' ' |
148 |
lwdownFile = ' ' |
149 |
swdownFile = ' ' |
150 |
precipFile = ' ' |
151 |
evapFile = ' ' |
152 |
runoffFile = ' ' |
153 |
HeffFile = ' ' |
154 |
LAD = 2 |
155 |
IMAX_TICE = 10 |
156 |
LSR_ERROR = 0.0001 _d 0 |
157 |
DIFF1 = .002 _d 0 |
158 |
DIFF1 = 2.0*DIFF1 |
159 |
A22 = 0.15 _d 0 |
160 |
HO = 0.5 _d 0 |
161 |
SEAICE_airTurnAngle = 0.0 _d 0 |
162 |
SEAICE_waterTurnAngle = 0.0 _d 0 |
163 |
WindForcingStart = -99999. |
164 |
WindForcingEnd = -99999. |
165 |
WindForcingPeriod = -99999. |
166 |
FluxForcingStart = -99999. |
167 |
FluxForcingEnd = -99999. |
168 |
FluxForcingPeriod = -99999. |
169 |
SSTForcingStart = -99999. |
170 |
SSTForcingEnd = -99999. |
171 |
SSTForcingPeriod = -99999. |
172 |
SSSForcingStart = -99999. |
173 |
SSSForcingEnd = -99999. |
174 |
SSSForcingPeriod = -99999. |
175 |
StartingYear = 1948. |
176 |
EndingYear = 2000. |
177 |
MAX_HEFF = 10. _d 0 |
178 |
MIN_ATEMP = -50. _d 0 |
179 |
MIN_LWDOWN = 60. _d 0 |
180 |
MAX_TICE = 30. _d 0 |
181 |
MIN_TICE = -50. _d 0 |
182 |
SEAICE_EPS = 1. _d -10 |
183 |
SEAICE_EPS_SQ = -99999. |
184 |
|
185 |
#ifdef ALLOW_COST |
186 |
mult_ice = 0. _d 0 |
187 |
costIceStart1 = 0 |
188 |
costIceStart2 = 0 |
189 |
costIceEnd1 = 0 |
190 |
costIceEnd2 = 0 |
191 |
cost_ice_flag = 1 |
192 |
c |
193 |
mult_smrarea = 0. _d 0 |
194 |
wsmrarea0 = 0.5 _d 0 |
195 |
wmean_smrarea = 0.5 _d 0 |
196 |
smrareabarfile = 'smrareabar' |
197 |
smrareadatfile = ' ' |
198 |
smrarea_errfile = ' ' |
199 |
# ifdef ALLOW_CAL |
200 |
smrareastartdate1 = startDate_1 |
201 |
smrareastartdate2 = startDate_2 |
202 |
# endif |
203 |
#endif |
204 |
|
205 |
C-- Read settings from model parameter file "data.seaice". |
206 |
READ(UNIT=iUnit,NML=SEAICE_PARM01,IOSTAT=errIO) |
207 |
IF ( errIO .LT. 0 ) THEN |
208 |
WRITE(msgBuf,'(A)') |
209 |
& 'S/R SEAICE_READPARMS' |
210 |
CALL PRINT_ERROR( msgBuf , mythid) |
211 |
WRITE(msgBuf,'(A)') |
212 |
& 'Error reading numerical model ' |
213 |
CALL PRINT_ERROR( msgBuf , mythid) |
214 |
WRITE(msgBuf,'(A)') |
215 |
& 'parameter file "data.seaice"' |
216 |
CALL PRINT_ERROR( msgBuf , mythid) |
217 |
WRITE(msgBuf,'(A)') |
218 |
& 'Problem in namelist SEAICE_PARM01' |
219 |
CALL PRINT_ERROR( msgBuf , mythid) |
220 |
C CALL MODELDATA_EXAMPLE( myThid ) |
221 |
STOP 'ABNORMAL END: S/R SEAICE_READPARMS' |
222 |
ENDIF |
223 |
|
224 |
#ifdef ALLOW_COST |
225 |
READ(UNIT=iUnit,NML=SEAICE_PARM02,IOSTAT=errIO) |
226 |
IF ( errIO .LT. 0 ) THEN |
227 |
WRITE(msgBuf,'(A)') |
228 |
& 'S/R SEAICE_READPARMS' |
229 |
CALL PRINT_ERROR( msgBuf , mythid) |
230 |
WRITE(msgBuf,'(A)') |
231 |
& 'Error reading numerical model ' |
232 |
CALL PRINT_ERROR( msgBuf , mythid) |
233 |
WRITE(msgBuf,'(A)') |
234 |
& 'parameter file "data.seaice"' |
235 |
CALL PRINT_ERROR( msgBuf , mythid) |
236 |
WRITE(msgBuf,'(A)') |
237 |
& 'Problem in namelist SEAICE_PARM02' |
238 |
CALL PRINT_ERROR( msgBuf , mythid) |
239 |
C CALL MODELDATA_EXAMPLE( myThid ) |
240 |
STOP 'ABNORMAL END: S/R SEAICE_READPARMS' |
241 |
ENDIF |
242 |
#endif |
243 |
|
244 |
CLOSE(iUnit) |
245 |
|
246 |
WRITE(msgBuf,'(A)') |
247 |
& ' SEAICE_READPARMS: finished reading data.seaice' |
248 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
249 |
& SQUEEZE_RIGHT , mythid) |
250 |
|
251 |
_END_MASTER(myThid) |
252 |
|
253 |
C-- Everyone else must wait for the parameters to be loaded |
254 |
_BARRIER |
255 |
|
256 |
C Check that requested time step size is supported. The combination |
257 |
C below is the only one that is supported at this time. Does not |
258 |
C mean that something fancier will not work, just that it has not |
259 |
C yet been tried nor thought through. |
260 |
IF ( SEAICE_deltaTtherm .NE. dTtracerLev(1) .OR. |
261 |
& SEAICE_deltaTdyn .LT. SEAICE_deltaTtherm .OR. |
262 |
& (SEAICE_deltaTdyn/SEAICE_deltaTtherm) .NE. |
263 |
& INT(SEAICE_deltaTdyn/SEAICE_deltaTtherm) ) THEN |
264 |
WRITE(msgBuf,'(A)') |
265 |
& 'Unsupported combination of SEAICE_deltaTtherm,' |
266 |
CALL PRINT_ERROR( msgBuf , mythid) |
267 |
WRITE(msgBuf,'(A)') |
268 |
& ' SEAICE_deltaTdyn, and dTtracerLev(1)' |
269 |
CALL PRINT_ERROR( msgBuf , mythid) |
270 |
STOP 'ABNORMAL END: S/R SEAICE_READPARMS' |
271 |
ENDIF |
272 |
|
273 |
|
274 |
#ifndef SEAICE_EXTERNAL_FORCING |
275 |
IF ( FluxForcingStart .EQ. -99999. .OR. |
276 |
& FluxForcingEnd .EQ. -99999. .OR. |
277 |
& FluxForcingPeriod .EQ. -99999. ) THEN |
278 |
WRITE(msgBuf,'(A)') 'Specify FluxForcing* in data.seaice' |
279 |
CALL PRINT_ERROR( msgBuf , mythid) |
280 |
STOP 'ABNORMAL END: S/R SEAICE_READPARMS' |
281 |
ENDIF |
282 |
IF ( WindForcingStart .EQ. -99999. ) |
283 |
& WindForcingStart = FluxForcingStart |
284 |
IF ( WindForcingEnd .EQ. -99999. ) |
285 |
& WindForcingEnd = FluxForcingEnd |
286 |
IF ( WindForcingPeriod .EQ. -99999. ) |
287 |
& WindForcingPeriod = FluxForcingPeriod |
288 |
IF ( SSTForcingStart .EQ. -99999. ) |
289 |
& SSTForcingStart = FluxForcingStart |
290 |
IF ( SSTForcingEnd .EQ. -99999. ) |
291 |
& SSTForcingEnd = FluxForcingEnd |
292 |
IF ( SSTForcingPeriod .EQ. -99999. ) |
293 |
& SSTForcingPeriod = FluxForcingPeriod |
294 |
IF ( SSSForcingStart .EQ. -99999. ) |
295 |
& SSSForcingStart = FluxForcingStart |
296 |
IF ( SSSForcingEnd .EQ. -99999. ) |
297 |
& SSSForcingEnd = FluxForcingEnd |
298 |
IF ( SSSForcingPeriod .EQ. -99999. ) |
299 |
& SSSForcingPeriod = FluxForcingPeriod |
300 |
#endif /* SEAICE_EXTERNAL_FORCING */ |
301 |
|
302 |
IF ( SEAICE_EPS_SQ .EQ. -99999. ) |
303 |
& SEAICE_EPS_SQ = SEAICE_EPS * SEAICE_EPS |
304 |
|
305 |
C- Set Output type flags : |
306 |
SEAICE_tave_mdsio = .TRUE. |
307 |
SEAICE_dump_mdsio = .TRUE. |
308 |
SEAICE_mon_stdio = .TRUE. |
309 |
#ifdef ALLOW_MNC |
310 |
IF (useMNC) THEN |
311 |
C------- |
312 |
C- seaice Monitor is (unfortunately) not independent from the main monitor |
313 |
C => turn off MNC flags for now |
314 |
SEAICE_mon_mnc = .FALSE. |
315 |
C------- |
316 |
IF ( .NOT.outputTypesInclusive |
317 |
& .AND. SEAICE_tave_mnc ) SEAICE_tave_mdsio = .FALSE. |
318 |
IF ( .NOT.outputTypesInclusive |
319 |
& .AND. SEAICE_dump_mnc ) SEAICE_dump_mdsio = .FALSE. |
320 |
IF ( .NOT.outputTypesInclusive |
321 |
& .AND. SEAICE_mon_mnc ) SEAICE_mon_stdio = .FALSE. |
322 |
ENDIF |
323 |
#endif |
324 |
|
325 |
C-- Summarise pkg/seaice cofiguration |
326 |
CALL SEAICE_SUMMARY( myThid ) |
327 |
|
328 |
C Initialize MNC variable information for SEAICE |
329 |
IF ( useMNC .AND. |
330 |
& (seaice_tave_mnc.OR.seaice_dump_mnc.OR.SEAICE_mon_mnc) |
331 |
& ) THEN |
332 |
CALL SEAICE_MNC_INIT( myThid ) |
333 |
ENDIF |
334 |
|
335 |
RETURN |
336 |
END |