1 |
C $Header: /u/gcmpack/MITgcm/pkg/exf/exf_readparms.F,v 1.32 2006/06/05 22:51:23 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "EXF_OPTIONS.h" |
5 |
#ifdef ALLOW_OBCS |
6 |
# include "OBCS_OPTIONS.h" |
7 |
#endif |
8 |
|
9 |
subroutine exf_readparms( mythid ) |
10 |
|
11 |
c ================================================================== |
12 |
c SUBROUTINE exf_readparms |
13 |
c ================================================================== |
14 |
c |
15 |
c o This routine initialises the package that calculates external |
16 |
c forcing fields for a given timestep of the MITgcmUV. Parameters |
17 |
c for this package are set in "data.externalforcing". Some additional |
18 |
c precompiler switches have to be specified in "EXF_OPTIONS.h". |
19 |
c |
20 |
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
21 |
c |
22 |
c changed: Christian Eckert eckert@mit.edu 11-Jan-2000 |
23 |
c - Restructured the code in order to create a package |
24 |
c for the MITgcmUV. |
25 |
c Christian Eckert eckert@mit.edu 12-Feb-2000 |
26 |
c - Changed Routine names (package prefix: exf_) |
27 |
c changed: Patrick Heimbach, heimbach@mit.edu 04-May-2000 |
28 |
c - changed the handling of precip and sflux with respect |
29 |
c to CPP options ALLOW_BULKFORMULAE and ALLOW_ATM_TEMP |
30 |
c changed: Ralf.Giering@FastOpt.de 25-Mai-20000 |
31 |
c - moved relaxation and climatology to extra routines |
32 |
c Patrick Heimbach, heimbach@mit.edu 04-May-2000 |
33 |
c - added obcs parameters |
34 |
c changed: Virginie Thierry, vthierry@ucsd.edu 04-June-2001 |
35 |
c - added new obcs parameters (for each boundaries) |
36 |
c included runoff D. Stammer, Nov. 25, 2001 |
37 |
c included pressure forcing. heimbach@mit.edu 05-Nov-2002 |
38 |
c added "repeatPeriod" for cycling of forcing datasets 19-Dec-2002 |
39 |
c mods for pkg/seaice: menemenlis@jpl.nasa.gov 20-Dec-2002 |
40 |
c |
41 |
c ================================================================== |
42 |
c SUBROUTINE exf_readparms |
43 |
c ================================================================== |
44 |
|
45 |
implicit none |
46 |
|
47 |
c == global variables == |
48 |
|
49 |
#include "EEPARAMS.h" |
50 |
#include "SIZE.h" |
51 |
#include "PARAMS.h" |
52 |
#include "cal.h" |
53 |
#include "exf.h" |
54 |
#include "exf_param.h" |
55 |
#include "exf_constants.h" |
56 |
|
57 |
c == routine arguments == |
58 |
|
59 |
integer mythid |
60 |
|
61 |
c == local variables == |
62 |
|
63 |
integer i |
64 |
integer date_array(4), difftime(4) |
65 |
integer iUnit |
66 |
|
67 |
character*(max_len_mbuf) msgbuf |
68 |
|
69 |
c == end of interface == |
70 |
|
71 |
c Surface flux data. |
72 |
namelist /exf_nml/ |
73 |
& windstressmax, repeatPeriod, exf_albedo, |
74 |
& ocean_emissivity, ice_emissivity, snow_emissivity, |
75 |
& hfluxstartdate1, hfluxstartdate2, hfluxperiod, |
76 |
& atempstartdate1, atempstartdate2, atempperiod, |
77 |
& aqhstartdate1, aqhstartdate2, aqhperiod, |
78 |
& sfluxstartdate1, sfluxstartdate2, sfluxperiod, |
79 |
& evapstartdate1, evapstartdate2, evapperiod, |
80 |
& precipstartdate1, precipstartdate2, precipperiod, |
81 |
& snowprecipstartdate1, snowprecipstartdate2, snowprecipperiod, |
82 |
& runoffstartdate1, runoffstartdate2, runoffperiod, |
83 |
& ustressstartdate1, ustressstartdate2, ustressperiod, |
84 |
& vstressstartdate1, vstressstartdate2, vstressperiod, |
85 |
& uwindstartdate1, uwindstartdate2, uwindperiod, |
86 |
& vwindstartdate1, vwindstartdate2, vwindperiod, |
87 |
& wspeedstartdate1, wspeedstartdate2, wspeedperiod, |
88 |
& swfluxstartdate1, swfluxstartdate2, swfluxperiod, |
89 |
& lwfluxstartdate1, lwfluxstartdate2, lwfluxperiod, |
90 |
& swdownstartdate1, swdownstartdate2, swdownperiod, |
91 |
& lwdownstartdate1, lwdownstartdate2, lwdownperiod, |
92 |
& obcsNstartdate1, obcsNstartdate2, obcsNperiod, |
93 |
& obcsSstartdate1, obcsSstartdate2, obcsSperiod, |
94 |
& obcsEstartdate1, obcsEstartdate2, obcsEperiod, |
95 |
& obcsWstartdate1, obcsWstartdate2, obcsWperiod, |
96 |
&apressurestartdate1,apressurestartdate2,apressureperiod, |
97 |
& hfluxfile, atempfile, aqhfile, |
98 |
& sfluxfile, precipfile, runofffile, |
99 |
& ustressfile, vstressfile, evapfile, |
100 |
& snowprecipfile, uwindfile, vwindfile, |
101 |
& wspeedfile, swfluxfile, lwfluxfile, |
102 |
& apressurefile, swdownfile, lwdownfile, |
103 |
& exf_iprec, exf_yftype, |
104 |
& useExfYearlyFields, twoDigitYear, useExfCheckRange, |
105 |
& exf_inscal_hflux, exf_inscal_sflux, exf_inscal_evap, |
106 |
& exf_inscal_ustress, exf_inscal_vstress, |
107 |
& exf_inscal_uwind, exf_inscal_vwind, exf_inscal_wspeed, |
108 |
& exf_inscal_atemp, exf_offset_atemp, exf_inscal_aqh, |
109 |
& exf_inscal_sst, exf_inscal_sss, |
110 |
& exf_inscal_swflux, exf_inscal_lwflux, exf_inscal_precip, |
111 |
& exf_inscal_runoff, exf_inscal_apressure, exf_inscal_snowprecip, |
112 |
& exf_inscal_swdown, exf_inscal_lwdown, |
113 |
& exf_outscal_hflux, exf_outscal_ustress, exf_outscal_vstress, |
114 |
& exf_outscal_swflux, exf_outscal_sst, exf_outscal_sss, |
115 |
& exf_outscal_sflux, exf_outscal_apressure, |
116 |
& hfluxconst, atempconst, aqhconst, sfluxconst, evapconst, |
117 |
& precipconst, snowprecipconst, runoffconst, ustressconst, |
118 |
& vstressconst, uwindconst, vwindconst, wspeedconst, swfluxconst, |
119 |
& lwfluxconst, swdownconst, lwdownconst, apressureconst, |
120 |
& hflux_exfremo_intercept, hflux_exfremo_slope, |
121 |
& atemp_exfremo_intercept, atemp_exfremo_slope, |
122 |
& aqh_exfremo_intercept, aqh_exfremo_slope, |
123 |
& sflux_exfremo_intercept, sflux_exfremo_slope, |
124 |
& evap_exfremo_intercept, evap_exfremo_slope, |
125 |
& precip_exfremo_intercept, precip_exfremo_slope, |
126 |
& snowprecip_exfremo_intercept, snowprecip_exfremo_slope, |
127 |
& runoff_exfremo_intercept, runoff_exfremo_slope, |
128 |
& ustress_exfremo_intercept, ustress_exfremo_slope, |
129 |
& vstress_exfremo_intercept, vstress_exfremo_slope, |
130 |
& uwind_exfremo_intercept, uwind_exfremo_slope, |
131 |
& vwind_exfremo_intercept, vwind_exfremo_slope, |
132 |
& wspeed_exfremo_intercept, wspeed_exfremo_slope, |
133 |
& swflux_exfremo_intercept, swflux_exfremo_slope, |
134 |
& lwflux_exfremo_intercept, lwflux_exfremo_slope, |
135 |
& swdown_exfremo_intercept, swdown_exfremo_slope, |
136 |
& lwdown_exfremo_intercept, lwdown_exfremo_slope, |
137 |
& apressure_exfremo_intercept, apressure_exfremo_slope |
138 |
#ifdef USE_EXF_INTERPOLATION |
139 |
& ,ustress_lon0, ustress_lon_inc, ustress_lat0, ustress_lat_inc, |
140 |
& ustress_nlon, ustress_nlat, |
141 |
& vstress_lon0, vstress_lon_inc, vstress_lat0, vstress_lat_inc, |
142 |
& vstress_nlon, vstress_nlat, |
143 |
& hflux_lon0, hflux_lon_inc, hflux_lat0, hflux_lat_inc, |
144 |
& hflux_nlon, hflux_nlat, |
145 |
& sflux_lon0, sflux_lon_inc, sflux_lat0, sflux_lat_inc, |
146 |
& sflux_nlon, sflux_nlat, |
147 |
& swflux_lon0, swflux_lon_inc, swflux_lat0, swflux_lat_inc, |
148 |
& swflux_nlon, swflux_nlat, |
149 |
& runoff_lon0, runoff_lon_inc, runoff_lat0, runoff_lat_inc, |
150 |
& runoff_nlon, runoff_nlat, |
151 |
& atemp_lon0, atemp_lon_inc, atemp_lat0, atemp_lat_inc, |
152 |
& atemp_nlon, atemp_nlat, |
153 |
& aqh_lon0, aqh_lon_inc, aqh_lat0, aqh_lat_inc, aqh_nlon, aqh_nlat, |
154 |
&evap_lon0,evap_lon_inc,evap_lat0,evap_lat_inc,evap_nlon,evap_nlat, |
155 |
& precip_lon0, precip_lon_inc, precip_lat0, precip_lat_inc, |
156 |
& precip_nlon, precip_nlat, |
157 |
& snowprecip_lon0, snowprecip_lon_inc, snowprecip_nlon, |
158 |
& snowprecip_lat0, snowprecip_lat_inc, snowprecip_nlat, |
159 |
& uwind_lon0, uwind_lon_inc, uwind_lat0, uwind_lat_inc, |
160 |
& uwind_nlon, uwind_nlat, |
161 |
& vwind_lon0, vwind_lon_inc, vwind_lat0, vwind_lat_inc, |
162 |
& vwind_nlon, vwind_nlat, |
163 |
& wspeed_lon0, wspeed_lon_inc, wspeed_lat0, wspeed_lat_inc, |
164 |
& wspeed_nlon, wspeed_nlat, |
165 |
& lwflux_lon0, lwflux_lon_inc, lwflux_lat0, lwflux_lat_inc, |
166 |
& lwflux_nlon, lwflux_nlat, |
167 |
& swdown_lon0, swdown_lon_inc, swdown_lat0, swdown_lat_inc, |
168 |
& swdown_nlon, swdown_nlat, |
169 |
& lwdown_lon0, lwdown_lon_inc, lwdown_lat0, lwdown_lat_inc, |
170 |
& lwdown_nlon, lwdown_nlat, |
171 |
& apressure_lon0,apressure_lon_inc,apressure_nlon, |
172 |
& apressure_lat0,apressure_lat_inc,apressure_nlat |
173 |
#endif |
174 |
|
175 |
_BEGIN_MASTER(mythid) |
176 |
|
177 |
c Set default values. |
178 |
|
179 |
year2sec = 365.*86400. |
180 |
exf_monFreq = monitorFreq |
181 |
|
182 |
c Calendar data. |
183 |
hfluxstartdate1 = 0 |
184 |
hfluxstartdate2 = 0 |
185 |
hfluxperiod = 0.0 _d 0 |
186 |
hfluxconst = 0.0 _d 0 |
187 |
hflux_exfremo_intercept = 0.0 _d 0 |
188 |
hflux_exfremo_slope = 0.0 _d 0 |
189 |
|
190 |
atempstartdate1 = 0 |
191 |
atempstartdate2 = 0 |
192 |
atempperiod = 0.0 _d 0 |
193 |
atempconst = celsius2K |
194 |
atemp_exfremo_intercept = 0.0 _d 0 |
195 |
atemp_exfremo_slope = 0.0 _d 0 |
196 |
|
197 |
aqhstartdate1 = 0 |
198 |
aqhstartdate2 = 0 |
199 |
aqhperiod = 0.0 _d 0 |
200 |
aqhconst = 0.0 _d 0 |
201 |
aqh_exfremo_intercept = 0.0 _d 0 |
202 |
aqh_exfremo_slope = 0.0 _d 0 |
203 |
|
204 |
sfluxstartdate1 = 0 |
205 |
sfluxstartdate2 = 0 |
206 |
sfluxperiod = 0.0 _d 0 |
207 |
sfluxconst = 0.0 _d 0 |
208 |
sflux_exfremo_intercept = 0.0 _d 0 |
209 |
sflux_exfremo_slope = 0.0 _d 0 |
210 |
|
211 |
evapstartdate1 = 0 |
212 |
evapstartdate2 = 0 |
213 |
evapperiod = 0.0 _d 0 |
214 |
evapconst = 0.0 _d 0 |
215 |
evap_exfremo_intercept = 0.0 _d 0 |
216 |
evap_exfremo_slope = 0.0 _d 0 |
217 |
|
218 |
precipstartdate1 = 0 |
219 |
precipstartdate2 = 0 |
220 |
precipperiod = 0.0 _d 0 |
221 |
precipconst = 0.0 _d 0 |
222 |
precip_exfremo_intercept = 0.0 _d 0 |
223 |
precip_exfremo_slope = 0.0 _d 0 |
224 |
|
225 |
snowprecipstartdate1 = 0 |
226 |
snowprecipstartdate2 = 0 |
227 |
snowprecipperiod = 0.0 _d 0 |
228 |
snowprecipconst = 0.0 _d 0 |
229 |
snowprecip_exfremo_intercept = 0.0 _d 0 |
230 |
snowprecip_exfremo_slope = 0.0 _d 0 |
231 |
|
232 |
runoffstartdate1 = 0 |
233 |
runoffstartdate2 = 0 |
234 |
runoffperiod = 0.0 _d 0 |
235 |
runoffconst = 0.0 _d 0 |
236 |
runoff_exfremo_intercept = 0.0 _d 0 |
237 |
runoff_exfremo_slope = 0.0 _d 0 |
238 |
|
239 |
ustressstartdate1 = 0 |
240 |
ustressstartdate2 = 0 |
241 |
ustressperiod = 0.0 _d 0 |
242 |
ustressconst = 0.0 _d 0 |
243 |
ustress_exfremo_intercept = 0.0 _d 0 |
244 |
ustress_exfremo_slope = 0.0 _d 0 |
245 |
|
246 |
vstressstartdate1 = 0 |
247 |
vstressstartdate2 = 0 |
248 |
vstressperiod = 0.0 _d 0 |
249 |
vstressconst = 0.0 _d 0 |
250 |
vstress_exfremo_intercept = 0.0 _d 0 |
251 |
vstress_exfremo_slope = 0.0 _d 0 |
252 |
|
253 |
uwindstartdate1 = 0 |
254 |
uwindstartdate2 = 0 |
255 |
uwindperiod = 0.0 _d 0 |
256 |
uwindconst = 0.0 _d 0 |
257 |
uwind_exfremo_intercept = 0.0 _d 0 |
258 |
uwind_exfremo_slope = 0.0 _d 0 |
259 |
|
260 |
vwindstartdate1 = 0 |
261 |
vwindstartdate2 = 0 |
262 |
vwindperiod = 0.0 _d 0 |
263 |
vwindconst = 0.0 _d 0 |
264 |
vwind_exfremo_intercept = 0.0 _d 0 |
265 |
vwind_exfremo_slope = 0.0 _d 0 |
266 |
|
267 |
wspeedstartdate1 = 0 |
268 |
wspeedstartdate2 = 0 |
269 |
wspeedperiod = 0.0 _d 0 |
270 |
wspeedconst = 0.0 _d 0 |
271 |
wspeed_exfremo_intercept = 0.0 _d 0 |
272 |
wspeed_exfremo_slope = 0.0 _d 0 |
273 |
|
274 |
swfluxstartdate1 = 0 |
275 |
swfluxstartdate2 = 0 |
276 |
swfluxperiod = 0.0 _d 0 |
277 |
swfluxconst = 0.0 _d 0 |
278 |
swflux_exfremo_intercept = 0.0 _d 0 |
279 |
swflux_exfremo_slope = 0.0 _d 0 |
280 |
|
281 |
lwfluxstartdate1 = 0 |
282 |
lwfluxstartdate2 = 0 |
283 |
lwfluxperiod = 0.0 _d 0 |
284 |
lwfluxconst = 0.0 _d 0 |
285 |
lwflux_exfremo_intercept = 0.0 _d 0 |
286 |
lwflux_exfremo_slope = 0.0 _d 0 |
287 |
|
288 |
swdownstartdate1 = 0 |
289 |
swdownstartdate2 = 0 |
290 |
swdownperiod = 0.0 _d 0 |
291 |
swdownconst = 0.0 _d 0 |
292 |
swdown_exfremo_intercept = 0.0 _d 0 |
293 |
swdown_exfremo_slope = 0.0 _d 0 |
294 |
|
295 |
lwdownstartdate1 = 0 |
296 |
lwdownstartdate2 = 0 |
297 |
lwdownperiod = 0.0 _d 0 |
298 |
lwdownconst = 0.0 _d 0 |
299 |
lwdown_exfremo_intercept = 0.0 _d 0 |
300 |
lwdown_exfremo_slope = 0.0 _d 0 |
301 |
|
302 |
apressurestartdate1 = 0 |
303 |
apressurestartdate2 = 0 |
304 |
apressureperiod = 0.0 _d 0 |
305 |
apressureconst = 0.0 _d 0 |
306 |
apressure_exfremo_intercept = 0.0 _d 0 |
307 |
apressure_exfremo_slope = 0.0 _d 0 |
308 |
|
309 |
obcsNstartdate1 = 0 |
310 |
obcsNstartdate2 = 0 |
311 |
obcsNperiod = 0.0 _d 0 |
312 |
|
313 |
obcsSstartdate1 = 0 |
314 |
obcsSstartdate2 = 0 |
315 |
obcsSperiod = 0.0 _d 0 |
316 |
|
317 |
obcsEstartdate1 = 0 |
318 |
obcsEstartdate2 = 0 |
319 |
obcsEperiod = 0.0 _d 0 |
320 |
|
321 |
obcsWstartdate1 = 0 |
322 |
obcsWstartdate2 = 0 |
323 |
obcsWperiod = 0.0 _d 0 |
324 |
|
325 |
repeatPeriod = 0.0 _d 0 |
326 |
exf_albedo = 0.1 _d 0 |
327 |
windstressmax = 2.0 _d 0 |
328 |
c-- this default is chosen to be backward compatible with |
329 |
c-- an earlier setting of 5.5 = ocean_emissivity*stefanBoltzmann |
330 |
ocean_emissivity = 5.50D-8/5.670D-8 |
331 |
ice_emissivity = 0.98 _d 0 |
332 |
snow_emissivity = 0.98 _d 0 |
333 |
|
334 |
c Data files. |
335 |
hfluxfile = ' ' |
336 |
atempfile = ' ' |
337 |
aqhfile = ' ' |
338 |
evapfile = ' ' |
339 |
precipfile = ' ' |
340 |
snowprecipfile = ' ' |
341 |
sfluxfile = ' ' |
342 |
runofffile = ' ' |
343 |
ustressfile = ' ' |
344 |
vstressfile = ' ' |
345 |
uwindfile = ' ' |
346 |
vwindfile = ' ' |
347 |
wspeedfile = ' ' |
348 |
swfluxfile = ' ' |
349 |
lwfluxfile = ' ' |
350 |
swdownfile = ' ' |
351 |
lwdownfile = ' ' |
352 |
apressurefile = ' ' |
353 |
|
354 |
c Start dates. |
355 |
hfluxstartdate = 0. |
356 |
atempstartdate = 0. |
357 |
aqhstartdate = 0. |
358 |
evapstartdate = 0. |
359 |
precipstartdate = 0. |
360 |
snowprecipstartdate = 0. |
361 |
sfluxstartdate = 0. |
362 |
runoffstartdate = 0. |
363 |
ustressstartdate = 0. |
364 |
vstressstartdate = 0. |
365 |
uwindstartdate = 0. |
366 |
vwindstartdate = 0. |
367 |
wspeedstartdate = 0. |
368 |
swfluxstartdate = 0. |
369 |
lwfluxstartdate = 0. |
370 |
swdownstartdate = 0. |
371 |
lwdownstartdate = 0. |
372 |
obcsNstartdate = 0. |
373 |
obcsSstartdate = 0. |
374 |
obcsEstartdate = 0. |
375 |
obcsWstartdate = 0. |
376 |
apressurestartdate = 0. |
377 |
|
378 |
c Initialise file type and field precision |
379 |
exf_iprec = 32 |
380 |
exf_yftype = 'RL' |
381 |
useExfYearlyFields = .FALSE. |
382 |
twoDigitYear = .FALSE. |
383 |
useExfCheckRange = .TRUE. |
384 |
|
385 |
c Input scaling factors. |
386 |
exf_inscal_hflux = 1. _d 0 |
387 |
exf_inscal_sflux = 1. _d 0 |
388 |
exf_inscal_ustress = 1. _d 0 |
389 |
exf_inscal_vstress = 1. _d 0 |
390 |
exf_inscal_uwind = 1. _d 0 |
391 |
exf_inscal_vwind = 1. _d 0 |
392 |
exf_inscal_wspeed = 1. _d 0 |
393 |
exf_inscal_swflux = 1. _d 0 |
394 |
exf_inscal_lwflux = 1. _d 0 |
395 |
exf_inscal_precip = 1. _d 0 |
396 |
exf_inscal_snowprecip = 1. _d 0 |
397 |
exf_inscal_sst = 1. _d 0 |
398 |
exf_inscal_sss = 1. _d 0 |
399 |
exf_inscal_atemp = 1. _d 0 |
400 |
exf_offset_atemp = 0. _d 0 |
401 |
exf_inscal_aqh = 1. _d 0 |
402 |
exf_inscal_evap = 1. _d 0 |
403 |
exf_inscal_apressure = 1. _d 0 |
404 |
exf_inscal_runoff = 1. _d 0 |
405 |
exf_inscal_swdown = 1. _d 0 |
406 |
exf_inscal_lwdown = 1. _d 0 |
407 |
|
408 |
c Output scaling factors. |
409 |
exf_outscal_hflux = 1. _d 0 |
410 |
exf_outscal_sflux = 1. _d 0 |
411 |
exf_outscal_ustress = 1. _d 0 |
412 |
exf_outscal_vstress = 1. _d 0 |
413 |
exf_outscal_swflux = 1. _d 0 |
414 |
exf_outscal_sst = 1. _d 0 |
415 |
exf_outscal_sss = 1. _d 0 |
416 |
exf_outscal_apressure= 1. _d 0 |
417 |
|
418 |
#ifdef USE_EXF_INTERPOLATION |
419 |
ustress_lon0 = thetaMin |
420 |
uwind_lon0 = thetaMin |
421 |
vstress_lon0 = thetaMin + delX(1) / 2 |
422 |
hflux_lon0 = thetaMin + delX(1) / 2 |
423 |
sflux_lon0 = thetaMin + delX(1) / 2 |
424 |
swflux_lon0 = thetaMin + delX(1) / 2 |
425 |
runoff_lon0 = thetaMin + delX(1) / 2 |
426 |
atemp_lon0 = thetaMin + delX(1) / 2 |
427 |
aqh_lon0 = thetaMin + delX(1) / 2 |
428 |
evap_lon0 = thetaMin + delX(1) / 2 |
429 |
precip_lon0 = thetaMin + delX(1) / 2 |
430 |
snowprecip_lon0 = thetaMin + delX(1) / 2 |
431 |
vwind_lon0 = thetaMin + delX(1) / 2 |
432 |
wspeed_lon0 = thetaMin + delX(1) / 2 |
433 |
lwflux_lon0 = thetaMin + delX(1) / 2 |
434 |
swdown_lon0 = thetaMin + delX(1) / 2 |
435 |
lwdown_lon0 = thetaMin + delX(1) / 2 |
436 |
apressure_lon0 = thetaMin + delX(1) / 2 |
437 |
vstress_lat0 = phimin |
438 |
vwind_lat0 = phimin |
439 |
wspeed_lat0 = phimin |
440 |
ustress_lat0 = phimin + delY(1) / 2 |
441 |
hflux_lat0 = phimin + delY(1) / 2 |
442 |
sflux_lat0 = phimin + delY(1) / 2 |
443 |
runoff_lat0 = phimin + delY(1) / 2 |
444 |
swflux_lat0 = phimin + delY(1) / 2 |
445 |
atemp_lat0 = phimin + delY(1) / 2 |
446 |
aqh_lat0 = phimin + delY(1) / 2 |
447 |
evap_lat0 = phimin + delY(1) / 2 |
448 |
precip_lat0 = phimin + delY(1) / 2 |
449 |
snowprecip_lat0 = phimin + delY(1) / 2 |
450 |
uwind_lat0 = phimin + delY(1) / 2 |
451 |
lwflux_lat0 = phimin + delY(1) / 2 |
452 |
swdown_lat0 = phimin + delY(1) / 2 |
453 |
lwdown_lat0 = phimin + delY(1) / 2 |
454 |
apressure_lat0 = phimin + delY(1) / 2 |
455 |
ustress_nlon = Nx |
456 |
ustress_nlat = Ny |
457 |
vstress_nlon = Nx |
458 |
vstress_nlat = Ny |
459 |
hflux_nlon = Nx |
460 |
hflux_nlat = Ny |
461 |
sflux_nlon = Nx |
462 |
sflux_nlat = Ny |
463 |
swflux_nlon = Nx |
464 |
swflux_nlat = Ny |
465 |
runoff_nlon = Nx |
466 |
runoff_nlat = Ny |
467 |
atemp_nlon = Nx |
468 |
atemp_nlat = Ny |
469 |
aqh_nlon = Nx |
470 |
aqh_nlat = Ny |
471 |
evap_nlon = Nx |
472 |
evap_nlat = Ny |
473 |
precip_nlon = Nx |
474 |
snowprecip_nlon = Nx |
475 |
precip_nlat = Ny |
476 |
snowprecip_nlat = Ny |
477 |
uwind_nlon = Nx |
478 |
uwind_nlat = Ny |
479 |
vwind_nlon = Nx |
480 |
vwind_nlat = Ny |
481 |
wspeed_nlon = Nx |
482 |
wspeed_nlat = Ny |
483 |
lwflux_nlon = Nx |
484 |
lwflux_nlat = Ny |
485 |
swdown_nlon = Nx |
486 |
swdown_nlat = Ny |
487 |
lwdown_nlon = Nx |
488 |
lwdown_nlat = Ny |
489 |
apressure_nlon = Nx |
490 |
apressure_nlat = Ny |
491 |
Ustress_lon_inc = delX(1) |
492 |
vstress_lon_inc = delX(1) |
493 |
hflux_lon_inc = delX(1) |
494 |
sflux_lon_inc = delX(1) |
495 |
swflux_lon_inc = delX(1) |
496 |
runoff_lon_inc = delX(1) |
497 |
atemp_lon_inc = delX(1) |
498 |
aqh_lon_inc = delX(1) |
499 |
evap_lon_inc = delX(1) |
500 |
precip_lon_inc = delX(1) |
501 |
snowprecip_lon_inc = delX(1) |
502 |
uwind_lon_inc = delX(1) |
503 |
vwind_lon_inc = delX(1) |
504 |
wspeed_lon_inc = delX(1) |
505 |
lwflux_lon_inc = delX(1) |
506 |
swdown_lon_inc = delX(1) |
507 |
lwdown_lon_inc = delX(1) |
508 |
apressure_lon_inc = delX(1) |
509 |
DO i=1,MAX_LAT_INC |
510 |
IF (i.LT.Ny) THEN |
511 |
vstress_lat_inc(i) = delY(i) |
512 |
vwind_lat_inc(i) = delY(i) |
513 |
wspeed_lat_inc(i) = delY(i) |
514 |
ustress_lat_inc(i) = (delY(i) + delY(i)) / 2. |
515 |
hflux_lat_inc(i) = (delY(i) + delY(i)) / 2. |
516 |
sflux_lat_inc(i) = (delY(i) + delY(i)) / 2. |
517 |
swflux_lat_inc(i) = (delY(i) + delY(i)) / 2. |
518 |
runoff_lat_inc(i) = (delY(i) + delY(i)) / 2. |
519 |
atemp_lat_inc(i) = (delY(i) + delY(i)) / 2. |
520 |
aqh_lat_inc(i) = (delY(i) + delY(i)) / 2. |
521 |
evap_lat_inc(i) = (delY(i) + delY(i)) / 2. |
522 |
precip_lat_inc(i) = (delY(i) + delY(i)) / 2. |
523 |
snowprecip_lat_inc(i) = (delY(i) + delY(i)) / 2. |
524 |
uwind_lat_inc(i) = (delY(i) + delY(i)) / 2. |
525 |
lwflux_lat_inc(i) = (delY(i) + delY(i)) / 2. |
526 |
swdown_lat_inc(i) = (delY(i) + delY(i)) / 2. |
527 |
lwdown_lat_inc(i) = (delY(i) + delY(i)) / 2. |
528 |
apressure_lat_inc(i) = (delY(i) + delY(i)) / 2. |
529 |
ELSE |
530 |
ustress_lat_inc(i) = 0. |
531 |
vstress_lat_inc(i) = 0. |
532 |
hflux_lat_inc(i) = 0. |
533 |
sflux_lat_inc(i) = 0. |
534 |
swflux_lat_inc(i) = 0. |
535 |
runoff_lat_inc(i) = 0. |
536 |
atemp_lat_inc(i) = 0. |
537 |
aqh_lat_inc(i) = 0. |
538 |
evap_lat_inc(i) = 0. |
539 |
precip_lat_inc(i) = 0. |
540 |
snowprecip_lat_inc(i) = 0. |
541 |
uwind_lat_inc(i) = 0. |
542 |
vwind_lat_inc(i) = 0. |
543 |
wspeed_lat_inc(i) = 0. |
544 |
lwflux_lat_inc(i) = 0. |
545 |
swdown_lat_inc(i) = 0. |
546 |
lwdown_lat_inc(i) = 0. |
547 |
apressure_lat_inc(i) = 0. |
548 |
ENDIF |
549 |
ENDDO |
550 |
#endif /* USE_EXF_INTERPOLATION */ |
551 |
|
552 |
c Check for the availability of the right calendar version. |
553 |
if ( calendarversion .ne. usescalendarversion ) then |
554 |
print*,' exf_readparms: You are not using the appropriate' |
555 |
print*,' version of the calendar package.' |
556 |
print* |
557 |
print*,' You are using Calendar version: ', calendarversion |
558 |
print*,' Please use Calendar version: ', usescalendarversion |
559 |
stop ' stopped in exf_readparms.' |
560 |
endif |
561 |
|
562 |
c Next, read the forcing data file. |
563 |
WRITE(msgBuf,'(A)') 'EXF_READPARMS: opening data.exf' |
564 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
565 |
& SQUEEZE_RIGHT , 1) |
566 |
|
567 |
CALL OPEN_COPY_DATA_FILE( |
568 |
I 'data.exf', 'EXF_READPARMS', |
569 |
O iUnit, |
570 |
I myThid ) |
571 |
|
572 |
READ( iUnit, nml = exf_nml ) |
573 |
|
574 |
WRITE(msgBuf,'(A)') |
575 |
& 'EXF_READPARMS: finished reading data.exf' |
576 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
577 |
& SQUEEZE_RIGHT , 1) |
578 |
|
579 |
CLOSE( iUnit ) |
580 |
|
581 |
call exf_check( mythid ) |
582 |
|
583 |
c Complete the start date specifications for the forcing |
584 |
c fields to get a complete calendar date array. |
585 |
|
586 |
#ifdef ALLOW_ATM_WIND |
587 |
if ( uwindfile .NE. ' ' ) then |
588 |
call cal_FullDate ( uwindstartdate1 , uwindstartdate2, |
589 |
& date_array ,mythid ) |
590 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
591 |
call cal_ToSeconds ( difftime, uwindstartdate ,mythid ) |
592 |
uwindstartdate = modelstart + uwindstartdate |
593 |
endif |
594 |
if ( vwindfile .NE. ' ' ) then |
595 |
call cal_FullDate ( vwindstartdate1 , vwindstartdate2, |
596 |
& date_array ,mythid ) |
597 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
598 |
call cal_ToSeconds ( difftime, vwindstartdate ,mythid ) |
599 |
vwindstartdate = modelstart + vwindstartdate |
600 |
endif |
601 |
if ( wspeedfile .NE. ' ' ) then |
602 |
call cal_FullDate ( wspeedstartdate1, wspeedstartdate2, |
603 |
& date_array ,mythid ) |
604 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
605 |
call cal_ToSeconds ( difftime, wspeedstartdate ,mythid ) |
606 |
wspeedstartdate = modelstart + wspeedstartdate |
607 |
endif |
608 |
#else |
609 |
if ( ustressfile .NE. ' ' ) then |
610 |
call cal_FullDate ( ustressstartdate1 , ustressstartdate2, |
611 |
& date_array ,mythid ) |
612 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
613 |
call cal_ToSeconds ( difftime, ustressstartdate ,mythid ) |
614 |
ustressstartdate = modelstart + ustressstartdate |
615 |
endif |
616 |
if ( vstressfile .NE. ' ' ) then |
617 |
call cal_FullDate ( vstressstartdate1 , vstressstartdate2, |
618 |
& date_array ,mythid ) |
619 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
620 |
call cal_ToSeconds ( difftime, vstressstartdate ,mythid ) |
621 |
vstressstartdate = modelstart + vstressstartdate |
622 |
endif |
623 |
#endif |
624 |
|
625 |
#ifdef ALLOW_ATM_TEMP |
626 |
if ( atempfile .NE. ' ' ) then |
627 |
call cal_FullDate ( atempstartdate1 , atempstartdate2, |
628 |
& date_array ,mythid ) |
629 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
630 |
call cal_ToSeconds ( difftime, atempstartdate ,mythid ) |
631 |
atempstartdate = modelstart + atempstartdate |
632 |
endif |
633 |
if ( aqhfile .NE. ' ' ) then |
634 |
call cal_FullDate ( aqhstartdate1 , aqhstartdate2, |
635 |
& date_array ,mythid ) |
636 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
637 |
call cal_ToSeconds ( difftime, aqhstartdate ,mythid ) |
638 |
aqhstartdate = modelstart + aqhstartdate |
639 |
endif |
640 |
if ( lwfluxfile .NE. ' ' ) then |
641 |
call cal_FullDate ( lwfluxstartdate1 , lwfluxstartdate2, |
642 |
& date_array ,mythid ) |
643 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
644 |
call cal_ToSeconds ( difftime, lwfluxstartdate ,mythid ) |
645 |
lwfluxstartdate = modelstart + lwfluxstartdate |
646 |
endif |
647 |
if ( precipfile .NE. ' ' ) then |
648 |
call cal_FullDate ( precipstartdate1 , precipstartdate2, |
649 |
& date_array ,mythid ) |
650 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
651 |
call cal_ToSeconds ( difftime, precipstartdate ,mythid ) |
652 |
precipstartdate = modelstart + precipstartdate |
653 |
endif |
654 |
if ( snowprecipfile .NE. ' ' ) then |
655 |
call cal_FullDate( snowprecipstartdate1, snowprecipstartdate2, |
656 |
& date_array ,mythid ) |
657 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
658 |
call cal_ToSeconds ( difftime, snowprecipstartdate, mythid ) |
659 |
snowprecipstartdate = modelstart + snowprecipstartdate |
660 |
endif |
661 |
#else |
662 |
if ( hfluxfile .NE. ' ' ) then |
663 |
call cal_FullDate ( hfluxstartdate1 , hfluxstartdate2, |
664 |
& date_array ,mythid ) |
665 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
666 |
call cal_ToSeconds ( difftime, hfluxstartdate ,mythid ) |
667 |
hfluxstartdate = modelstart + hfluxstartdate |
668 |
endif |
669 |
if ( sfluxfile .NE. ' ' ) then |
670 |
call cal_FullDate ( sfluxstartdate1 , sfluxstartdate2, |
671 |
& date_array ,mythid ) |
672 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
673 |
call cal_ToSeconds ( difftime, sfluxstartdate ,mythid ) |
674 |
sfluxstartdate = modelstart + sfluxstartdate |
675 |
endif |
676 |
#endif |
677 |
|
678 |
#if defined(ALLOW_ATM_TEMP) || defined(SHORTWAVE_HEATING) |
679 |
if ( swfluxfile .NE. ' ' ) then |
680 |
call cal_FullDate ( swfluxstartdate1 , swfluxstartdate2, |
681 |
& date_array ,mythid ) |
682 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
683 |
call cal_ToSeconds ( difftime, swfluxstartdate ,mythid ) |
684 |
swfluxstartdate = modelstart + swfluxstartdate |
685 |
endif |
686 |
#endif |
687 |
|
688 |
#ifdef EXF_READ_EVAP |
689 |
if ( evapfile .NE. ' ' ) then |
690 |
call cal_FullDate ( evapstartdate1 , evapstartdate2, |
691 |
& date_array ,mythid ) |
692 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
693 |
call cal_ToSeconds ( difftime, evapstartdate ,mythid ) |
694 |
evapstartdate = modelstart + evapstartdate |
695 |
endif |
696 |
#endif |
697 |
|
698 |
#ifdef ALLOW_RUNOFF |
699 |
if ( runofffile .NE. ' ' .AND. runoffperiod .NE. 0. ) then |
700 |
call cal_FullDate ( runoffstartdate1 , runoffstartdate2, |
701 |
& date_array ,mythid ) |
702 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
703 |
call cal_ToSeconds ( difftime, runoffstartdate ,mythid ) |
704 |
runoffstartdate = modelstart + runoffstartdate |
705 |
endif |
706 |
#endif |
707 |
|
708 |
#ifdef ALLOW_DOWNWARD_RADIATION |
709 |
if ( swdownfile .NE. ' ' ) then |
710 |
call cal_FullDate ( swdownstartdate1 , swdownstartdate2, |
711 |
& date_array ,mythid ) |
712 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
713 |
call cal_ToSeconds ( difftime, swdownstartdate ,mythid ) |
714 |
swdownstartdate = modelstart + swdownstartdate |
715 |
endif |
716 |
if ( lwdownfile .NE. ' ' ) then |
717 |
call cal_FullDate ( lwdownstartdate1 , lwdownstartdate2, |
718 |
& date_array ,mythid ) |
719 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
720 |
call cal_ToSeconds ( difftime, lwdownstartdate ,mythid ) |
721 |
lwdownstartdate = modelstart + lwdownstartdate |
722 |
endif |
723 |
#endif |
724 |
|
725 |
#ifdef ATMOSPHERIC_LOADING |
726 |
if ( apressurefile .NE. ' ' ) then |
727 |
call cal_FullDate ( apressurestartdate1, apressurestartdate2, |
728 |
& date_array ,mythid ) |
729 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
730 |
call cal_ToSeconds ( difftime, apressurestartdate ,mythid ) |
731 |
apressurestartdate = modelstart + apressurestartdate |
732 |
endif |
733 |
#endif |
734 |
|
735 |
#ifdef ALLOW_OBCS |
736 |
#ifdef ALLOW_OBCS_NORTH |
737 |
if ( obcsNperiod .NE. 0 ) then |
738 |
call cal_FullDate ( obcsNstartdate1 , obcsNstartdate2, |
739 |
& date_array ,mythid ) |
740 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
741 |
call cal_ToSeconds ( difftime, obcsNstartdate ,mythid ) |
742 |
obcsNstartdate = modelstart + obcsNstartdate |
743 |
endif |
744 |
#endif |
745 |
#ifdef ALLOW_OBCS_SOUTH |
746 |
if ( obcsSperiod .NE. 0 ) then |
747 |
call cal_FullDate ( obcsSstartdate1 , obcsSstartdate2, |
748 |
& date_array ,mythid ) |
749 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
750 |
call cal_ToSeconds ( difftime, obcsSstartdate ,mythid ) |
751 |
obcsSstartdate = modelstart + obcsSstartdate |
752 |
endif |
753 |
#endif |
754 |
#ifdef ALLOW_OBCS_EAST |
755 |
if ( obcsEperiod .NE. 0 ) then |
756 |
call cal_FullDate ( obcsEstartdate1 , obcsEstartdate2, |
757 |
& date_array ,mythid ) |
758 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
759 |
call cal_ToSeconds ( difftime, obcsEstartdate ,mythid ) |
760 |
obcsEstartdate = modelstart + obcsEstartdate |
761 |
endif |
762 |
#endif |
763 |
#ifdef ALLOW_OBCS_WEST |
764 |
if ( obcsNperiod .NE. 0 ) then |
765 |
call cal_FullDate ( obcsWstartdate1 , obcsWstartdate2, |
766 |
& date_array ,mythid ) |
767 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
768 |
call cal_ToSeconds ( difftime, obcsWstartdate ,mythid ) |
769 |
obcsWstartdate = modelstart + obcsWstartdate |
770 |
endif |
771 |
#endif |
772 |
#endif /* ALLOW_OBCS */ |
773 |
|
774 |
_END_MASTER( mythid ) |
775 |
|
776 |
_BARRIER |
777 |
|
778 |
c-- Summarize the External forcing's setup. |
779 |
call exf_summary( mythid ) |
780 |
|
781 |
c-- set climatology parameters |
782 |
call exf_clim_readparms( mythid ) |
783 |
|
784 |
c-- summarize climatologic forcing configuration |
785 |
call exf_clim_summary( mythid ) |
786 |
|
787 |
end |