File: includecom

package info (click to toggle)
flextra 5.0-18
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 928 kB
  • sloc: fortran: 7,018; makefile: 61; sh: 17
file content (296 lines) | stat: -rw-r--r-- 12,305 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
********************************************************************************
*        Include file for calculation of trajectories (Program FLEXTRA)        *
*        This file contains a global common block used in FLEXTRA              *
*                                                                              *
*        Authors: A. Stohl, G. Wotawa                                          *
*                                                                              *
*        1 February 1994                                                       *
*        Update: December 1998, A. Stohl                                       *
*                                                                              *
********************************************************************************


C Variables needed for polar stereographic projection
*****************************************************

      logical xglobal,sglobal,nglobal
      real switchnorthg,switchsouthg

C     xglobal             T for global fields, F for limited area fields
C     sglobal             T if domain extends towards south pole
C     nglobal             T if domain extends towards north pole
C     switchnorthg,switchsouthg   same as parameters switchnorth,
C                         switchsouth, but in grid units

      real southpolemap(9),northpolemap(9)

C     southpolemap,northpolemap   define stereographic projections
C                         at the two poles


C Variables needed for nested grids
***********************************

      integer numbnests

C numbnests    number of nested grids

      character*18 wfnamen(maxnests,numbwfmax)
      character*18 wfspecn(maxnests,numbwfmax)

C wfnamen      nested wind field names
C wfspecn      specifications of wind field file, e.g. if on hard 
C              disc or on tape


      integer nxn(maxnests),nyn(maxnests)
      real dxn(maxnests),dyn(maxnests),xlon0n(maxnests),ylat0n(maxnests)

C nxn,nyn      actual dimensions of nested wind fields in x and y direction
C dxn,dyn      grid distances in x,y direction for the nested grids
C xlon0n       geographical longitude of lower left grid point of nested wind fields
C ylat0n       geographical latitude of lower left grid point of nested wind fields


      real uun(0:nxmaxn-1,0:nymaxn-1,nuvzmax,3,maxnests)
      real vvn(0:nxmaxn-1,0:nymaxn-1,nuvzmax,3,maxnests)
      real wwn(0:nxmaxn-1,0:nymaxn-1,nwzmax,3,maxnests)
      real ttn(0:nxmaxn-1,0:nymaxn-1,nuvzmax,3,maxnests)
      real qqn(0:nxmaxn-1,0:nymaxn-1,nuvzmax,3,maxnests)
      real pvn(0:nxmaxn-1,0:nymaxn-1,nuvzmax,3,maxnests)
      real thn(0:nxmaxn-1,0:nymaxn-1,nuvzmax,3,maxnests)
      real psn(0:nxmaxn-1,0:nymaxn-1,1,3,maxnests)
      real oron(0:nxmaxn-1,0:nymaxn-1,maxnests)

C uun,vvn,wwn  nested wind data in x,y and z direction
C psn          nested surface pressure
C oron [m]     nested orography of the ECMWF model 
C ttn, qqn     nested temperature and specific humidity
C pvn, thn     nested potential vorticity and potential temperature


      real xresoln(0:maxnests),yresoln(0:maxnests)

C xresoln, yresoln   Factors by which the resolutions in the nests 
C                    are enhanced compared to mother grid

      real xln(maxnests),yln(maxnests),xrn(maxnests),yrn(maxnests)

C xln,yln,xrn,yrn    Corner points of nested grids in grid coordinates
C                    of mother grid



      integer nx,ny,nxfield,nuvz,nwz,nlev_ec

C nx,ny,nuvz,nwz          actual dimensions of wind fields in x,y and z
C                         direction, respectively

C nxfield                 same as nx for limited area fields,
C                         but for global fields nx=nxfield+1 

C nuvz is used for u,v components
C nwz is used for w components (staggered grid)
C nlev_ec  number of levels ECMWF model

      integer inter,interstep,ldim,numbunc,inpolkind,modecet

C inter                   index, if trajectory output with constant time step
C interstep               time step for trajectory output
C ldim                    number of steps along the interpolated trajectory
C numbunc                 number of uncertainty trajectories
C inpolkind               index for kind of interpolation (spline or linear)
C modecet                 1 = CET mode switched off, 2 = CET mode switched on

      character*50 runcomment

C runcomment              identification comment for the model run

      real cfl,cflt

C* cfl                    CFL-criterion horizontal and vertical
C* cflt                   CFL-criterion time

      real distunc

C distunc                 distance (grid units) of uncertainty t. from main one

      integer ldirect

C ldirect                 direction of the trajectories (-1=backward,1=forward)

      integer numpoint

C numpoint                actual number of trajectory starting/ending points

      integer lentra,ibdate,ibtime,iedate,ietime,interv


C lentra                  length of trajectory (s)
C ibdate                  beginning date (YYYYMMDD)
C ibtime                  beginning time (HHMISS)
C iedate                  ending date (YYYYMMDD)
C ietime                  ending time (HHMISS)
C interv                  interval of trajectory calculation (s)       

      integer len(numpath+2*maxnests)

C len                     length of path names needed for trajectory model

      integer ideltas,nextflight

C ideltas                 length of trajectory loop from beginning to
C                         ending date (s)
C nextflight              next time, when initialization of FLIGHT
C                         trajectories is due (s)

      real epsu,epsv,epsw,relaxtime

C epsu,epsv,epsw          magnitude of the relative random errors that are
C                         added to the wind components of the ensemble
C                         uncertainty trajectories at each time step
C relaxtime               time constant (in units of the wind field interval)
C                         at which the above errors are relaxed using
C                         a Langevin equation


      integer numbwf,wftime(numbwfmax)
      character*18 wfname(numbwfmax)
      character*10 wfspec(numbwfmax)

C numbwf                  actual number of wind fields
C wftime(numbwfmax) [s]   times relative to beginning time of wind fields
C wfname(numbwfmax)       file names of wind fields
C wfspec(numbwfmax)       specifications of wind field file, e.g. if on hard 
C                         disc or on tape


      real akm(nwzmax), bkm(nwzmax)
      real akz(nuvzmax)  , bkz(nuvzmax)

* akm,bkm: coeffizients which regulate vertical discretization of ecmwf model
*          (at the border of model layers)
* akz,bkz: model discretization coeffizients at the centre of the layers


      integer memtime(3),memind(3)

C memind     pointer, at which position the wind fields are actually stored
C            in memory
C memtime    times of the fields stored in memory

      real uu(0:nxmax-1,0:nymax-1,nuvzmax,3)
      real vv(0:nxmax-1,0:nymax-1,nuvzmax,3)
      real uupol(0:nxmax-1,0:nymax-1,nuvzmax,3)
      real vvpol(0:nxmax-1,0:nymax-1,nuvzmax,3)
      real ww(0:nxmax-1,0:nymax-1,nwzmax,3)
      real tt(0:nxmax-1,0:nymax-1,nuvzmax,3)
      real qq(0:nxmax-1,0:nymax-1,nuvzmax,3)
      real pv(0:nxmax-1,0:nymax-1,nuvzmax,3)
      real th(0:nxmax-1,0:nymax-1,nuvzmax,3)
      real ps(0:nxmax-1,0:nymax-1,1,3)
      real oro(0:nxmax-1,0:nymax-1)

C uu,vv,ww             wind data in x,y and z direction (grid values)
C uupol,vvpol          horizontal wind transformed onto a polarstereographic grid
C tt, qq               temperature and specific humidity
C pv, th               potential vorticity and potential temperature
C ps                   surface pressure
C oro [m]              orography of the ECMWF model 

      real xpoint(maxtra),ypoint(maxtra),zpoint(maxtra)

C xpoint                  x-coordinates of starting/ending points
C ypoint                  y-coordinates of starting/ending points
C zpoint                  z-coordinates of starting/ending points

      real dx,dy,xlon0,ylat0,xthelp,ythelp
      real uvheight(nuvzmax),wheight(nwzmax),heightmin,heightmax

C dx                      grid distance in x direction
C dy                      grid distance in y direction
C uvheight                heights of (u,v) gridpoints
C wheight                 heights of (w) gridpoints
C xlon0                   geographical longitude of lower left grid point
C ylat0                   geographical latitude of lower left grid point
C heightmin, heightmax    minimum and maximum height of modelling domain
C xthelp,ythelp           help variables to convert geografical coordinates
C                         into grid coordinates

      real zdirect

C zdirect                 direction of model levels from bottom to top
C                         if coordinate of first model level (bottom) is
C                         less then coordinate of last model level,
C                         zdirect is set 1. Otherwise, it is set -1

      integer numtra,nttra(maxtra),npoint(maxtra)
      integer kind(maxtra),kindz(maxtra)
      real randerroru(maxtra),randerrorv(maxtra),randerrorw(maxtra)
      integer ittra(maxtra,maxtime),ittraint(maxitime)
      real xtra(maxtra,maxtime),ytra(maxtra,maxtime),
     &     ztra(maxtra,maxtime),ptra(maxtra,maxtime),
     &     htra(maxtra,maxtime),pvtra(maxtra,maxtime),
     &     thtra(maxtra,maxtime),qqtra(maxtra,maxtime)
      real xtraint(maxitime),ytraint(maxitime),ztraint(maxitime),
     +     ptraint(maxitime),htraint(maxitime),pvtraint(maxitime),
     +     thtraint(maxitime),qqtraint(maxitime)

C numtra                  actual number of trajectories in memory
C nttra(maxtra)           number of time steps that are already computed
C npoint(maxtra)          identification of startpoint of trajectory
C kind(maxtra)            index for kind of trajectories (e.g. isobaric, 3-d,..)
C randerroru,randerrorv,  Random errors added to the trajectory during
C randerrorw              last time step
C kindz(maxtra)           indicates the unit of the z coordinate (1: masl,
C                         2: magl, 3: hPa)
C htra,ptra               height in meters and in hPa
C xtra,ytra,ztra          spatial positions of the trajectories
C qqtra                   specific humidity along trajectories
C qqtraint                specific humidity interpolated to constant time step
C thtra(maxtra,maxtime) [K] potential temperature along trajectory
C thtraint(maxitime) [K] potential temperature interpolated to constant step
c pvtra(maxtra,maxtime) [Ks-1hPa-1] potential vorticity along trajectory
c pvtraint(maxtra,maxtime) [Ks-1hPa-1] potential vorticity interpolated to constant step
C ittra (maxtra,maxtime) [s] temporal position of the trajectories
C ittraint(maxitime) [s]  one trajectory interpolated to constant time step
C xtraint,ytraint,ztraint one trajectory interpolated to constant time step


      double precision bdate

C bdate                   beginning date of trajectory loop (julian date)

      character path(numpath+2*maxnests)*80

C path                    path names needed for trajectory model

      character compoint(maxtra)*45

C compoint                comment - characterization of starting point

      common /global1/
     +bdate,
     +nx,ny,nuvz,nwz,numbwf,wftime,inter,interstep,ldim,numbunc,modecet,
     +inpolkind,ldirect,kind,kindz,lentra,ibdate,ibtime,iedate,ietime,
     +interv,len,numpoint,ideltas,ittra,ittraint,numtra,nttra,npoint,
     +memtime,memind,nxfield,nlev_ec,nextflight,
     +randerroru,randerrorv,randerrorw

      common /global2/
     +xtra,ytra,ztra,ptra,qqtra,htra,xtraint,ytraint,ztraint,ptraint,
     +qqtraint,htraint,
     +cfl,cflt,distunc,akm,bkm,akz,bkz,pvtra,pvtraint,thtra,
     +thtraint,uu,vv,uupol,vvpol,ww,tt,qq,pv,th,ps,oro,
     +switchsouthg,switchnorthg,northpolemap,southpolemap,
     +xpoint,ypoint,zpoint,epsu,epsv,epsw,relaxtime,
     +dx,dy,uvheight,wheight,heightmin,heightmax,xlon0,ylat0,
     +xthelp,ythelp,zdirect,xglobal,sglobal,nglobal

      common /global3/
     +path,wfname,wfspec,compoint,runcomment

      common /global4/
     +numbnests,nxn,nyn,uun,vvn,wwn,ttn,qqn,pvn,thn,psn,oron,
     +xlon0n,ylat0n,dxn,dyn,xresoln,yresoln,xln,yln,xrn,yrn,
     +wfnamen,wfspecn