/[MITgcm]/MITgcm/pkg/exf/exf_readparms.F
ViewVC logotype

Contents of /MITgcm/pkg/exf/exf_readparms.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.13 - (show annotations) (download)
Mon Oct 20 06:25:16 2003 UTC (20 years, 7 months ago) by dimitri
Branch: MAIN
CVS Tags: checkpoint52d_pre, checkpoint51o_pre, checkpoint51l_post, checkpoint52, checkpoint51t_post, checkpoint51n_post, checkpoint51s_post, checkpoint51n_pre, checkpoint52b_pre, checkpoint51q_post, checkpoint52b_post, checkpoint52c_post, checkpoint51r_post, checkpoint52d_post, checkpoint52a_pre, branch-netcdf, checkpoint51o_post, checkpoint52a_post, ecco_c52_e35, checkpoint51m_post, checkpoint51p_post, checkpoint51u_post
Branch point for: branch-nonh, netcdf-sm0, checkpoint51n_branch
Changes since 1.12: +123 -64 lines
changes to pkg/cal and pkg/exf that allow and speed-up long integrations

1 C $Header: /usr/local/gcmpack/MITgcm/pkg/exf/exf_readparms.F,v 1.12 2003/10/09 04:19:19 edhill 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 "cal.h"
52 #include "exf.h"
53 #include "exf_param.h"
54 #include "exf_constants.h"
55
56 c == routine arguments ==
57
58 integer mythid
59
60 c == local variables ==
61
62 integer i
63 integer date_array(4), difftime(4)
64
65 c == external ==
66
67 integer ilnblnk
68 external ilnblnk
69
70 c == end of interface ==
71
72 c Surface flux data.
73 namelist /exf_nml/
74 & repeatPeriod,
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 & runoffstartdate1, runoffstartdate2, runoffperiod,
82 & ustressstartdate1, ustressstartdate2, ustressperiod,
83 & vstressstartdate1, vstressstartdate2, vstressperiod,
84 & uwindstartdate1, uwindstartdate2, uwindperiod,
85 & vwindstartdate1, vwindstartdate2, vwindperiod,
86 & swfluxstartdate1, swfluxstartdate2, swfluxperiod,
87 & lwfluxstartdate1, lwfluxstartdate2, lwfluxperiod,
88 & swdownstartdate1, swdownstartdate2, swdownperiod,
89 & lwdownstartdate1, lwdownstartdate2, lwdownperiod,
90 & obcsNstartdate1, obcsNstartdate2, obcsNperiod,
91 & obcsSstartdate1, obcsSstartdate2, obcsSperiod,
92 & obcsEstartdate1, obcsEstartdate2, obcsEperiod,
93 & obcsWstartdate1, obcsWstartdate2, obcsWperiod,
94 &apressurestartdate1,apressurestartdate2,apressureperiod,
95 & hfluxfile, atempfile, aqhfile,
96 & sfluxfile, precipfile, runofffile,
97 & ustressfile, vstressfile, evapfile,
98 & uwindfile, vwindfile,
99 & swfluxfile, lwfluxfile, apressurefile,
100 & swdownfile, lwdownfile,
101 & exf_iprec, exf_yftype,
102 & exf_inscal_hflux, exf_inscal_sflux,
103 & exf_inscal_ustress, exf_inscal_vstress,
104 & exf_inscal_uwind, exf_inscal_vwind,
105 & exf_inscal_evap, exf_inscal_atemp, exf_inscal_aqh,
106 & exf_inscal_sst, exf_inscal_sss,
107 & exf_inscal_swflux, exf_inscal_lwflux, exf_inscal_precip,
108 & exf_inscal_runoff, exf_inscal_apressure,
109 & exf_inscal_swdown, exf_inscal_lwdown,
110 & exf_outscal_hflux, exf_outscal_ustress, exf_outscal_vstress,
111 & exf_outscal_swflux, exf_outscal_sst,exf_outscal_sss,
112 & exf_outscal_sflux, exf_outscal_apressure,
113 & hfluxconst,
114 & atempconst,
115 & aqhconst,
116 & sfluxconst,
117 & evapconst,
118 & precipconst,
119 & runoffconst,
120 & ustressconst,
121 & vstressconst,
122 & uwindconst,
123 & vwindconst,
124 & swfluxconst,
125 & lwfluxconst,
126 & swdownconst,
127 & lwdownconst,
128 & apressureconst
129 #ifdef USE_EXF_INTERPOLATION
130 & ,ustress_lon0, ustress_lon_inc, ustress_lat0, ustress_lat_inc,
131 & ustress_nlon, ustress_nlat,
132 & vstress_lon0, vstress_lon_inc, vstress_lat0, vstress_lat_inc,
133 & vstress_nlon, vstress_nlat,
134 & hflux_lon0, hflux_lon_inc, hflux_lat0, hflux_lat_inc,
135 & hflux_nlon, hflux_nlat,
136 & sflux_lon0, sflux_lon_inc, sflux_lat0, sflux_lat_inc,
137 & sflux_nlon, sflux_nlat,
138 & swflux_lon0, swflux_lon_inc, swflux_lat0, swflux_lat_inc,
139 & swflux_nlon, swflux_nlat,
140 & runoff_lon0, runoff_lon_inc, runoff_lat0, runoff_lat_inc,
141 & runoff_nlon, runoff_nlat,
142 & atemp_lon0, atemp_lon_inc, atemp_lat0, atemp_lat_inc,
143 & atemp_nlon, atemp_nlat,
144 & aqh_lon0, aqh_lon_inc, aqh_lat0, aqh_lat_inc,
145 & aqh_nlon, aqh_nlat,
146 & evap_lon0, evap_lon_inc, evap_lat0, evap_lat_inc,
147 & evap_nlon, evap_nlat,
148 & precip_lon0, precip_lon_inc, precip_lat0, precip_lat_inc,
149 & precip_nlon, precip_nlat,
150 & uwind_lon0, uwind_lon_inc, uwind_lat0, uwind_lat_inc,
151 & uwind_nlon, uwind_nlat,
152 & vwind_lon0, vwind_lon_inc, vwind_lat0, vwind_lat_inc,
153 & vwind_nlon, vwind_nlat,
154 & lwflux_lon0, lwflux_lon_inc, lwflux_lat0, lwflux_lat_inc,
155 & lwflux_nlon, lwflux_nlat,
156 & swdown_lon0, swdown_lon_inc, swdown_lat0, swdown_lat_inc,
157 & swdown_nlon, swdown_nlat,
158 & lwdown_lon0, lwdown_lon_inc, lwdown_lat0, lwdown_lat_inc,
159 & lwdown_nlon, lwdown_nlat,
160 & apressure_lon0,apressure_lon_inc,
161 & apressure_lat0,apressure_lat_inc,
162 & apressure_nlon,apressure_nlat
163 #endif
164
165 _BEGIN_MASTER(mythid)
166
167 c Set default values.
168
169 c Calendar data.
170 hfluxstartdate1 = 0
171 hfluxstartdate2 = 0
172 hfluxperiod = 0.0 _d 0
173 hfluxconst = 0.0 _d 0
174
175 atempstartdate1 = 0
176 atempstartdate2 = 0
177 atempperiod = 0.0 _d 0
178 atempconst = 0.0 _d 0
179
180 aqhstartdate1 = 0
181 aqhstartdate2 = 0
182 aqhperiod = 0.0 _d 0
183 aqhconst = 0.0 _d 0
184
185 sfluxstartdate1 = 0
186 sfluxstartdate2 = 0
187 sfluxperiod = 0.0 _d 0
188 sfluxconst = 0.0 _d 0
189
190 evapstartdate1 = 0
191 evapstartdate2 = 0
192 evapperiod = 0.0 _d 0
193 evapconst = 0.0 _d 0
194
195 precipstartdate1 = 0
196 precipstartdate2 = 0
197 precipperiod = 0.0 _d 0
198 precipconst = 0.0 _d 0
199
200 runoffstartdate1 = 0
201 runoffstartdate2 = 0
202 runoffperiod = 0.0 _d 0
203 runoffconst = 0.0 _d 0
204
205 ustressstartdate1 = 0
206 ustressstartdate2 = 0
207 ustressperiod = 0.0 _d 0
208 ustressconst = 0.0 _d 0
209
210 vstressstartdate1 = 0
211 vstressstartdate2 = 0
212 vstressperiod = 0.0 _d 0
213 vstressconst = 0.0 _d 0
214
215 uwindstartdate1 = 0
216 uwindstartdate2 = 0
217 uwindperiod = 0.0 _d 0
218 uwindconst = 0.0 _d 0
219
220 vwindstartdate1 = 0
221 vwindstartdate2 = 0
222 vwindperiod = 0.0 _d 0
223 vwindconst = 0.0 _d 0
224
225 swfluxstartdate1 = 0
226 swfluxstartdate2 = 0
227 swfluxperiod = 0.0 _d 0
228 swfluxconst = 0.0 _d 0
229
230 lwfluxstartdate1 = 0
231 lwfluxstartdate2 = 0
232 lwfluxperiod = 0.0 _d 0
233 lwfluxconst = 0.0 _d 0
234
235 swdownstartdate1 = 0
236 swdownstartdate2 = 0
237 swdownperiod = 0.0 _d 0
238 swdownconst = 0.0 _d 0
239
240 lwdownstartdate1 = 0
241 lwdownstartdate2 = 0
242 lwdownperiod = 0.0 _d 0
243 lwdownconst = 0.0 _d 0
244
245 obcsNstartdate1 = 0
246 obcsNstartdate2 = 0
247 obcsNperiod = 0.0 _d 0
248
249 obcsSstartdate1 = 0
250 obcsSstartdate2 = 0
251 obcsSperiod = 0.0 _d 0
252
253 obcsEstartdate1 = 0
254 obcsEstartdate2 = 0
255 obcsEperiod = 0.0 _d 0
256
257 obcsWstartdate1 = 0
258 obcsWstartdate2 = 0
259 obcsWperiod = 0.0 _d 0
260
261 apressurestartdate1 = 0
262 apressurestartdate2 = 0
263 apressureperiod = 0.0 _d 0
264 apressureconst = 0.0 _d 0
265
266 repeatPeriod = 0.0 _d 0
267
268 c Data files.
269 hfluxfile = ' '
270 atempfile = ' '
271 aqhfile = ' '
272 evapfile = ' '
273 precipfile = ' '
274 sfluxfile = ' '
275 runofffile = ' '
276 ustressfile = ' '
277 vstressfile = ' '
278 uwindfile = ' '
279 vwindfile = ' '
280 swfluxfile = ' '
281 lwfluxfile = ' '
282 swdownfile = ' '
283 lwdownfile = ' '
284 apressurefile = ' '
285
286 c Start dates.
287 hfluxstartdate = 0
288 atempstartdate = 0
289 aqhstartdate = 0
290 evapstartdate = 0
291 precipstartdate = 0
292 sfluxstartdate = 0
293 runoffstartdate = 0
294 ustressstartdate = 0
295 vstressstartdate = 0
296 uwindstartdate = 0
297 vwindstartdate = 0
298 swfluxstartdate = 0
299 lwfluxstartdate = 0
300 swdownstartdate = 0
301 lwdownstartdate = 0
302 obcsNstartdate = 0
303 obcsSstartdate = 0
304 obcsEstartdate = 0
305 obcsWstartdate = 0
306 apressurestartdate = 0
307
308 c Initialise file type and field precision
309 exf_iprec = 32
310 exf_yftype = 'RL'
311
312 c Input scaling factors.
313 exf_inscal_hflux = 1. _d 0
314 exf_inscal_sflux = 1. _d 0
315 exf_inscal_ustress = 1. _d 0
316 exf_inscal_vstress = 1. _d 0
317 exf_inscal_uwind = 1. _d 0
318 exf_inscal_vwind = 1. _d 0
319 exf_inscal_swflux = 1. _d 0
320 exf_inscal_lwflux = 1. _d 0
321 exf_inscal_precip = 1. _d 0
322 exf_inscal_sst = 1. _d 0
323 exf_inscal_sss = 1. _d 0
324 exf_inscal_atemp = 1. _d 0
325 exf_inscal_aqh = 1. _d 0
326 exf_inscal_evap = 1. _d 0
327 exf_inscal_apressure = 1. _d 0
328 cds convert runoff from m/yr to m/s and change sign.
329 exf_inscal_runoff = -1.0/(86400.*365.0)
330 exf_inscal_swdown = 1. _d 0
331 exf_inscal_lwdown = 1. _d 0
332
333 c Output scaling factors.
334 exf_outscal_hflux = 1. _d 0
335 exf_outscal_sflux = 1. _d 0
336 exf_outscal_ustress = 1. _d 0
337 exf_outscal_vstress = 1. _d 0
338 exf_outscal_swflux = 1. _d 0
339 exf_outscal_sst = 1. _d 0
340 exf_outscal_sss = 1. _d 0
341 exf_outscal_apressure= 1. _d 0
342
343 c Check for the availability of the right calendar version.
344 if ( calendarversion .ne. usescalendarversion ) then
345 print*,' exf_readparms: You are not using the appropriate'
346 print*,' version of the calendar package.'
347 print*
348 print*,' You are using Calendar version: ', calendarversion
349 print*,' Please use Calendar version: ', usescalendarversion
350 stop ' stopped in exf_readparms.'
351 endif
352
353 c Next, read the forcing data file.
354 call nml_filter( 'data.exf', scrunit1, myThid )
355 if (scrunit1 .eq. 0) then
356 stop 'exf_readparms: reading namelist failed'
357 end if
358 read( scrunit1, nml = exf_nml )
359 close( scrunit1 )
360
361 c Complete the start date specifications for the forcing
362 c fields to get a complete calendar date array.
363
364 c check for consistency
365
366 if (.NOT.
367 & (exf_iprec .EQ. 32 .OR. exf_iprec .EQ. 64)
368 & ) then
369 stop 'stop in exf_readparms: value of exf_iprec not allowed'
370 else if (.NOT.
371 & (exf_yftype .EQ. 'RS' .OR.
372 & exf_yftype .EQ. 'RL')
373 & ) then
374 stop 'stop in exf_readparms: value of exf_yftype not allowed'
375 end if
376
377 #ifdef ALLOW_ATM_WIND
378 call cal_FullDate ( uwindstartdate1 , uwindstartdate2,
379 & date_array ,mythid )
380 call cal_TimePassed( modelstartdate,date_array,difftime,mythid )
381 call cal_ToSeconds ( difftime, uwindstartdate ,mythid )
382 uwindstartdate = modelstart + uwindstartdate
383 call cal_FullDate ( vwindstartdate1 , vwindstartdate2,
384 & date_array ,mythid )
385 call cal_TimePassed( modelstartdate,date_array,difftime,mythid )
386 call cal_ToSeconds ( difftime, vwindstartdate ,mythid )
387 vwindstartdate = modelstart + vwindstartdate
388 #else
389 call cal_FullDate ( ustressstartdate1 , ustressstartdate2,
390 & date_array ,mythid )
391 call cal_TimePassed( modelstartdate,date_array,difftime,mythid )
392 call cal_ToSeconds ( difftime, ustressstartdate ,mythid )
393 ustressstartdate = modelstart + ustressstartdate
394 call cal_FullDate ( vstressstartdate1 , vstressstartdate2,
395 & date_array ,mythid )
396 call cal_TimePassed( modelstartdate,date_array,difftime,mythid )
397 call cal_ToSeconds ( difftime, vstressstartdate ,mythid )
398 vstressstartdate = modelstart + vstressstartdate
399 #endif
400
401 #ifdef ALLOW_ATM_TEMP
402 call cal_FullDate ( atempstartdate1 , atempstartdate2,
403 & date_array ,mythid )
404 call cal_TimePassed( modelstartdate,date_array,difftime,mythid )
405 call cal_ToSeconds ( difftime, atempstartdate ,mythid )
406 atempstartdate = modelstart + atempstartdate
407 call cal_FullDate ( aqhstartdate1 , aqhstartdate2,
408 & date_array ,mythid )
409 call cal_TimePassed( modelstartdate,date_array,difftime,mythid )
410 call cal_ToSeconds ( difftime, aqhstartdate ,mythid )
411 aqhstartdate = modelstart + aqhstartdate
412 call cal_FullDate ( lwfluxstartdate1 , lwfluxstartdate2,
413 & date_array ,mythid )
414 call cal_TimePassed( modelstartdate,date_array,difftime,mythid )
415 call cal_ToSeconds ( difftime, lwfluxstartdate ,mythid )
416 lwfluxstartdate = modelstart + lwfluxstartdate
417 call cal_FullDate ( precipstartdate1 , precipstartdate2,
418 & date_array ,mythid )
419 call cal_TimePassed( modelstartdate,date_array,difftime,mythid )
420 call cal_ToSeconds ( difftime, precipstartdate ,mythid )
421 precipstartdate = modelstart + precipstartdate
422 #else
423 call cal_FullDate ( hfluxstartdate1 , hfluxstartdate2,
424 & date_array ,mythid )
425 call cal_TimePassed( modelstartdate,date_array,difftime,mythid )
426 call cal_ToSeconds ( difftime, hfluxstartdate ,mythid )
427 hfluxstartdate = modelstart + hfluxstartdate
428 call cal_FullDate ( sfluxstartdate1 , sfluxstartdate2,
429 & date_array ,mythid )
430 call cal_TimePassed( modelstartdate,date_array,difftime,mythid )
431 call cal_ToSeconds ( difftime, sfluxstartdate ,mythid )
432 sfluxstartdate = modelstart + sfluxstartdate
433 #endif
434
435 #if defined(ALLOW_ATM_TEMP) || defined(SHORTWAVE_HEATING)
436 call cal_FullDate ( swfluxstartdate1 , swfluxstartdate2,
437 & date_array ,mythid )
438 call cal_TimePassed( modelstartdate,date_array,difftime,mythid )
439 call cal_ToSeconds ( difftime, swfluxstartdate ,mythid )
440 swfluxstartdate = modelstart + swfluxstartdate
441 #endif
442
443 #ifdef EXF_READ_EVAP
444 call cal_FullDate ( evapstartdate1 , evapstartdate2,
445 & date_array ,mythid )
446 call cal_TimePassed( modelstartdate,date_array,difftime,mythid )
447 call cal_ToSeconds ( difftime, evapstartdate ,mythid )
448 evapstartdate = modelstart + evapstartdate
449 #endif
450
451 #ifdef ALLOW_RUNOFF
452 call cal_FullDate ( runoffstartdate1 , runoffstartdate2,
453 & date_array ,mythid )
454 call cal_TimePassed( modelstartdate,date_array,difftime,mythid )
455 call cal_ToSeconds ( difftime, runoffstartdate ,mythid )
456 runoffstartdate = modelstart + runoffstartdate
457 #endif
458
459 #ifdef ALLOW_DOWNWARD_RADIATION
460 call cal_FullDate ( swdownstartdate1 , swdownstartdate2,
461 & date_array ,mythid )
462 call cal_TimePassed( modelstartdate,date_array,difftime,mythid )
463 call cal_ToSeconds ( difftime, swdownstartdate ,mythid )
464 swdownstartdate = modelstart + swdownstartdate
465 call cal_FullDate ( lwdownstartdate1 , lwdownstartdate2,
466 & date_array ,mythid )
467 call cal_TimePassed( modelstartdate,date_array,difftime,mythid )
468 call cal_ToSeconds ( difftime, lwdownstartdate ,mythid )
469 lwdownstartdate = modelstart + lwdownstartdate
470 #endif
471
472 #ifdef ALLOW_OBCS
473 #ifdef ALLOW_OBCS_NORTH
474 call cal_FullDate ( obcsNstartdate1 , obcsNstartdate2,
475 & date_array ,mythid )
476 call cal_TimePassed( modelstartdate,date_array,difftime,mythid )
477 call cal_ToSeconds ( difftime, obcsNstartdate ,mythid )
478 obcsNstartdate = modelstart + obcsNstartdate
479 #endif
480 #ifdef ALLOW_OBCS_SOUTH
481 call cal_FullDate ( obcsSstartdate1 , obcsSstartdate2,
482 & date_array ,mythid )
483 call cal_TimePassed( modelstartdate,date_array,difftime,mythid )
484 call cal_ToSeconds ( difftime, obcsSstartdate ,mythid )
485 obcsSstartdate = modelstart + obcsSstartdate
486 #endif
487 #ifdef ALLOW_OBCS_EAST
488 call cal_FullDate ( obcsEstartdate1 , obcsEstartdate2,
489 & date_array ,mythid )
490 call cal_TimePassed( modelstartdate,date_array,difftime,mythid )
491 call cal_ToSeconds ( difftime, obcsEstartdate ,mythid )
492 obcsEstartdate = modelstart + obcsEstartdate
493 #endif
494 #ifdef ALLOW_OBCS_WEST
495 call cal_FullDate ( obcsWstartdate1 , obcsWstartdate2,
496 & date_array ,mythid )
497 call cal_TimePassed( modelstartdate,date_array,difftime,mythid )
498 call cal_ToSeconds ( difftime, obcsWstartdate ,mythid )
499 obcsWstartdate = modelstart + obcsWstartdate
500 #endif
501 #endif /* ALLOW_OBCS */
502
503 #ifdef ATMOSPHERIC_LOADING
504 call cal_FullDate ( apressurestartdate1, apressurestartdate2,
505 & date_array ,mythid )
506 call cal_TimePassed( modelstartdate,date_array,difftime,mythid )
507 call cal_ToSeconds ( difftime, apressurestartdate ,mythid )
508 apressurestartdate = modelstart + apressurestartdate
509 #endif
510
511 _END_MASTER( mythid )
512
513 _BARRIER
514
515 c-- Summarize the External forcing's setup.
516 call exf_summary( mythid )
517
518 c-- set climatology parameters
519 call exf_clim_readparms( mythid )
520
521 c-- summarize climatologic forcing configuration
522 call exf_clim_summary( mythid )
523
524 end

  ViewVC Help
Powered by ViewVC 1.1.22