source: branches/jerome/src_flexwrf_v3.1/com_mod.f90 @ 16

Last change on this file since 16 was 16, checked in by jebri, 11 years ago

sources for flexwrf v3.1

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