source: flexpart.git/src/com_mod.f90 @ 5f9d14a

10.4.1_peseiGFS_025bugfixes+enhancementsdevrelease-10release-10.4.1scaling-bugunivie
Last change on this file since 5f9d14a was 5f9d14a, checked in by Espen Sollum ATMOS <eso@…>, 9 years ago

Updated wet depo scheme

  • Property mode set to 100644
File size: 32.9 KB
Line 
1!*******************************************************************************
2!        Include file for particle diffusion model FLEXPART                    *
3!        This file contains a global common block used by FLEXPART             *
4!                                                                              *
5!        Author: A. Stohl                                                      *
6!                                                                              *
7!        June 1996                                                             *
8!                                                                              *
9!        Last update:15 August 2013 IP                                         *
10!                                                                              *
11!*******************************************************************************
12
13module com_mod
14
15  use par_mod, only: dp, numpath, maxnests, maxageclass, maxspec, ni, &
16       numclass, nymax, nxmax, maxcolumn, maxwf, nzmax, nxmaxn, nymaxn, &
17       maxreceptor, maxpart, maxrand, nwzmax, nuvzmax, numwfmem
18
19  implicit none
20
21  !****************************************************************
22  ! Variables defining where FLEXPART input/output files are stored
23  !****************************************************************
24
25  character :: path(numpath+2*maxnests)*120
26  integer :: length(numpath+2*maxnests)
27  character(len=256) :: pathfile, flexversion, arg1, arg2
28 
29  ! path                    path names needed for trajectory model
30  ! length                  length of path names needed for trajectory model
31  ! pathfile                file where pathnames are stored
32  ! flexversion             version of flexpart
33  ! arg                     input arguments from launch at command line
34
35  !********************************************************
36  ! Variables defining the general model run specifications
37  !********************************************************
38
39  integer :: ibdate,ibtime,iedate,ietime
40  real(kind=dp) :: bdate,edate
41
42
43  ! ibdate                  beginning date (YYYYMMDD)
44  ! ibtime                  beginning time (HHMISS)
45  ! iedate                  ending date (YYYYMMDD)
46  ! ietime                  ending time (HHMISS)
47  ! bdate                   beginning date of simulation (julian date)
48  ! edate                   ending date of simulation (julian date)
49
50
51  integer :: ldirect,ideltas
52
53  ! ldirect                 1 for forward, -1 for backward simulation
54  ! ideltas                 length of trajectory loop from beginning to
55  !                    ending date (s)
56
57  integer :: loutstep,loutaver,loutsample,method,lsynctime
58  real :: outstep
59
60  ! loutstep [s]            gridded concentration output every loutstep seconds
61  ! loutaver [s]            concentration output is an average over [s] seconds
62  ! loutsample [s]          sampling interval of gridded concentration output
63  ! lsynctime [s]           synchronisation time of all particles
64  ! method                  indicator which dispersion method is to be used
65  ! outstep = real(abs(loutstep))
66
67  real :: ctl,fine
68  integer :: ifine,iout,ipout,ipin,iflux,mdomainfill
69  integer :: mquasilag,nested_output,ind_source,ind_receptor
70  integer :: ind_rel,ind_samp,ioutputforeachrelease,linit_cond,surf_only
71  logical :: turbswitch
72  integer :: cblflag  !added by mc for cbl
73
74  ! ctl      factor, by which time step must be smaller than Lagrangian time scale
75  ! ifine    reduction factor for time step used for vertical wind
76  !     Langevin equation for the vertical wind component
77  ! ioutputforeachrelease Should each release be a seperate output field?
78  ! iflux    flux calculation options: 1 calculation of fluxes, 2 no fluxes
79  ! iout     output options: 1 conc. output (ng/m3), 2 mixing ratio (pptv), 3 both
80  ! ipout    particle dump options: 0 no, 1 every output interval, 2 only at end
81  ! ipin     read in particle positions from dumped file from a previous run
82  ! fine     real(ifine)
83  ! mdomainfill 0: normal run
84  !        1: particles are initialized according to atmospheric mass distribution
85  ! ind_source switches between different units for concentrations at the source
86  !  NOTE that in backward simulations the release of computational particles
87  !  takes place at the "receptor" and the sampling of particles at the "source".
88  !     1= mass units
89  !     2= mass mixing ratio units
90  ! ind_receptor switches between different units for FLEXPART concentration at the receptor
91  !     1= mass units
92  !     2= mass mixing ratio units
93  ! linit_cond  switch on the output of sensitivity to initial conditions for backward runs
94  !     0=no, 1=mass unit, 2=mass mixing ratio unit
95  ! mquasilag 0: normal run
96  !      1: Particle position output is produced in a condensed format and particles are numbered
97  ! surf_only   switch output in grid_time files for surface only or full vertical resolution
98  !      0=no (full vertical resolution), 1=yes (surface only)
99  ! nested_output: 0 no, 1 yes
100  ! turbswitch              determines how the Markov chain is formulated
101
102  ! ind_rel and ind_samp  are used within the code to change between mass and mass-mix (see readcommand.f)
103  ! cblflag !: 1 activate cbl skewed pdf routines with bi-gaussina pdf whan OL<0 added by mc
104
105
106  integer :: mintime,itsplit
107
108  ! mintime                 minimum time step to be used by FLEXPART
109  ! itsplit                 time constant for splitting particles
110
111  integer :: lsubgrid,lconvection,lagespectra
112
113  ! lsubgrid     1 if subgrid topography parameterization switched on, 2 if not
114  ! lconvection  1 if convection parameterization switched on, 0 if not
115  ! lagespectra  1 if age spectra calculation switched on, 2 if not
116
117  integer :: lnetcdfout
118  ! lnetcdfout   1 for netcdf grid output, 0 if not. Set in COMMAND (namelist input)
119
120  integer :: nageclass,lage(maxageclass)
121
122  ! nageclass               number of ageclasses for the age spectra calculation
123  ! lage [s]                ageclasses for the age spectra calculation
124
125
126  logical :: gdomainfill
127
128  ! gdomainfill             .T., if domain-filling is global, .F. if not
129
130!hg
131  logical :: readclouds
132
133!NIK 16.02.2015
134  integer :: tot_blc_count, tot_inc_count
135
136
137
138  !*********************************************************************
139  ! Variables defining the release locations, released species and their
140  ! properties, etc.
141  !*********************************************************************
142
143  !change Sabine Eckhardt, only save the first 1000 identifier for releasepoints
144  character :: compoint(1001)*45
145  integer :: numpoint
146  !sec, now dynamically allocated:
147  ! ireleasestart(maxpoint),ireleaseend(maxpoint)
148  !      real xpoint1(maxpoint),ypoint1(maxpoint)
149  !real xpoint2(maxpoint),ypoint2(maxpoint)
150  !real zpoint1(maxpoint),zpoint2(maxpoint)
151  !integer*2 kindz(maxpoint)
152  integer :: specnum(maxspec)
153  !real xmass(maxpoint,maxspec)
154  real :: decay(maxspec)
155  real :: weta(maxspec),wetb(maxspec)
156! NIK: 31.01.2013- parameters for in-cloud scavening
157  real :: weta_in(maxspec), wetb_in(maxspec)
158  real :: reldiff(maxspec),henry(maxspec),f0(maxspec)
159  real :: density(maxspec),dquer(maxspec),dsigma(maxspec)
160  real :: vsetaver(maxspec),cunningham(maxspec),weightmolar(maxspec)
161  real :: vset(maxspec,ni),schmi(maxspec,ni),fract(maxspec,ni)
162  real :: ri(5,numclass),rac(5,numclass),rcl(maxspec,5,numclass)
163  real :: rgs(maxspec,5,numclass),rlu(maxspec,5,numclass)
164  real :: rm(maxspec),dryvel(maxspec),kao(maxspec)
165  real :: ohcconst(maxspec),ohdconst(maxspec)
166  ! se  it is possible to associate a species with a second one to make transfer from gas to aerosol
167  integer :: spec_ass(maxspec)
168
169  real :: area_hour(maxspec,24),point_hour(maxspec,24)
170  real :: area_dow(maxspec,7),point_dow(maxspec,7)
171
172  !integer npart(maxpoint)
173  integer :: nspec,maxpointspec_act
174  character(len=10) :: species(maxspec)
175
176
177  ! compoint                comment, also "name" of each starting point
178  ! numpoint                actual number of trajectory starting/ending points
179  ! ireleasestart,ireleaseend [s] starting and ending time of each release
180  ! xmass                   total mass emitted
181  ! xpoint1,ypoint1         lower left coordinates of release area
182  ! xpoint2,ypoint2         upper right coordinates of release area
183  ! zpoint1,zpoint2         min./max. z-coordinates of release points
184  ! kindz                   1: zpoint is in m agl, 2: zpoint is in m asl
185  ! npart                   number of particles per release point
186  ! nspec                   number of different species allowed for one release
187  ! maxpointspec_act        number of releaspoints for which a different output shall be created
188  ! species                 name of species
189  ! decay                   decay constant of radionuclide
190
191  ! WET DEPOSITION
192  ! weta, wetb              parameters for determining below-cloud wet scavenging coefficients
193  ! weta_in, wetb_in       parameters for determining in-cloud wet scavenging coefficients
194  ! wetc_in, wetd_in       parameters for determining in-cloud wet scavenging coefficients
195
196  ! GAS DEPOSITION
197  ! reldiff                 diffusivitiy of species relative to diff. of H2O
198  ! henry [M/atm]           Henry constant
199  ! f0                      reactivity relative to that of O3
200  ! ri [s/m]                stomatal resistance
201  ! rcl [s/m]               lower canopy resistance
202  ! rgs [s/m]               ground resistance
203  ! rlu [s/m]               leaf cuticular resistance
204  ! rm [s/m]                mesophyll resistance
205  ! dryvel [m/s]            constant dry deposition velocity
206
207  ! PARTICLE DEPOSITION
208  ! density [kg/m3]         density of particles
209  ! dquer [m]               mean diameter of particles
210  ! dsigma                  dsigma=10 or dsigma=0.1 means that 68% of the
211  !                    mass are between 0.1*dquer and 10*dquer
212
213  ! fract                   mass fraction of each diameter interval
214  ! vset [m/s]              gravitational settling velocity in ni intervals
215  ! cunningham              Cunningham slip correction (strictly valid only near surface)
216  ! vsetaver [m/s]          average gravitational settling velocity
217  ! schmi                   Schmidt number**2/3 of each diameter interval
218  ! weightmolar [g/mol]     molecular weight
219
220  ! TIME VARIATION OF EMISSION
221  ! area_hour, point_hour   daily variation of emission strengths for area and point sources
222  ! area_dow, point_dow     day-of-week variation of emission strengths for area and point sources
223
224
225
226  !**********************************************************
227  ! Variables used for domain-filling trajectory calculations
228  !**********************************************************
229
230  integer :: nx_we(2),ny_sn(2)
231  integer :: numcolumn
232  integer :: numcolumn_we(2,0:nymax-1),numcolumn_sn(2,0:nxmax-1)
233  real :: zcolumn_we(2,0:nymax-1,maxcolumn)
234  real :: zcolumn_sn(2,0:nxmax-1,maxcolumn)
235  real :: xmassperparticle
236  real :: acc_mass_we(2,0:nymax-1,maxcolumn)
237  real :: acc_mass_sn(2,0:nxmax-1,maxcolumn)
238
239  ! nx_we(2)                x indices of western and eastern boundary of domain-filling
240  ! ny_sn(2)                y indices of southern and northern boundary of domain-filling
241  ! numcolumn_we            number of particles to be released within one column
242  !                    at the western and eastern boundary surfaces
243  ! numcolumn_sn            same as numcolumn_we, but for southern and northern domain boundary
244  ! numcolumn               maximum number of particles to be released within a single
245  !                    column
246  ! zcolumn_we              altitudes where particles are to be released
247  !                    at the western and eastern boundary surfaces
248  ! zcolumn_sn              same as zcolumn_we, but for southern and northern domain boundary
249  ! xmassperparticle        air mass per particle in the domain-filling traj. option
250  ! acc_mass_we             mass that has accumulated at the western and eastern boundary;
251  !                    if it exceeds xmassperparticle, a particle is released and
252  !                    acc_mass_we is reduced accordingly
253  ! acc_mass_sn             same as acc_mass_we, but for southern and northern domain boundary
254
255
256
257  !******************************************************************************
258  ! Variables associated with the ECMWF meteorological input data ("wind fields")
259  !******************************************************************************
260
261  integer :: numbwf,wftime(maxwf),lwindinterv
262  character(len=255) :: wfname(maxwf),wfspec(maxwf)
263
264  ! lwindinterv [s]         Interval between wind fields currently in memory
265  ! numbwf                  actual number of wind fields
266  ! wftime(maxwf) [s]       times relative to beginning time of wind fields
267  ! wfname(maxwf)           file names of wind fields
268  ! wfspec(maxwf)           specifications of wind field file, e.g. if on hard
269  !                         disc or on tape
270
271  integer :: memtime(numwfmem),memind(3) ! eso: or memind(numwfmem)
272
273  ! memtime [s]             validation times of wind fields in memory
274  ! memind                  pointer to wind field, in order to avoid shuffling
275  !                         of wind fields
276
277
278
279  !****************************************************************************
280  ! Variables defining actual size and geographical location of the wind fields
281  !****************************************************************************
282
283  integer :: nx,ny,nxmin1,nymin1,nxfield,nuvz,nwz,nz,nmixz,nlev_ec
284  real :: dx,dy,xlon0,ylat0,dxconst,dyconst,height(nzmax)
285
286  ! nx,ny,nz                actual dimensions of wind fields in x,y and z
287  !                    direction, respectively
288  ! nxmin1,nymin1           nx-1, ny-1, respectively
289  ! nuvz,nwz                vertical dimension of original ECMWF data
290  ! nxfield                 same as nx for limited area fields,
291  !                    but for global fields nx=nxfield+1
292  ! nmixz                   number of levels up to maximum PBL height (3500 m)
293
294  ! nuvz is used for u,v components
295  ! nwz is used for w components (staggered grid)
296  ! nz is used for the levels in transformed coordinates (terrain-following Cartesian
297  ! coordinates)
298
299  ! nlev_ec  number of levels ECMWF model
300  ! dx                      grid distance in x direction
301  ! dy                      grid distance in y direction
302  ! dxconst,dyconst         auxiliary variables for utransform,vtransform
303  ! height                  heights of all levels
304  ! xlon0                   geographical longitude and
305  ! ylat0                   geographical latitude of lower left grid point
306
307
308
309  !*************************************************
310  ! Variables used for vertical model discretization
311  !*************************************************
312
313  real :: akm(nwzmax),bkm(nwzmax)
314  real :: akz(nuvzmax),bkz(nuvzmax)
315  real :: aknew(nzmax),bknew(nzmax)
316
317  ! akm,bkm: coeffizients which regulate vertical discretization of ecmwf model
318  !     (at the border of model layers)
319  ! akz,bkz: model discretization coeffizients at the centre of the layers
320  ! aknew,bknew model discretization coeffizients at the interpolated levels
321
322
323
324  ! Fixed fields, unchangeable with time
325  !*************************************
326
327  real :: oro(0:nxmax-1,0:nymax-1)
328  real :: excessoro(0:nxmax-1,0:nymax-1)
329  real :: lsm(0:nxmax-1,0:nymax-1)
330  real :: xlanduse(0:nxmax-1,0:nymax-1,numclass)
331
332  ! oro [m]              orography of the ECMWF model
333  ! excessoro            excess orography mother domain
334  ! lsm                  land sea mask of the ECMWF model
335  ! xlanduse [0-1]       area fractions in percent
336
337  ! 3d fields
338  !**********
339
340  real :: uu(0:nxmax-1,0:nymax-1,nzmax,numwfmem)
341  real :: vv(0:nxmax-1,0:nymax-1,nzmax,numwfmem)
342  real :: uupol(0:nxmax-1,0:nymax-1,nzmax,numwfmem)
343  real :: vvpol(0:nxmax-1,0:nymax-1,nzmax,numwfmem)
344  real :: ww(0:nxmax-1,0:nymax-1,nzmax,numwfmem)
345  real :: tt(0:nxmax-1,0:nymax-1,nzmax,numwfmem)
346  real :: qv(0:nxmax-1,0:nymax-1,nzmax,numwfmem)
347!hg adding cloud water
348  real :: clwc(0:nxmax-1,0:nymax-1,nzmax,numwfmem)
349  real :: ciwc(0:nxmax-1,0:nymax-1,nzmax,numwfmem)
350  real :: pv(0:nxmax-1,0:nymax-1,nzmax,numwfmem)
351  real :: rho(0:nxmax-1,0:nymax-1,nzmax,numwfmem)
352  real :: drhodz(0:nxmax-1,0:nymax-1,nzmax,numwfmem)
353  real :: tth(0:nxmax-1,0:nymax-1,nuvzmax,numwfmem)
354  real :: qvh(0:nxmax-1,0:nymax-1,nuvzmax,numwfmem)
355  real :: clwch(0:nxmax-1,0:nymax-1,nuvzmax,numwfmem)
356  real :: ciwch(0:nxmax-1,0:nymax-1,nuvzmax,numwfmem)
357
358  real :: pplev(0:nxmax-1,0:nymax-1,nuvzmax,numwfmem)
359  !scavenging NIK, PS
360  integer(kind=1) :: clouds(0:nxmax-1,0:nymax-1,nzmax,numwfmem)
361  integer :: cloudsh(0:nxmax-1,0:nymax-1,numwfmem)
362  ! integer :: icloudbot(0:nxmax-1,0:nymax-1,numwfmem)
363  ! integer :: icloudthck(0:nxmax-1,0:nymax-1,numwfmem)
364
365
366  ! uu,vv,ww [m/2]       wind components in x,y and z direction
367  ! uupol,vvpol [m/s]    wind components in polar stereographic projection
368  ! tt [K]               temperature data
369  ! qv                   specific humidity data
370  ! pv (pvu)             potential vorticity
371  ! rho [kg/m3]          air density
372  ! drhodz [kg/m2]       vertical air density gradient
373  ! tth,qvh              tth,qvh on original eta levels
374  ! clouds:   no cloud, no precipitation   0
375  !      cloud, no precipitation      1
376  !      rainout  conv/lsp dominated  2/3
377  !      washout  conv/lsp dominated  4/5
378  ! PS 2013
379  !c icloudbot (m)        cloud bottom height
380  !c icloudthck (m)       cloud thickness     
381
382  ! pplev for the GFS version
383
384  ! 2d fields
385  !**********
386
387  real :: ps(0:nxmax-1,0:nymax-1,1,numwfmem)
388  real :: sd(0:nxmax-1,0:nymax-1,1,numwfmem)
389  real :: msl(0:nxmax-1,0:nymax-1,1,numwfmem)
390  real :: tcc(0:nxmax-1,0:nymax-1,1,numwfmem)
391  real :: u10(0:nxmax-1,0:nymax-1,1,numwfmem)
392  real :: v10(0:nxmax-1,0:nymax-1,1,numwfmem)
393  real :: tt2(0:nxmax-1,0:nymax-1,1,numwfmem)
394  real :: td2(0:nxmax-1,0:nymax-1,1,numwfmem)
395  real :: lsprec(0:nxmax-1,0:nymax-1,1,numwfmem)
396  real :: convprec(0:nxmax-1,0:nymax-1,1,numwfmem)
397  real :: sshf(0:nxmax-1,0:nymax-1,1,numwfmem)
398  real :: ssr(0:nxmax-1,0:nymax-1,1,numwfmem)
399  real :: surfstr(0:nxmax-1,0:nymax-1,1,numwfmem)
400  real :: ustar(0:nxmax-1,0:nymax-1,1,numwfmem)
401  real :: wstar(0:nxmax-1,0:nymax-1,1,numwfmem)
402  real :: hmix(0:nxmax-1,0:nymax-1,1,numwfmem)
403  real :: tropopause(0:nxmax-1,0:nymax-1,1,numwfmem)
404  real :: oli(0:nxmax-1,0:nymax-1,1,numwfmem)
405! real :: diffk(0:nxmax-1,0:nymax-1,1,numwfmem) this is not in use?
406
407  ! ps                   surface pressure
408  ! sd                   snow depth
409  ! msl                  mean sea level pressure
410  ! tcc                  total cloud cover
411  ! u10                  10 meter u
412  ! v10                  10 meter v
413  ! tt2                  2 meter temperature
414  ! td2                  2 meter dew point
415  ! lsprec [mm/h]        large scale total precipitation
416  ! convprec [mm/h]      convective precipitation
417  ! sshf                 surface sensible heat flux
418  ! ssr                  surface solar radiation
419  ! surfstr              surface stress
420  ! ustar [m/s]          friction velocity
421  ! wstar [m/s]          convective velocity scale
422  ! hmix  [m]            mixing height
423  ! tropopause [m]       altitude of thermal tropopause
424  ! oli [m]              inverse Obukhov length (1/L)
425  ! diffk [m2/s]         diffusion coefficient at reference height
426
427
428  real :: vdep(0:nxmax-1,0:nymax-1,maxspec,numwfmem)
429
430  ! vdep [m/s]           deposition velocities
431
432
433  !********************************************************************
434  ! Variables associated with the ECMWF input data (nested wind fields)
435  !********************************************************************
436
437  ! NOTE: all nested variables have the same name as the variables used
438  ! for the mother domain, except with a 'n' appended at the end
439  !********************************************************************
440
441  integer :: numbnests
442
443  ! numbnests    number of nested grids
444
445  character(len=255) :: wfnamen(maxnests,maxwf)
446  character(len=18) :: wfspecn(maxnests,maxwf)
447
448  ! wfnamen      nested wind field names
449  ! wfspecn      specifications of wind field file, e.g. if on hard
450  !         disc or on tape
451
452
453  !*********************************************************************
454  ! Variables characterizing size and location of the nested wind fields
455  !*********************************************************************
456
457  integer :: nxn(maxnests),nyn(maxnests)
458  real :: dxn(maxnests),dyn(maxnests),xlon0n(maxnests),ylat0n(maxnests)
459
460  ! nxn,nyn      actual dimensions of nested wind fields in x and y direction
461  ! dxn,dyn      grid distances in x,y direction for the nested grids
462  ! xlon0n       geographical longitude of lower left grid point of nested wind fields
463  ! ylat0n       geographical latitude of lower left grid point of nested wind fields
464
465
466  ! Nested fields, unchangeable with time
467  !**************************************
468
469  real :: oron(0:nxmaxn-1,0:nymaxn-1,maxnests)
470  real :: excessoron(0:nxmaxn-1,0:nymaxn-1,maxnests)
471  real :: lsmn(0:nxmaxn-1,0:nymaxn-1,maxnests)
472  real :: xlandusen(0:nxmaxn-1,0:nymaxn-1,numclass,maxnests)
473
474
475  ! 3d nested fields
476  !*****************
477
478  real :: uun(0:nxmaxn-1,0:nymaxn-1,nzmax,numwfmem,maxnests)
479  real :: vvn(0:nxmaxn-1,0:nymaxn-1,nzmax,numwfmem,maxnests)
480  real :: wwn(0:nxmaxn-1,0:nymaxn-1,nzmax,numwfmem,maxnests)
481  real :: ttn(0:nxmaxn-1,0:nymaxn-1,nzmax,numwfmem,maxnests)
482  real :: qvn(0:nxmaxn-1,0:nymaxn-1,nzmax,numwfmem,maxnests)
483  real :: pvn(0:nxmaxn-1,0:nymaxn-1,nzmax,numwfmem,maxnests)
484  integer(kind=1) :: cloudsn(0:nxmaxn-1,0:nymaxn-1,0:nzmax,numwfmem,maxnests)
485  integer :: cloudsnh(0:nxmaxn-1,0:nymaxn-1,numwfmem,maxnests)
486  real :: rhon(0:nxmaxn-1,0:nymaxn-1,nzmax,numwfmem,maxnests)
487  real :: drhodzn(0:nxmaxn-1,0:nymaxn-1,nzmax,numwfmem,maxnests)
488  real :: tthn(0:nxmaxn-1,0:nymaxn-1,nuvzmax,numwfmem,maxnests)
489  real :: qvhn(0:nxmaxn-1,0:nymaxn-1,nuvzmax,numwfmem,maxnests)
490
491  ! 2d nested fields
492  !*****************
493
494  real :: psn(0:nxmaxn-1,0:nymaxn-1,1,numwfmem,maxnests)
495  real :: sdn(0:nxmaxn-1,0:nymaxn-1,1,numwfmem,maxnests)
496  real :: msln(0:nxmaxn-1,0:nymaxn-1,1,numwfmem,maxnests)
497  real :: tccn(0:nxmaxn-1,0:nymaxn-1,1,numwfmem,maxnests)
498  real :: u10n(0:nxmaxn-1,0:nymaxn-1,1,numwfmem,maxnests)
499  real :: v10n(0:nxmaxn-1,0:nymaxn-1,1,numwfmem,maxnests)
500  real :: tt2n(0:nxmaxn-1,0:nymaxn-1,1,numwfmem,maxnests)
501  real :: td2n(0:nxmaxn-1,0:nymaxn-1,1,numwfmem,maxnests)
502  real :: lsprecn(0:nxmaxn-1,0:nymaxn-1,1,numwfmem,maxnests)
503  real :: convprecn(0:nxmaxn-1,0:nymaxn-1,1,numwfmem,maxnests)
504  real :: sshfn(0:nxmaxn-1,0:nymaxn-1,1,numwfmem,maxnests)
505  real :: ssrn(0:nxmaxn-1,0:nymaxn-1,1,numwfmem,maxnests)
506  real :: surfstrn(0:nxmaxn-1,0:nymaxn-1,1,numwfmem,maxnests)
507  real :: ustarn(0:nxmaxn-1,0:nymaxn-1,1,numwfmem,maxnests)
508  real :: wstarn(0:nxmaxn-1,0:nymaxn-1,1,numwfmem,maxnests)
509  real :: hmixn(0:nxmaxn-1,0:nymaxn-1,1,numwfmem,maxnests)
510  real :: tropopausen(0:nxmaxn-1,0:nymaxn-1,1,numwfmem,maxnests)
511  real :: olin(0:nxmaxn-1,0:nymaxn-1,1,numwfmem,maxnests)
512  ! real :: diffkn(0:nxmaxn-1,0:nymaxn-1,1,numwfmem,maxnests) ! not in use?
513  real :: vdepn(0:nxmaxn-1,0:nymaxn-1,maxspec,numwfmem,maxnests)
514
515
516  !*************************************************
517  ! Certain auxiliary variables needed for the nests
518  !*************************************************
519
520  real :: xresoln(0:maxnests),yresoln(0:maxnests)
521
522  ! xresoln, yresoln   Factors by which the resolutions in the nests
523  !               are enhanced compared to mother grid
524
525  real :: xln(maxnests),yln(maxnests),xrn(maxnests),yrn(maxnests)
526
527  ! xln,yln,xrn,yrn    Corner points of nested grids in grid coordinates
528  !               of mother grid
529
530
531  !******************************************************
532  ! Variables defining the polar stereographic projection
533  !******************************************************
534
535  logical :: xglobal,sglobal,nglobal
536  real :: switchnorthg,switchsouthg
537
538  !xglobal             T for global fields, F for limited area fields
539  !sglobal             T if domain extends towards south pole
540  !nglobal             T if domain extends towards north pole
541  !switchnorthg,switchsouthg   same as parameters switchnorth,
542  !                    switchsouth, but in grid units
543
544  real :: southpolemap(9),northpolemap(9)
545
546  !southpolemap,northpolemap   define stereographic projections
547  !                    at the two poles
548
549
550  !******************
551  ! Landuse inventory
552  ! Sabine Eckhardt Dec 06: change to new landuse inventary - 11 classes, 1200 x 600 global
553  !******************
554
555  integer(kind=1) :: landinvent(1200,600,6)
556  real :: z0(numclass)
557
558  ! landinvent         landuse inventory (numclass=11 classes)
559  ! z0                  roughness length for the landuse classes
560
561
562
563  !**************************************************************************
564  ! Variables characterizing the output grid and containing the model results
565  !**************************************************************************
566
567  integer :: numxgrid,numygrid,numzgrid
568  real :: dxout,dyout,outlon0,outlat0,xoutshift,youtshift
569  integer :: numxgridn,numygridn
570  real :: dxoutn,dyoutn,outlon0n,outlat0n,xoutshiftn,youtshiftn
571  !real outheight(maxzgrid),outheighthalf(maxzgrid)
572  logical :: DEP,DRYDEP,DRYDEPSPEC(maxspec),WETDEP,OHREA,ASSSPEC
573
574  ! numxgrid,numygrid       number of grid points in x,y-direction
575  ! numxgridn,numygridn     number of grid points in x,y-direction for nested output grid
576  ! numzgrid                number of vertical levels of output grid
577  ! dxout,dyout             grid distance of output grid
578  ! dxoutn,dyoutn           grid distance of nested output grid
579  ! outlon0,outlat0         lower left corner of output grid
580  ! outlon0n,outlat0n       lower left corner of nested output grid
581  ! xoutshift,youtshift     xlon0-outlon0, ylat0-outlat0
582  ! xoutshiftn,youtshiftn   xlon0-outlon0n, ylat0-outlat0n
583  ! outheight [m]           upper levels of the output grid
584  ! outheighthalf [m]       half (middle) levels of the output grid cells
585  ! DEP                     .true., if either dry or wet depos. is switched on
586  ! DRYDEP                  .true., if dry deposition is switched on
587  ! DRYDEPSPEC              .true., if dry deposition is switched on for that species
588  ! WETDEP                  .true., if wet deposition is switched on
589  ! OHREA                   .true., if OH reaction is switched on
590  ! ASSSPEC                 .true., if there are two species asscoiated
591  !                    (i.e. transfer of mass between these two occurs
592
593
594
595  !  if output for each releasepoint shall be created maxpointspec=number of releasepoints
596  !  else maxpointspec is 1 -> moved to unc_mod
597  !  the OUTGRID is moved to the module outg_mod
598  !******************************************************************************
599
600  !real gridunc(0:maxxgrid-1,0:maxygrid-1,maxzgrid,maxspec,
601  !    +             maxpointspec_act,nclassunc,maxageclass)
602  !real griduncn(0:maxxgridn-1,0:maxygridn-1,maxzgrid,maxspec,
603  !    +              maxpointspec_act,nclassunc,maxageclass)
604  !real wetgridunc(0:maxxgrid-1,0:maxygrid-1,maxspec,
605  !    +                maxpointspec_act,nclassunc,maxageclass)
606  !real wetgriduncn(0:maxxgridn-1,0:maxygridn-1,maxspec,
607  !    +ct                 maxpointspec,nclassunc,maxageclass)
608  !real drygridunc(0:maxxgrid-1,0:maxygrid-1,maxspec,maxpointspec,
609  !    +                nclassunc,maxageclass)
610  !real drygriduncn(0:maxxgridn-1,0:maxygridn-1,maxspec,
611  !    +                 maxpointspec,nclassunc,maxageclass)
612
613  !real oroout(0:maxxgrid-1,0:maxygrid-1)
614  !real orooutn(0:maxxgridn-1,0:maxygridn-1)
615  !     real area(0:maxxgrid-1,0:maxygrid-1)
616  !real arean(0:maxxgridn-1,0:maxygridn-1)
617  !real volume(0:maxxgrid-1,0:maxygrid-1,maxzgrid)
618  !real volumen(0:maxxgridn-1,0:maxygridn-1,maxzgrid)
619
620  !real areaeast(0:maxxgrid-1,0:maxygrid-1,maxzgrid)
621  !real areanorth(0:maxxgrid-1,0:maxygrid-1,maxzgrid)
622
623
624  ! gridunc,griduncn        uncertainty of outputted concentrations
625  ! wetgridunc,wetgriduncn  uncertainty of accumulated wet deposited mass on output grid
626  ! drygridunc,drygriduncn  uncertainty of accumulated dry deposited mass on output grid
627  ! oroout,orooutn [m]      height of model topography at output grid
628  ! area,arean [m2]         area of each grid cell
629  ! volume,volumen [m3]     volume of each grid cell
630  ! ... field names with n at the end indicate a nested output grid
631
632
633  !***********************************
634  ! Variables defining receptor points
635  !***********************************
636
637  real :: xreceptor(maxreceptor),yreceptor(maxreceptor)
638  real :: receptorarea(maxreceptor)
639  real :: creceptor(maxreceptor,maxspec)
640  character(len=16) :: receptorname(maxreceptor)
641  integer :: numreceptor
642
643  ! xreceptor,yreceptor     receptor position
644  ! creceptor               concentrations at receptor points
645  ! receptorarea            area of 1*1 grid cell at receptor point
646
647
648
649  !***************************************
650  ! Variables characterizing each particle
651  !***************************************
652
653  integer :: numpart=0
654  integer :: numparticlecount
655
656  integer, allocatable, dimension(:) :: itra1, npoint, nclass, idt, itramem, itrasplit
657
658  real(kind=dp), allocatable, dimension(:) :: xtra1, ytra1
659  real, allocatable, dimension(:) :: ztra1
660  real, allocatable, dimension(:,:) :: xmass1
661
662  ! eso: Moved from timemanager
663  real, allocatable, dimension(:) :: uap,ucp,uzp,us,vs,ws
664  integer(kind=2), allocatable, dimension(:) :: cbt
665
666
667  ! numpart                 actual number of particles in memory
668  ! itra1 (maxpart) [s]     temporal positions of the particles
669  ! npoint(maxpart)         indicates the release point of each particle
670  ! nclass (maxpart)        one of nclassunc classes to which the particle is attributed
671  ! itramem (maxpart) [s]   memorized release times of the particles
672  ! itrasplit (maxpart) [s] next time when particle is to be split into two
673  ! idt(maxpart) [s]        time step to be used for next integration
674  ! numparticlecount        counts the total number of particles that have been released
675  ! xtra1,ytra1,ztra1       spatial positions of the particles
676  ! xmass1 [kg]             particle masses
677 
678
679
680  !*******************************************************
681  ! Info table on available chemical species/radionuclides
682  !*******************************************************
683
684  !character*10 specname(maxtable)
685  !real decaytime(maxtable),wetscava(maxtable),wetscavb(maxtable)
686  !real drydiff(maxtable),dryhenry(maxtable),dryactiv(maxtable)
687  !real partrho(maxtable),partmean(maxtable),partsig(maxtable)
688  !real dryvelo(maxtable),weightmol(maxtable),ohreact(maxtable)
689
690  ! specname            Name of chemical species/radionuclide
691  ! decaytime           Half time of radionuclides
692  ! wetscava, wetscavb  Parameters for calculating scavenging coefficients
693  ! drydiff             diffusivitiy of species relative to diff. of H2O
694  ! dryhenry [M/atm]    Henry constant
695  ! dryactiv            reactivity relative to that of O3
696  ! partrho [kg/m3]     density of particles
697  ! partmean [m]        mean diameter of particles
698  ! partsig [m]         mean stand. deviation of particle diameter
699  ! dryvelo [cm/s]      constant dry deposition velocity
700  ! weightmol [g/mol]   molecular weight
701  ! ohreact             OH reaction rate
702
703
704  !********************
705  ! Random number field
706  !********************
707
708  real :: rannumb(maxrand)
709
710  ! rannumb                 field of normally distributed random numbers
711 
712  !********************************************************************
713  ! variables to control stability of CBL scheme under variation
714  ! of statistics in time and space
715  !********************************************************************
716  integer :: nan_count,nan_count2,sum_nan_count(3600),maxtl=1200
717  !added by mc , note that for safety sum_nan_count(N) with N>maxtl
718
719  !********************************************************************
720  ! variables to test well-mixed state of CBL scheme not to be included in final release
721  !********************************************************************
722  real :: well_mixed_vector(50),h_well,well_mixed_norm,avg_air_dens(50),avg_ol,avg_wst,avg_h
723  ! modified by mc to test well-mixed for cbl
724
725  !********************
726  ! Verbosity, testing flags, namelist I/O
727  !********************   
728  integer :: verbosity=0
729  integer :: info_flag=0
730  integer :: count_clock, count_clock0,  count_rate, count_max
731  real    :: tins
732  logical, parameter :: nmlout=.false.
733
734  ! These variables are used to avoid having separate versions of
735  ! files in cases where differences with MPI version is minor (eso)
736  !*****************************************************************
737  integer :: mpi_mode=0 ! .gt. 0 if running MPI version
738  logical :: lroot=.true. ! true if serial version, or if MPI and root process
739
740  contains
741      subroutine com_mod_allocate(nmpart)
742!*******************************************************************************   
743! Dynamic allocation of arrays
744!
745!*******************************************************************************
746    implicit none
747
748    integer, intent(in) :: nmpart
749   
750! Arrays previously static of size maxpart
751    allocate(itra1(nmpart),npoint(nmpart),nclass(nmpart),&
752         & idt(nmpart),itramem(nmpart),itrasplit(nmpart),&
753         & xtra1(nmpart),ytra1(nmpart),ztra1(nmpart),&
754         & xmass1(nmpart, maxspec))
755
756    allocate(uap(nmpart),ucp(nmpart),uzp(nmpart),us(nmpart),&
757         & vs(nmpart),ws(nmpart),cbt(nmpart))
758   
759!    allocate(memind(
760
761  end subroutine com_mod_allocate
762   
763
764end module com_mod
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG