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