/[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.8 - (show annotations) (download)
Fri May 23 18:37:31 2003 UTC (21 years, 1 month ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint51, checkpoint51d_post, checkpoint51b_pre, checkpoint50f_post, checkpoint51b_post, checkpoint51c_post, checkpoint50g_post, checkpoint50h_post, checkpoint50i_post, checkpoint51e_post, checkpoint51a_post
Changes since 1.7: +31 -17 lines
o exf totally restructured
  - replaced all exf_set_ routines by one generic exf_set_gen.F
    and made sure it's still differentiable
  - split exf_getffields.F into new exf_bulkformulae.F
  - exf_inscal_/exf_outscal_ suffixes consistent with field names
  - updated adjoint/makefile and relevant verif. accordingly

1 c $Header: /u/gcmpack/MITgcm/pkg/exf/exf_readparms.F,v 1.1.6.9 2003/05/23 16:18:57 heimbach Exp $
2
3 #include "EXF_CPPOPTIONS.h"
4 #ifdef ALLOW_OBCS
5 # include "OBCS_OPTIONS.h"
6 #endif
7
8 subroutine exf_readparms( mythid )
9
10 c ==================================================================
11 c SUBROUTINE exf_readparms
12 c ==================================================================
13 c
14 c o This routine initialises the package that calculates external
15 c forcing fields for a given timestep of the MITgcmUV. Parameters
16 c for this package are set in "data.externalforcing". Some additional
17 c precompiler switches have to be specified in "EXF_CPPOPTIONS.h".
18 c
19 c started: Christian Eckert eckert@mit.edu 30-Jun-1999
20 c
21 c changed: Christian Eckert eckert@mit.edu 11-Jan-2000
22 c - Restructured the code in order to create a package
23 c for the MITgcmUV.
24 c Christian Eckert eckert@mit.edu 12-Feb-2000
25 c - Changed Routine names (package prefix: exf_)
26 c changed: Patrick Heimbach, heimbach@mit.edu 04-May-2000
27 c - changed the handling of precip and sflux with respect
28 c to CPP options ALLOW_BULKFORMULAE and ALLOW_ATM_TEMP
29 c changed: Ralf.Giering@FastOpt.de 25-Mai-20000
30 c - moved relaxation and climatology to extra routines
31 c Patrick Heimbach, heimbach@mit.edu 04-May-2000
32 c - added obcs parameters
33 c changed: Virginie Thierry, vthierry@ucsd.edu 04-June-2001
34 c - added new obcs parameters (for each boundaries)
35 c included runoff D. Stammer, Nov. 25, 2001
36 c included pressure forcing. heimbach@mit.edu 05-Nov-2002
37 c added "repeatPeriod" for cycling of forcing datasets 19-Dec-2002
38 c mods for pkg/seaice: menemenlis@jpl.nasa.gov 20-Dec-2002
39 c
40 c ==================================================================
41 c SUBROUTINE exf_readparms
42 c ==================================================================
43
44 implicit none
45
46 c == global variables ==
47
48 #include "EEPARAMS.h"
49 #include "SIZE.h"
50 #include "cal.h"
51 #include "exf.h"
52 #include "exf_param.h"
53 #include "exf_constants.h"
54
55 c == routine arguments ==
56
57 integer mythid
58
59 c == local variables ==
60
61 integer i
62
63 c == external ==
64
65 integer ilnblnk
66 external ilnblnk
67
68 c == end of interface ==
69
70 c Surface flux data.
71 namelist /exf_nml/
72 & repeatPeriod,
73 & hfluxstartdate1, hfluxstartdate2, hfluxperiod,
74 & atempstartdate1, atempstartdate2, atempperiod,
75 & aqhstartdate1, aqhstartdate2, aqhperiod,
76 & sfluxstartdate1, sfluxstartdate2, sfluxperiod,
77 & evapstartdate1, evapstartdate2, evapperiod,
78 & precipstartdate1, precipstartdate2, precipperiod,
79 & runoffstartdate1, runoffstartdate2, runoffperiod,
80 & ustressstartdate1, ustressstartdate2, ustressperiod,
81 & vstressstartdate1, vstressstartdate2, vstressperiod,
82 & uwindstartdate1, uwindstartdate2, uwindperiod,
83 & vwindstartdate1, vwindstartdate2, vwindperiod,
84 & swfluxstartdate1, swfluxstartdate2, swfluxperiod,
85 & lwfluxstartdate1, lwfluxstartdate2, lwfluxperiod,
86 & swdownstartdate1, swdownstartdate2, swdownperiod,
87 & lwdownstartdate1, lwdownstartdate2, lwdownperiod,
88 & obcsNstartdate1, obcsNstartdate2, obcsNperiod,
89 & obcsSstartdate1, obcsSstartdate2, obcsSperiod,
90 & obcsEstartdate1, obcsEstartdate2, obcsEperiod,
91 & obcsWstartdate1, obcsWstartdate2, obcsWperiod,
92 &apressurestartdate1,apressurestartdate2,apressureperiod,
93 & hfluxfile, atempfile, aqhfile,
94 & sfluxfile, precipfile, runofffile,
95 & ustressfile, vstressfile, evapfile,
96 & uwindfile, vwindfile,
97 & swfluxfile, lwfluxfile, apressurefile,
98 & swdownfile, lwdownfile,
99 & exf_iprec, exf_yftype,
100 & exf_inscal_hflux, exf_inscal_sflux,
101 & exf_inscal_ustress, exf_inscal_vstress,
102 & exf_inscal_uwind, exf_inscal_vwind,
103 & exf_inscal_evap, exf_inscal_atemp, exf_inscal_aqh,
104 & exf_inscal_sst, exf_inscal_sss,
105 & exf_inscal_swflux, exf_inscal_lwflux, exf_inscal_precip,
106 & exf_inscal_runoff, exf_inscal_apressure,
107 & exf_inscal_swdown, exf_inscal_lwdown,
108 & exf_outscal_hflux, exf_outscal_ustress, exf_outscal_vstress,
109 & exf_outscal_swflux, exf_outscal_sst,exf_outscal_sss,
110 & exf_outscal_sflux, exf_outscal_apressure,
111 & hfluxconst,
112 & atempconst,
113 & aqhconst,
114 & sfluxconst,
115 & evapconst,
116 & precipconst,
117 & runoffconst,
118 & ustressconst,
119 & vstressconst,
120 & uwindconst,
121 & vwindconst,
122 & swfluxconst,
123 & lwfluxconst,
124 & swdownconst,
125 & lwdownconst,
126 & apressureconst,
127 & EXFwindOnBgrid
128
129 _BEGIN_MASTER(mythid)
130
131 c Set default values.
132
133 c Calendar data.
134 hfluxstartdate1 = 0
135 hfluxstartdate2 = 0
136 hfluxperiod = 0.0 _d 0
137 hfluxconst = 0.0 _d 0
138
139 atempstartdate1 = 0
140 atempstartdate2 = 0
141 atempperiod = 0.0 _d 0
142 atempconst = 0.0 _d 0
143
144 aqhstartdate1 = 0
145 aqhstartdate2 = 0
146 aqhperiod = 0.0 _d 0
147 aqhconst = 0.0 _d 0
148
149 sfluxstartdate1 = 0
150 sfluxstartdate2 = 0
151 sfluxperiod = 0.0 _d 0
152 sfluxconst = 0.0 _d 0
153
154 evapstartdate1 = 0
155 evapstartdate2 = 0
156 evapperiod = 0.0 _d 0
157 evapconst = 0.0 _d 0
158
159 precipstartdate1 = 0
160 precipstartdate2 = 0
161 precipperiod = 0.0 _d 0
162 precipconst = 0.0 _d 0
163
164 runoffstartdate1 = 0
165 runoffstartdate2 = 0
166 runoffperiod = 0.0 _d 0
167 runoffconst = 0.0 _d 0
168
169 ustressstartdate1 = 0
170 ustressstartdate2 = 0
171 ustressperiod = 0.0 _d 0
172 ustressconst = 0.0 _d 0
173
174 vstressstartdate1 = 0
175 vstressstartdate2 = 0
176 vstressperiod = 0.0 _d 0
177 vstressconst = 0.0 _d 0
178
179 uwindstartdate1 = 0
180 uwindstartdate2 = 0
181 uwindperiod = 0.0 _d 0
182 uwindconst = 0.0 _d 0
183
184 vwindstartdate1 = 0
185 vwindstartdate2 = 0
186 vwindperiod = 0.0 _d 0
187 vwindconst = 0.0 _d 0
188
189 swfluxstartdate1 = 0
190 swfluxstartdate2 = 0
191 swfluxperiod = 0.0 _d 0
192 swfluxconst = 0.0 _d 0
193
194 lwfluxstartdate1 = 0
195 lwfluxstartdate2 = 0
196 lwfluxperiod = 0.0 _d 0
197 lwfluxconst = 0.0 _d 0
198
199 swdownstartdate1 = 0
200 swdownstartdate2 = 0
201 swdownperiod = 0.0 _d 0
202 swdownconst = 0.0 _d 0
203
204 lwdownstartdate1 = 0
205 lwdownstartdate2 = 0
206 lwdownperiod = 0.0 _d 0
207 lwdownconst = 0.0 _d 0
208
209 obcsNstartdate1 = 0
210 obcsNstartdate2 = 0
211 obcsNperiod = 0.0 _d 0
212
213 obcsSstartdate1 = 0
214 obcsSstartdate2 = 0
215 obcsSperiod = 0.0 _d 0
216
217 obcsEstartdate1 = 0
218 obcsEstartdate2 = 0
219 obcsEperiod = 0.0 _d 0
220
221 obcsWstartdate1 = 0
222 obcsWstartdate2 = 0
223 obcsWperiod = 0.0 _d 0
224
225 apressurestartdate1 = 0
226 apressurestartdate2 = 0
227 apressureperiod = 0.0 _d 0
228 apressureconst = 0.0 _d 0
229
230 repeatPeriod = 0.0 _d 0
231
232 c Data files.
233 hfluxfile = ' '
234 atempfile = ' '
235 aqhfile = ' '
236 evapfile = ' '
237 precipfile = ' '
238 sfluxfile = ' '
239 runofffile = ' '
240 ustressfile = ' '
241 vstressfile = ' '
242 uwindfile = ' '
243 vwindfile = ' '
244 swfluxfile = ' '
245 lwfluxfile = ' '
246 swdownfile = ' '
247 lwdownfile = ' '
248 apressurefile = ' '
249
250 c Initialise the date arrays.
251 do i = 1,4
252 hfluxstartdate(i) = 0
253 atempstartdate(i) = 0
254 aqhstartdate(i) = 0
255 evapstartdate(i) = 0
256 precipstartdate(i) = 0
257 sfluxstartdate(i) = 0
258 runoffstartdate(i) = 0
259 ustressstartdate(i) = 0
260 vstressstartdate(i) = 0
261 uwindstartdate(i) = 0
262 vwindstartdate(i) = 0
263 swfluxstartdate(i) = 0
264 lwfluxstartdate(i) = 0
265 swdownstartdate(i) = 0
266 lwdownstartdate(i) = 0
267 obcsNstartdate(i) = 0
268 obcsSstartdate(i) = 0
269 obcsEstartdate(i) = 0
270 obcsWstartdate(i) = 0
271 apressurestartdate(i)= 0
272 enddo
273
274 c Initialise file type and field precision
275 exf_iprec = 32
276 exf_yftype = 'RL'
277
278 c Input scaling factors.
279 exf_inscal_hflux = 1. _d 0
280 exf_inscal_sflux = 1. _d 0
281 exf_inscal_ustress = 1. _d 0
282 exf_inscal_vstress = 1. _d 0
283 exf_inscal_uwind = 1. _d 0
284 exf_inscal_vwind = 1. _d 0
285 exf_inscal_swflux = 1. _d 0
286 exf_inscal_lwflux = 1. _d 0
287 exf_inscal_precip = 1. _d 0
288 exf_inscal_sst = 1. _d 0
289 exf_inscal_sss = 1. _d 0
290 exf_inscal_atemp = 1. _d 0
291 exf_inscal_aqh = 1. _d 0
292 exf_inscal_evap = 1. _d 0
293 exf_inscal_apressure = 1. _d 0
294 cds convert runoff from m/yr to m/s and change sign.
295 exf_inscal_runoff = -1.0/(86400.*365.0)
296 exf_inscal_swdown = 1. _d 0
297 exf_inscal_lwdown = 1. _d 0
298
299 c Output scaling factors.
300 exf_outscal_hflux = 1. _d 0
301 exf_outscal_sflux = 1. _d 0
302 exf_outscal_ustress = 1. _d 0
303 exf_outscal_vstress = 1. _d 0
304 exf_outscal_swflux = 1. _d 0
305 exf_outscal_sst = 1. _d 0
306 exf_outscal_sss = 1. _d 0
307 exf_outscal_apressure= 1. _d 0
308 c
309 EXFwindOnBgrid = .FALSE.
310
311 c Check for the availability of the right calendar version.
312 if ( calendarversion .ne. usescalendarversion ) then
313 print*,' exf_readparms: You are not using the appropriate'
314 print*,' version of the calendar package.'
315 print*
316 print*,' You are using Calendar version: ', calendarversion
317 print*,' Please use Calendar version: ', usescalendarversion
318 stop ' stopped in exf_readparms.'
319 endif
320
321 c Next, read the forcing data file.
322 call nml_filter( 'data.exf', scrunit1, myThid )
323 if (scrunit1 .eq. 0) then
324 stop 'exf_readparms: reading namelist failed'
325 end if
326 read( scrunit1, nml = exf_nml )
327 close( scrunit1 )
328
329 c Complete the start date specifications for the forcing
330 c fields to get a complete calendar date array.
331
332 c check for consistency
333
334 if (.NOT.
335 & (exf_iprec .EQ. 32 .OR. exf_iprec .EQ. 64)
336 & ) then
337 stop 'stop in exf_readparms: value of exf_iprec not allowed'
338 else if (.NOT.
339 & (exf_yftype .EQ. 'RS' .OR.
340 & exf_yftype .EQ. 'RL')
341 & ) then
342 stop 'stop in exf_readparms: value of exf_yftype not allowed'
343 end if
344
345 #ifdef ALLOW_ATM_WIND
346 call cal_FullDate( uwindstartdate1, uwindstartdate2,
347 & uwindstartdate , mythid )
348 call cal_FullDate( vwindstartdate1, vwindstartdate2,
349 & vwindstartdate , mythid )
350 #else
351 call cal_FullDate( ustressstartdate1, ustressstartdate2,
352 & ustressstartdate , mythid )
353 call cal_FullDate( vstressstartdate1, vstressstartdate2,
354 & vstressstartdate , mythid )
355 #endif
356
357 #ifdef ALLOW_ATM_TEMP
358 call cal_FullDate( atempstartdate1, atempstartdate2,
359 & atempstartdate , mythid )
360 call cal_FullDate( aqhstartdate1, aqhstartdate2,
361 & aqhstartdate , mythid )
362 call cal_FullDate( lwfluxstartdate1, lwfluxstartdate2,
363 & lwfluxstartdate , mythid )
364 call cal_FullDate( precipstartdate1, precipstartdate2,
365 & precipstartdate , mythid )
366 #else
367 call cal_FullDate( hfluxstartdate1, hfluxstartdate2,
368 & hfluxstartdate , mythid )
369 call cal_FullDate( sfluxstartdate1, sfluxstartdate2,
370 & sfluxstartdate , mythid )
371 #endif
372
373 #if defined(ALLOW_ATM_TEMP) || defined(SHORTWAVE_HEATING)
374 call cal_FullDate( swfluxstartdate1, swfluxstartdate2,
375 & swfluxstartdate , mythid )
376 #endif
377
378 #ifdef EXF_READ_EVAP
379 call cal_FullDate( evapstartdate1, evapstartdate2,
380 & evapstartdate , mythid )
381 #endif
382
383 #ifdef ALLOW_RUNOFF
384 call cal_FullDate( runoffstartdate1, runoffstartdate2,
385 & runoffstartdate , mythid )
386 #endif
387
388 #ifdef ALLOW_DOWNWARD_RADIATION
389 call cal_FullDate( swdownstartdate1, swdownstartdate2,
390 & swdownstartdate , mythid )
391 call cal_FullDate( lwdownstartdate1, lwdownstartdate2,
392 & lwdownstartdate , mythid )
393 #endif
394
395 #ifdef ALLOW_OBCS
396 #ifdef ALLOW_OBCS_NORTH
397 call cal_FullDate( obcsNstartdate1, obcsNstartdate2,
398 & obcsNstartdate , mythid )
399 #endif
400 #ifdef ALLOW_OBCS_SOUTH
401 call cal_FullDate( obcsSstartdate1, obcsSstartdate2,
402 & obcsSstartdate , mythid )
403 #endif
404 #ifdef ALLOW_OBCS_EAST
405 call cal_FullDate( obcsEstartdate1, obcsEstartdate2,
406 & obcsEstartdate , mythid )
407 #endif
408 #ifdef ALLOW_OBCS_WEST
409 call cal_FullDate( obcsWstartdate1, obcsWstartdate2,
410 & obcsWstartdate , mythid )
411 #endif
412 #endif /* ALLOW_OBCS */
413
414 #ifdef ATMOSPHERIC_LOADING
415 call cal_FullDate(apressurestartdate1,apressurestartdate2,
416 & apressurestartdate , mythid )
417 #endif
418
419 _END_MASTER( mythid )
420
421 _BARRIER
422
423 c-- Summarize the External forcing's setup.
424 call exf_summary( mythid )
425
426 c-- set climatology parameters
427 call exf_clim_readparms( mythid )
428
429 c-- summarize climatologic forcing configuration
430 call exf_clim_summary( mythid )
431
432 end

  ViewVC Help
Powered by ViewVC 1.1.22