Skip to content
Snippets Groups Projects
Commit 1b3c86a7 authored by Harald Sodemann's avatar Harald Sodemann
Browse files

Initial import

- namelist input for COMMAND
- pathnames optionally as command line argument
- conversion utility from COMMAND to COMMAND namelist


git-svn-id: http://flexpart.flexpart.eu:8088/svn/FlexPart90/branches/command2nml@7 ef8cc7e1-21b7-489e-abab-c1baa636049d
parents
Branches
Tags
No related merge requests found
COMMAND 0 → 100644
**********************************************
COMMAND Input file for FLEXPART RDF
RDF releases
*********************************************
1
20121001 000000
20121004 120000
10800 tout
10800 tavg
600
999999999
600 SYNC
5.0 CTL
4 IFINE
5 IOUT
2 IPOUT
1 LSUBGRID
1 LCONVECTION
1 LAGESPECTRA
0 IPIN
0 OUTPUTFOREACHRELEASE
0 IFLUX
0 MDOMAINFILL
1 IND_SOURCE
1 IND_RECEPTOR
0 MQUASILAG
0 NESTED_OUTPUT
0 LINIT_COND
&COMMAND
LDIRECT= 1,
IBDATE= 20121001,
IBTIME= 0,
IEDATE= 20121004,
IETIME= 120000,
LOUTSTEP= 10800,
LOUTAVER= 10800,
LOUTSAMPLE= 600,
ITSPLIT= 999999999,
LSYNCTIME= 600,
CTL= 5.0000000 ,
IFINE= 4,
IOUT= 5,
IPOUT= 2,
LSUBGRID= 1,
LCONVECTION= 1,
LAGESPECTRA= 1,
IPIN= 0,
IOUTPUTFOREACHRELEASE= 0,
IFLUX= 0,
MDOMAINFILL= 0,
IND_SOURCE= 1,
IND_RECEPTOR= 1,
MQUASILAG= 0,
NESTED_OUTPUT= 0,
LINIT_COND= 0,
/
Makefile 0 → 100644
SHELL = /bin/bash
MAIN = command2nml
#
FC = gfortran
LIBPATH2 = /usr/local/lib
FFLAGS = -O3 -m64
LDFLAGS = $(FFLAGS) -L$(LIBPATH2) -lm
#
MODOBJS = \
par_mod.o com_mod.o
OBJECTS = \
skplin.o command2nml.o
$(MAIN): $(MODOBJS) $(OBJECTS)
$(FC) *.o -o $(MAIN) $(LDFLAGS)
$(OBJECTS): $(MODOBJS)
%.o: %.f90
$(FC) -c $(FFLAGS) $<
clean:
rm *.o *.mod
README 0 → 100644
command2nml
---------------------
Converts FLEXPART COMMAND files in pre-9.1 version to namelist format
Call sequence:
command2nml COMMAND_old COMMAND_new
HS, 14.05.2013
!*******************************************************************************
! Include file for particle diffusion model FLEXPART *
! This file contains a global common block used by FLEXPART *
! *
! Author: A. Stohl *
! *
! June 1996 *
! *
! Last update: 9 August 2000 *
! *
!*******************************************************************************
module com_mod
use par_mod, only: dp, numpath, maxnests, maxageclass, maxspec, ni, &
numclass, nymax, nxmax, maxcolumn, maxwf, nzmax, nxmaxn, nymaxn, &
maxreceptor, maxpart, maxrand, nwzmax, nuvzmax
implicit none
!****************************************************************
! Variables defining where FLEXPART input/output files are stored
!****************************************************************
character :: path(numpath+2*maxnests)*120
integer :: length(numpath+2*maxnests)
! path path names needed for trajectory model
! length length of path names needed for trajectory model
!********************************************************
! Variables defining the general model run specifications
!********************************************************
integer :: ibdate,ibtime,iedate,ietime
real(kind=dp) :: bdate,edate
! ibdate beginning date (YYYYMMDD)
! ibtime beginning time (HHMISS)
! iedate ending date (YYYYMMDD)
! ietime ending time (HHMISS)
! bdate beginning date of simulation (julian date)
! edate ending date of simulation (julian date)
integer :: ldirect,ideltas
! ldirect 1 for forward, -1 for backward simulation
! ideltas length of trajectory loop from beginning to
! ending date (s)
integer :: loutstep,loutaver,loutsample,method,lsynctime
real :: outstep
! loutstep [s] gridded concentration output every loutstep seconds
! loutaver [s] concentration output is an average over [s] seconds
! loutsample [s] sampling interval of gridded concentration output
! lsynctime [s] synchronisation time of all particles
! method indicator which dispersion method is to be used
! outstep = real(abs(loutstep))
real :: ctl,fine
integer :: ifine,iout,ipout,ipin,iflux,mdomainfill
integer :: mquasilag,nested_output,ind_source,ind_receptor
integer :: ind_rel,ind_samp,ioutputforeachrelease,linit_cond
logical :: turbswitch
! ctl factor, by which time step must be smaller than Lagrangian time scale
! ifine reduction factor for time step used for vertical wind
! Langevin equation for the vertical wind component
! ioutputforeachrelease Should each release be a seperate output field?
! iflux flux calculation options: 1 calculation of fluxes, 2 no fluxes
! iout output options: 1 conc. output (ng/m3), 2 mixing ratio (pptv), 3 both
! ipout particle dump options: 0 no, 1 every output interval, 2 only at end
! ipin read in particle positions from dumped file from a previous run
! fine real(ifine)
! mdomainfill 0: normal run
! 1: particles are initialized according to atmospheric mass distribution
! ind_source switches between different units for concentrations at the source
! NOTE that in backward simulations the release of computational particles
! takes place at the "receptor" and the sampling of particles at the "source".
! 1= mass units
! 2= mass mixing ratio units
! ind_receptor switches between different units for FLEXPART concentration at the receptor
! 1= mass units
! 2= mass mixing ratio units
! linit_cond switch on the output of sensitivity to initial conditions for backward runs
! 0=no, 1=mass unit, 2=mass mixing ratio unit
! mquasilag 0: normal run
! 1: Particle position output is produced in a condensed format and particles are numbered
! nested_output: 0 no, 1 yes
! turbswitch determines how the Markov chain is formulated
! ind_rel and ind_samp are used within the code to change between mass and mass-mix (see readcommand.f)
integer :: mintime,itsplit
! mintime minimum time step to be used by FLEXPART
! itsplit time constant for splitting particles
integer :: lsubgrid,lconvection,lagespectra
! lsubgrid 1 if subgrid topography parameterization switched on, 2 if not
! lconvection 1 if convection parameterization switched on, 0 if not
! lagespectra 1 if age spectra calculation switched on, 2 if not
integer :: nageclass,lage(maxageclass)
! nageclass number of ageclasses for the age spectra calculation
! lage [s] ageclasses for the age spectra calculation
logical :: gdomainfill
! gdomainfill .T., if domain-filling is global, .F. if not
!*********************************************************************
! Variables defining the release locations, released species and their
! properties, etc.
!*********************************************************************
!change Sabine Eckhardt, only save the first 1000 identifier for releasepoints
character :: compoint(1001)*45
integer :: numpoint
!sec, now dynamically allocated:
! ireleasestart(maxpoint),ireleaseend(maxpoint)
! real xpoint1(maxpoint),ypoint1(maxpoint)
!real xpoint2(maxpoint),ypoint2(maxpoint)
!real zpoint1(maxpoint),zpoint2(maxpoint)
!integer*2 kindz(maxpoint)
integer :: specnum(maxspec)
!real xmass(maxpoint,maxspec)
real :: decay(maxspec)
real :: weta(maxspec),wetb(maxspec)
real :: reldiff(maxspec),henry(maxspec),f0(maxspec)
real :: density(maxspec),dquer(maxspec),dsigma(maxspec)
real :: vsetaver(maxspec),cunningham(maxspec),weightmolar(maxspec)
real :: vset(maxspec,ni),schmi(maxspec,ni),fract(maxspec,ni)
real :: ri(5,numclass),rac(5,numclass),rcl(maxspec,5,numclass)
real :: rgs(maxspec,5,numclass),rlu(maxspec,5,numclass)
real :: rm(maxspec),dryvel(maxspec),kao(maxspec),ohreact(maxspec)
! se it is possible to associate a species with a second one to make transfer from gas to aerosol
integer :: spec_ass(maxspec)
real :: area_hour(maxspec,24),point_hour(maxspec,24)
real :: area_dow(maxspec,7),point_dow(maxspec,7)
!integer npart(maxpoint)
integer :: nspec,maxpointspec_act
character(len=10) :: species(maxspec)
! compoint comment, also "name" of each starting point
! numpoint actual number of trajectory starting/ending points
! ireleasestart,ireleaseend [s] starting and ending time of each release
! xmass total mass emitted
! xpoint1,ypoint1 lower left coordinates of release area
! xpoint2,ypoint2 upper right coordinates of release area
! zpoint1,zpoint2 min./max. z-coordinates of release points
! kindz 1: zpoint is in m agl, 2: zpoint is in m asl
! npart number of particles per release point
! nspec number of different species allowed for one release
! maxpointspec_act number of releaspoints for which a different output shall be created
! species name of species
! decay decay constant of radionuclide
! WET DEPOSITION
! weta, wetb parameters for determining wet scavenging coefficients
! GAS DEPOSITION
! reldiff diffusivitiy of species relative to diff. of H2O
! henry [M/atm] Henry constant
! f0 reactivity relative to that of O3
! ri [s/m] stomatal resistance
! rcl [s/m] lower canopy resistance
! rgs [s/m] ground resistance
! rlu [s/m] leaf cuticular resistance
! rm [s/m] mesophyll resistance
! dryvel [m/s] constant dry deposition velocity
! PARTICLE DEPOSITION
! density [kg/m3] density of particles
! dquer [m] mean diameter of particles
! dsigma dsigma=10 or dsigma=0.1 means that 68% of the
! mass are between 0.1*dquer and 10*dquer
! fract mass fraction of each diameter interval
! vset [m/s] gravitational settling velocity in ni intervals
! cunningham Cunningham slip correction (strictly valid only near surface)
! vsetaver [m/s] average gravitational settling velocity
! schmi Schmidt number**2/3 of each diameter interval
! weightmolar [g/mol] molecular weight
! TIME VARIATION OF EMISSION
! area_hour, point_hour daily variation of emission strengths for area and point sources
! area_dow, point_dow day-of-week variation of emission strengths for area and point sources
!**********************************************************
! Variables used for domain-filling trajectory calculations
!**********************************************************
integer :: nx_we(2),ny_sn(2)
integer :: numcolumn
integer :: numcolumn_we(2,0:nymax-1),numcolumn_sn(2,0:nxmax-1)
real :: zcolumn_we(2,0:nymax-1,maxcolumn)
real :: zcolumn_sn(2,0:nxmax-1,maxcolumn)
real :: xmassperparticle
real :: acc_mass_we(2,0:nymax-1,maxcolumn)
real :: acc_mass_sn(2,0:nxmax-1,maxcolumn)
! nx_we(2) x indices of western and eastern boundary of domain-filling
! ny_sn(2) y indices of southern and northern boundary of domain-filling
! numcolumn_we number of particles to be released within one column
! at the western and eastern boundary surfaces
! numcolumn_sn same as numcolumn_we, but for southern and northern domain boundary
! numcolumn maximum number of particles to be released within a single
! column
! zcolumn_we altitudes where particles are to be released
! at the western and eastern boundary surfaces
! zcolumn_sn same as zcolumn_we, but for southern and northern domain boundary
! xmassperparticle air mass per particle in the domain-filling traj. option
! acc_mass_we mass that has accumulated at the western and eastern boundary;
! if it exceeds xmassperparticle, a particle is released and
! acc_mass_we is reduced accordingly
! acc_mass_sn same as acc_mass_we, but for southern and northern domain boundary
!******************************************************************************
! Variables associated with the ECMWF meteorological input data ("wind fields")
!******************************************************************************
integer :: numbwf,wftime(maxwf),lwindinterv
character(len=255) :: wfname(maxwf),wfspec(maxwf)
! lwindinterv [s] Interval between wind fields currently in memory
! numbwf actual number of wind fields
! wftime(maxwf) [s] times relative to beginning time of wind fields
! wfname(maxwf) file names of wind fields
! wfspec(maxwf) specifications of wind field file, e.g. if on hard
! disc or on tape
integer :: memtime(2),memind(2)
! memtime [s] validation times of wind fields in memory
! memind pointer to wind field, in order to avoid shuffling
! of wind fields
!****************************************************************************
! Variables defining actual size and geographical location of the wind fields
!****************************************************************************
integer :: nx,ny,nxmin1,nymin1,nxfield,nuvz,nwz,nz,nmixz,nlev_ec
real :: dx,dy,xlon0,ylat0,dxconst,dyconst,height(nzmax)
! nx,ny,nz actual dimensions of wind fields in x,y and z
! direction, respectively
! nxmin1,nymin1 nx-1, ny-1, respectively
! nuvz,nwz vertical dimension of original ECMWF data
! nxfield same as nx for limited area fields,
! but for global fields nx=nxfield+1
! nmixz number of levels up to maximum PBL height (3500 m)
! nuvz is used for u,v components
! nwz is used for w components (staggered grid)
! nz is used for the levels in transformed coordinates (terrain-following Cartesian
! coordinates)
! nlev_ec number of levels ECMWF model
! dx grid distance in x direction
! dy grid distance in y direction
! dxconst,dyconst auxiliary variables for utransform,vtransform
! height heights of all levels
! xlon0 geographical longitude and
! ylat0 geographical latitude of lower left grid point
!*************************************************
! Variables used for vertical model discretization
!*************************************************
real :: akm(nwzmax),bkm(nwzmax)
real :: akz(nuvzmax),bkz(nuvzmax)
real :: aknew(nzmax),bknew(nzmax)
! akm,bkm: coeffizients which regulate vertical discretization of ecmwf model
! (at the border of model layers)
! akz,bkz: model discretization coeffizients at the centre of the layers
! aknew,bknew model discretization coeffizients at the interpolated levels
! Fixed fields, unchangeable with time
!*************************************
real :: oro(0:nxmax-1,0:nymax-1)
real :: excessoro(0:nxmax-1,0:nymax-1)
real :: lsm(0:nxmax-1,0:nymax-1)
real :: xlanduse(0:nxmax-1,0:nymax-1,numclass)
! oro [m] orography of the ECMWF model
! excessoro excess orography mother domain
! lsm land sea mask of the ECMWF model
! xlanduse [0-1] area fractions in percent
! 3d fields
!**********
real :: uu(0:nxmax-1,0:nymax-1,nzmax,2)
real :: vv(0:nxmax-1,0:nymax-1,nzmax,2)
real :: uupol(0:nxmax-1,0:nymax-1,nzmax,2)
real :: vvpol(0:nxmax-1,0:nymax-1,nzmax,2)
real :: ww(0:nxmax-1,0:nymax-1,nzmax,2)
real :: tt(0:nxmax-1,0:nymax-1,nzmax,2)
real :: qv(0:nxmax-1,0:nymax-1,nzmax,2)
real :: pv(0:nxmax-1,0:nymax-1,nzmax,2)
real :: rho(0:nxmax-1,0:nymax-1,nzmax,2)
real :: drhodz(0:nxmax-1,0:nymax-1,nzmax,2)
real :: tth(0:nxmax-1,0:nymax-1,nuvzmax,2)
real :: qvh(0:nxmax-1,0:nymax-1,nuvzmax,2)
real :: pplev(0:nxmax-1,0:nymax-1,nuvzmax,2)
integer(kind=1) :: clouds(0:nxmax-1,0:nymax-1,nzmax,2)
integer :: cloudsh(0:nxmax-1,0:nymax-1,2)
! uu,vv,ww [m/2] wind components in x,y and z direction
! uupol,vvpol [m/s] wind components in polar stereographic projection
! tt [K] temperature data
! qv specific humidity data
! pv (pvu) potential vorticity
! rho [kg/m3] air density
! drhodz [kg/m2] vertical air density gradient
! tth,qvh tth,qvh on original eta levels
! clouds: no cloud, no precipitation 0
! cloud, no precipitation 1
! rainout conv/lsp dominated 2/3
! washout conv/lsp dominated 4/5
! pplev for the GFS version
! 2d fields
!**********
real :: ps(0:nxmax-1,0:nymax-1,1,2)
real :: sd(0:nxmax-1,0:nymax-1,1,2)
real :: msl(0:nxmax-1,0:nymax-1,1,2)
real :: tcc(0:nxmax-1,0:nymax-1,1,2)
real :: u10(0:nxmax-1,0:nymax-1,1,2)
real :: v10(0:nxmax-1,0:nymax-1,1,2)
real :: tt2(0:nxmax-1,0:nymax-1,1,2)
real :: td2(0:nxmax-1,0:nymax-1,1,2)
real :: lsprec(0:nxmax-1,0:nymax-1,1,2)
real :: convprec(0:nxmax-1,0:nymax-1,1,2)
real :: sshf(0:nxmax-1,0:nymax-1,1,2)
real :: ssr(0:nxmax-1,0:nymax-1,1,2)
real :: surfstr(0:nxmax-1,0:nymax-1,1,2)
real :: ustar(0:nxmax-1,0:nymax-1,1,2)
real :: wstar(0:nxmax-1,0:nymax-1,1,2)
real :: hmix(0:nxmax-1,0:nymax-1,1,2)
real :: tropopause(0:nxmax-1,0:nymax-1,1,2)
real :: oli(0:nxmax-1,0:nymax-1,1,2)
real :: diffk(0:nxmax-1,0:nymax-1,1,2)
! ps surface pressure
! sd snow depth
! msl mean sea level pressure
! tcc total cloud cover
! u10 10 meter u
! v10 10 meter v
! tt2 2 meter temperature
! td2 2 meter dew point
! lsprec [mm/h] large scale total precipitation
! convprec [mm/h] convective precipitation
! sshf surface sensible heat flux
! ssr surface solar radiation
! surfstr surface stress
! ustar [m/s] friction velocity
! wstar [m/s] convective velocity scale
! hmix [m] mixing height
! tropopause [m] altitude of thermal tropopause
! oli [m] inverse Obukhov length (1/L)
! diffk [m2/s] diffusion coefficient at reference height
real :: vdep(0:nxmax-1,0:nymax-1,maxspec,2)
! vdep [m/s] deposition velocities
!********************************************************************
! Variables associated with the ECMWF input data (nested wind fields)
!********************************************************************
! NOTE: all nested variables have the same name as the variables used
! for the mother domain, except with a 'n' appended at the end
!********************************************************************
integer :: numbnests
! numbnests number of nested grids
character(len=255) :: wfnamen(maxnests,maxwf)
character(len=18) :: wfspecn(maxnests,maxwf)
! wfnamen nested wind field names
! wfspecn specifications of wind field file, e.g. if on hard
! disc or on tape
!*********************************************************************
! Variables characterizing size and location of the nested wind fields
!*********************************************************************
integer :: nxn(maxnests),nyn(maxnests)
real :: dxn(maxnests),dyn(maxnests),xlon0n(maxnests),ylat0n(maxnests)
! nxn,nyn actual dimensions of nested wind fields in x and y direction
! dxn,dyn grid distances in x,y direction for the nested grids
! xlon0n geographical longitude of lower left grid point of nested wind fields
! ylat0n geographical latitude of lower left grid point of nested wind fields
! Nested fields, unchangeable with time
!**************************************
real :: oron(0:nxmaxn-1,0:nymaxn-1,maxnests)
real :: excessoron(0:nxmaxn-1,0:nymaxn-1,maxnests)
real :: lsmn(0:nxmaxn-1,0:nymaxn-1,maxnests)
real :: xlandusen(0:nxmaxn-1,0:nymaxn-1,numclass,maxnests)
! 3d nested fields
!*****************
real :: uun(0:nxmaxn-1,0:nymaxn-1,nzmax,2,maxnests)
real :: vvn(0:nxmaxn-1,0:nymaxn-1,nzmax,2,maxnests)
real :: wwn(0:nxmaxn-1,0:nymaxn-1,nzmax,2,maxnests)
real :: ttn(0:nxmaxn-1,0:nymaxn-1,nzmax,2,maxnests)
real :: qvn(0:nxmaxn-1,0:nymaxn-1,nzmax,2,maxnests)
real :: pvn(0:nxmaxn-1,0:nymaxn-1,nzmax,2,maxnests)
integer(kind=1) :: cloudsn(0:nxmaxn-1,0:nymaxn-1,0:nzmax,2,maxnests)
integer :: cloudsnh(0:nxmaxn-1,0:nymaxn-1,2,maxnests)
real :: rhon(0:nxmaxn-1,0:nymaxn-1,nzmax,2,maxnests)
real :: drhodzn(0:nxmaxn-1,0:nymaxn-1,nzmax,2,maxnests)
real :: tthn(0:nxmaxn-1,0:nymaxn-1,nuvzmax,2,maxnests)
real :: qvhn(0:nxmaxn-1,0:nymaxn-1,nuvzmax,2,maxnests)
! 2d nested fields
!*****************
real :: psn(0:nxmaxn-1,0:nymaxn-1,1,2,maxnests)
real :: sdn(0:nxmaxn-1,0:nymaxn-1,1,2,maxnests)
real :: msln(0:nxmaxn-1,0:nymaxn-1,1,2,maxnests)
real :: tccn(0:nxmaxn-1,0:nymaxn-1,1,2,maxnests)
real :: u10n(0:nxmaxn-1,0:nymaxn-1,1,2,maxnests)
real :: v10n(0:nxmaxn-1,0:nymaxn-1,1,2,maxnests)
real :: tt2n(0:nxmaxn-1,0:nymaxn-1,1,2,maxnests)
real :: td2n(0:nxmaxn-1,0:nymaxn-1,1,2,maxnests)
real :: lsprecn(0:nxmaxn-1,0:nymaxn-1,1,2,maxnests)
real :: convprecn(0:nxmaxn-1,0:nymaxn-1,1,2,maxnests)
real :: sshfn(0:nxmaxn-1,0:nymaxn-1,1,2,maxnests)
real :: ssrn(0:nxmaxn-1,0:nymaxn-1,1,2,maxnests)
real :: surfstrn(0:nxmaxn-1,0:nymaxn-1,1,2,maxnests)
real :: ustarn(0:nxmaxn-1,0:nymaxn-1,1,2,maxnests)
real :: wstarn(0:nxmaxn-1,0:nymaxn-1,1,2,maxnests)
real :: hmixn(0:nxmaxn-1,0:nymaxn-1,1,2,maxnests)
real :: tropopausen(0:nxmaxn-1,0:nymaxn-1,1,2,maxnests)
real :: olin(0:nxmaxn-1,0:nymaxn-1,1,2,maxnests)
real :: diffkn(0:nxmaxn-1,0:nymaxn-1,1,2,maxnests)
real :: vdepn(0:nxmaxn-1,0:nymaxn-1,maxspec,2,maxnests)
!*************************************************
! Certain auxiliary variables needed for the nests
!*************************************************
real :: xresoln(0:maxnests),yresoln(0:maxnests)
! xresoln, yresoln Factors by which the resolutions in the nests
! are enhanced compared to mother grid
real :: xln(maxnests),yln(maxnests),xrn(maxnests),yrn(maxnests)
! xln,yln,xrn,yrn Corner points of nested grids in grid coordinates
! of mother grid
!******************************************************
! Variables defining the polar stereographic projection
!******************************************************
logical :: xglobal,sglobal,nglobal
real :: switchnorthg,switchsouthg
!xglobal T for global fields, F for limited area fields
!sglobal T if domain extends towards south pole
!nglobal T if domain extends towards north pole
!switchnorthg,switchsouthg same as parameters switchnorth,
! switchsouth, but in grid units
real :: southpolemap(9),northpolemap(9)
!southpolemap,northpolemap define stereographic projections
! at the two poles
!******************
! Landuse inventory
! Sabine Eckhardt Dec 06: change to new landuse inventary - 11 classes, 1200 x 600 global
!******************
integer(kind=1) :: landinvent(1200,600,6)
real :: z0(numclass)
! landinvent landuse inventory (numclass=11 classes)
! z0 roughness length for the landuse classes
!**************************************************************************
! Variables characterizing the output grid and containing the model results
!**************************************************************************
integer :: numxgrid,numygrid,numzgrid
real :: dxout,dyout,outlon0,outlat0,xoutshift,youtshift
integer :: numxgridn,numygridn
real :: dxoutn,dyoutn,outlon0n,outlat0n,xoutshiftn,youtshiftn
!real outheight(maxzgrid),outheighthalf(maxzgrid)
logical :: DEP,DRYDEP,DRYDEPSPEC(maxspec),WETDEP,OHREA,ASSSPEC
! numxgrid,numygrid number of grid points in x,y-direction
! numxgridn,numygridn number of grid points in x,y-direction for nested output grid
! numzgrid number of vertical levels of output grid
! dxout,dyout grid distance of output grid
! dxoutn,dyoutn grid distance of nested output grid
! outlon0,outlat0 lower left corner of output grid
! outlon0n,outlat0n lower left corner of nested output grid
! xoutshift,youtshift xlon0-outlon0, ylat0-outlat0
! xoutshiftn,youtshiftn xlon0-outlon0n, ylat0-outlat0n
! outheight [m] upper levels of the output grid
! outheighthalf [m] half (middle) levels of the output grid cells
! DEP .true., if either dry or wet depos. is switched on
! DRYDEP .true., if dry deposition is switched on
! DRYDEPSPEC .true., if dry deposition is switched on for that species
! WETDEP .true., if wet deposition is switched on
! OHREA .true., if OH reaction is switched on
! ASSSPEC .true., if there are two species asscoiated
! (i.e. transfer of mass between these two occurs
! if output for each releasepoint shall be created maxpointspec=number of releasepoints
! else maxpointspec is 1 -> moved to unc_mod
! the OUTGRID is moved to the module outg_mod
!******************************************************************************
!real gridunc(0:maxxgrid-1,0:maxygrid-1,maxzgrid,maxspec,
! + maxpointspec_act,nclassunc,maxageclass)
!real griduncn(0:maxxgridn-1,0:maxygridn-1,maxzgrid,maxspec,
! + maxpointspec_act,nclassunc,maxageclass)
!real wetgridunc(0:maxxgrid-1,0:maxygrid-1,maxspec,
! + maxpointspec_act,nclassunc,maxageclass)
!real wetgriduncn(0:maxxgridn-1,0:maxygridn-1,maxspec,
! +ct maxpointspec,nclassunc,maxageclass)
!real drygridunc(0:maxxgrid-1,0:maxygrid-1,maxspec,maxpointspec,
! + nclassunc,maxageclass)
!real drygriduncn(0:maxxgridn-1,0:maxygridn-1,maxspec,
! + maxpointspec,nclassunc,maxageclass)
!real oroout(0:maxxgrid-1,0:maxygrid-1)
!real orooutn(0:maxxgridn-1,0:maxygridn-1)
! real area(0:maxxgrid-1,0:maxygrid-1)
!real arean(0:maxxgridn-1,0:maxygridn-1)
!real volume(0:maxxgrid-1,0:maxygrid-1,maxzgrid)
!real volumen(0:maxxgridn-1,0:maxygridn-1,maxzgrid)
!real areaeast(0:maxxgrid-1,0:maxygrid-1,maxzgrid)
!real areanorth(0:maxxgrid-1,0:maxygrid-1,maxzgrid)
! gridunc,griduncn uncertainty of outputted concentrations
! wetgridunc,wetgriduncn uncertainty of accumulated wet deposited mass on output grid
! drygridunc,drygriduncn uncertainty of accumulated dry deposited mass on output grid
! oroout,orooutn [m] height of model topography at output grid
! area,arean [m2] area of each grid cell
! volume,volumen [m3] volume of each grid cell
! ... field names with n at the end indicate a nested output grid
!***********************************
! Variables defining receptor points
!***********************************
real :: xreceptor(maxreceptor),yreceptor(maxreceptor)
real :: receptorarea(maxreceptor)
real :: creceptor(maxreceptor,maxspec)
character(len=16) :: receptorname(maxreceptor)
integer :: numreceptor
! xreceptor,yreceptor receptor position
! creceptor concentrations at receptor points
! receptorarea area of 1*1 grid cell at receptor point
!***************************************
! Variables characterizing each particle
!***************************************
integer :: numpart,itra1(maxpart)
integer :: npoint(maxpart),nclass(maxpart)
integer :: idt(maxpart),itramem(maxpart),itrasplit(maxpart)
integer :: numparticlecount
real(kind=dp) :: xtra1(maxpart),ytra1(maxpart)
real :: ztra1(maxpart),xmass1(maxpart,maxspec)
! numpart actual number of particles in memory
! itra1 (maxpart) [s] temporal positions of the particles
! npoint(maxpart) indicates the release point of each particle
! nclass (maxpart) one of nclassunc classes to which the particle is attributed
! itramem (maxpart) [s] memorized release times of the particles
! itrasplit (maxpart) [s] next time when particle is to be split into two
! idt(maxpart) [s] time step to be used for next integration
! numparticlecount counts the total number of particles that have been released
! xtra1,ytra1,ztra1 spatial positions of the particles
! xmass1 [kg] particle masses
!*******************************************************
! Info table on available chemical species/radionuclides
!*******************************************************
!character*10 specname(maxtable)
!real decaytime(maxtable),wetscava(maxtable),wetscavb(maxtable)
!real drydiff(maxtable),dryhenry(maxtable),dryactiv(maxtable)
!real partrho(maxtable),partmean(maxtable),partsig(maxtable)
!real dryvelo(maxtable),weightmol(maxtable),ohreact(maxtable)
! specname Name of chemical species/radionuclide
! decaytime Half time of radionuclides
! wetscava, wetscavb Parameters for calculating scavenging coefficients
! drydiff diffusivitiy of species relative to diff. of H2O
! dryhenry [M/atm] Henry constant
! dryactiv reactivity relative to that of O3
! partrho [kg/m3] density of particles
! partmean [m] mean diameter of particles
! partsig [m] mean stand. deviation of particle diameter
! dryvelo [cm/s] constant dry deposition velocity
! weightmol [g/mol] molecular weight
! ohreact OH reaction rate
!********************
! Random number field
!********************
real :: rannumb(maxrand)
! rannumb field of normally distributed random numbers
end module com_mod
program command2nml
!*****************************************************************************
! *
! This program reads the command file in any known format and writes *
! it in namelist format to the output argument
! *
! Author: Harald Sodemann
! 29 Oct 2012 *
!
! Input argument: COMMAND file
! Output argument: COMMAND file in namelist format
! *
!*****************************************************************************
! *
! Variables: *
! bdate beginning date as Julian date *
! ctl factor by which time step must be smaller than *
! Lagrangian time scale *
! ibdate,ibtime beginnning date and time (YYYYMMDD, HHMISS) *
! ideltas [s] modelling period *
! iedate,ietime ending date and time (YYYYMMDD, HHMISS) *
! ifine reduction factor for vertical wind time step *
! outputforeachrel for forward runs it is possible either to create *
! one outputfield or several for each releasepoint *
! iflux switch to turn on (1)/off (0) flux calculations *
! iout 1 for conc. (residence time for backward runs) output,*
! 2 for mixing ratio output, 3 both, 4 for plume *
! trajectory output, 5 = options 1 and 4 *
! ipin 1 continue simulation with dumped particle data, 0 no *
! ipout 0 no particle dump, 1 every output time, 3 only at end*
! itsplit [s] time constant for particle splitting *
! loutaver [s] concentration output is an average over loutaver *
! seconds *
! loutsample [s] average is computed from samples taken every [s] *
! seconds *
! loutstep [s] time interval of concentration output *
! lsynctime [s] synchronisation time interval for all particles *
! lagespectra switch to turn on (1)/off (0) calculation of age *
! spectra *
! lconvection value of either 0 and 1 indicating mixing by *
! convection *
! = 0 .. no convection *
! + 1 .. parameterisation of mixing by subgrid-scale *
! convection = on *
! lsubgrid switch to turn on (1)/off (0) subgrid topography *
! parameterization *
! method method used to compute the particle pseudovelocities *
! mdomainfill 1 use domain-filling option, 0 not, 2 use strat. O3 *
! *
! Constants: *
! 10 unit connected to file COMMAND *
! *
!*****************************************************************************
use com_mod
implicit none
real(kind=dp) :: juldate
character(len=50) :: line
logical :: old
integer :: readerror
character(256) :: infile
character(256) :: outfile
namelist /command/ &
ldirect, &
ibdate,ibtime, &
iedate,ietime, &
loutstep, &
loutaver, &
loutsample, &
itsplit, &
lsynctime, &
ctl, &
ifine, &
iout, &
ipout, &
lsubgrid, &
lconvection, &
lagespectra, &
ipin, &
ioutputforeachrelease, &
iflux, &
mdomainfill, &
ind_source, &
ind_receptor, &
mquasilag, &
nested_output, &
linit_cond
! Presetting namelist command
ldirect=1
ibdate=20000101
ibtime=0
iedate=20000102
ietime=0
loutstep=10800
loutaver=10800
loutsample=900
itsplit=999999999
lsynctime=900
ctl=-5.0
ifine=4
iout=3
ipout=0
lsubgrid=1
lconvection=1
lagespectra=0
ipin=1
ioutputforeachrelease=0
iflux=1
mdomainfill=0
ind_source=1
ind_receptor=1
mquasilag=0
nested_output=0
linit_cond=0
print*,'command2nml V1.0 converts FLEXPART COMMAND files to namelist format'
select case (iargc())
case (2)
call getarg(1,infile)
call getarg(2,outfile)
case default
print*,'USAGE: command2nml COMMAND.input COMMAND.namelist.output'
stop
end select
! Open the command file and read user options
! Namelist input first: try to read as namelist file
!**************************************************************************
open(10,file=trim(infile),status='old', form='formatted',iostat=readerror)
! If fail, check if file does not exist
if (readerror.ne.0) then
print*,'***ERROR: file COMMAND not found at ',trim(infile)
stop
endif
read(10,command,iostat=readerror)
close(10)
! If error in namelist format, try to open with old input code
if (readerror.ne.0) then
open(10,file=trim(infile),status='old', err=999)
! Check the format of the COMMAND file (either in free format,
! or using formatted mask)
! Use of formatted mask is assumed if line 10 contains the word 'DIRECTION'
!**************************************************************************
call skplin(9,10)
read (10,901) line
901 format (a)
if (index(line,'LDIRECT') .eq. 0) then
old = .false.
else
old = .true.
endif
rewind(10)
! Read parameters
!****************
call skplin(7,10)
if (old) call skplin(1,10)
read(10,*) ldirect
if (old) call skplin(3,10)
read(10,*) ibdate,ibtime
if (old) call skplin(3,10)
read(10,*) iedate,ietime
if (old) call skplin(3,10)
read(10,*) loutstep
if (old) call skplin(3,10)
read(10,*) loutaver
if (old) call skplin(3,10)
read(10,*) loutsample
if (old) call skplin(3,10)
read(10,*) itsplit
if (old) call skplin(3,10)
read(10,*) lsynctime
if (old) call skplin(3,10)
read(10,*) ctl
if (old) call skplin(3,10)
read(10,*) ifine
if (old) call skplin(3,10)
read(10,*) iout
if (old) call skplin(3,10)
read(10,*) ipout
if (old) call skplin(3,10)
read(10,*) lsubgrid
if (old) call skplin(3,10)
read(10,*) lconvection
if (old) call skplin(3,10)
read(10,*) lagespectra
if (old) call skplin(3,10)
read(10,*) ipin
if (old) call skplin(3,10)
read(10,*) ioutputforeachrelease
if (old) call skplin(3,10)
read(10,*) iflux
if (old) call skplin(3,10)
read(10,*) mdomainfill
if (old) call skplin(3,10)
read(10,*) ind_source
if (old) call skplin(3,10)
read(10,*) ind_receptor
if (old) call skplin(3,10)
read(10,*) mquasilag
if (old) call skplin(3,10)
read(10,*) nested_output
if (old) call skplin(3,10)
read(10,*) linit_cond
close(10)
endif ! input format
print*,'Input file read from ',trim(infile)
! write command file in namelist format to output directory if requested
open(11,file=trim(outfile),status='replace',err=998)
write(11,nml=command)
close(11)
print*,'Output file successfully created at ',trim(outfile)
stop
998 print*,' ERROR: Output file not found at ',trim(outfile)
stop
999 print*,' ERROR: Input file "COMMAND" not found at ',trim(infile)
stop
end program command2nml
!**********************************************************************
! Copyright 1998,1999,2000,2001,2002,2005,2007,2008,2009,2010 *
! Andreas Stohl, Petra Seibert, A. Frank, Gerhard Wotawa, *
! Caroline Forster, Sabine Eckhardt, John Burkhart, Harald Sodemann *
! *
! This file is part of FLEXPART. *
! *
! FLEXPART is free software: you can redistribute it and/or modify *
! it under the terms of the GNU General Public License as published by*
! the Free Software Foundation, either version 3 of the License, or *
! (at your option) any later version. *
! *
! FLEXPART is distributed in the hope that it will be useful, *
! but WITHOUT ANY WARRANTY; without even the implied warranty of *
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
! GNU General Public License for more details. *
! *
! You should have received a copy of the GNU General Public License *
! along with FLEXPART. If not, see <http://www.gnu.org/licenses/>. *
!**********************************************************************
!*******************************************************************************
! Include file for calculation of particle trajectories (Program FLEXPART) *
! This file contains the parameter statements used in FLEXPART *
! *
! Author: A. Stohl *
! *
! 1997 *
! *
! Last update 10 August 2000 *
! *
!*******************************************************************************
module par_mod
implicit none
!****************************************************************
! Parameter defining KIND parameter for "double precision"
!****************************************************************
integer,parameter :: dp=selected_real_kind(P=15)
!***********************************************************
! Number of directories/files used for FLEXPART input/output
!***********************************************************
integer,parameter :: numpath=4
! numpath Number of different pathnames for input/output files
!*****************************
! Physical and other constants
!*****************************
real,parameter :: pi=3.14159265, r_earth=6.371e6, r_air=287.05, ga=9.81
real,parameter :: cpa=1004.6, kappa=0.286, pi180=pi/180., vonkarman=0.4
! pi number "pi"
! pi180 pi/180.
! r_earth radius of earth [m]
! r_air individual gas constant for dry air [J/kg/K]
! ga gravity acceleration of earth [m/s**2]
! cpa specific heat for dry air
! kappa exponent of formula for potential temperature
! vonkarman von Karman constant
real,parameter :: karman=0.40, href=15., convke=2.0
real,parameter :: hmixmin=100., hmixmax=4500., turbmesoscale=0.16
real,parameter :: d_trop=50., d_strat=0.1
! karman Karman's constant
! href [m] Reference height for dry deposition
! konvke Relative share of kinetic energy used for parcel lifting
! hmixmin,hmixmax Minimum and maximum allowed PBL height
! turbmesoscale the factor by which standard deviations of winds at grid
! points surrounding the particle positions are scaled to
! yield the scales for the mesoscale wind velocity fluctuations
! d_trop [m2/s] Turbulent diffusivity for horizontal components in the troposphere
! d_strat [m2/s] Turbulent diffusivity for vertical component in the stratosphere
real,parameter :: xmwml=18.016/28.960
! xmwml ratio of molar weights of water vapor and dry air
!****************************************************
! Constants related to the stratospheric ozone tracer
!****************************************************
real,parameter :: ozonescale=60., pvcrit=2.0
! ozonescale ppbv O3 per PV unit
! pvcrit PV level of the tropopause
!********************
! Some time constants
!********************
integer,parameter :: idiffnorm=10800, idiffmax=2*idiffnorm, minstep=1
! idiffnorm [s] normal time interval between two wind fields
! idiffmax [s] maximum time interval between two wind fields
! minstep [s] minimum time step to be used within FLEXPART
!*****************************************************************
! Parameters for polar stereographic projection close to the poles
!*****************************************************************
real,parameter :: switchnorth=75., switchsouth=-75.
! switchnorth use polar stereographic grid north of switchnorth
! switchsouth use polar stereographic grid south of switchsouth
!*********************************************
! Maximum dimensions of the input mother grids
!*********************************************
integer,parameter :: nxmax=361,nymax=181,nuvzmax=92,nwzmax=92,nzmax=92
!integer,parameter :: nxmax=361,nymax=181,nuvzmax=26,nwzmax=26,nzmax=26
!integer,parameter :: nxmax=721,nymax=361,nuvzmax=64,nwzmax=64,nzmax=64
!integer,parameter :: nxmax=1201,nymax=235,nuvzmax=58,nwzmax=58,nzmax=58
integer,parameter :: nxshift=359 ! for ECMWF
!integer,parameter :: nxshift=0 ! for GFS
integer,parameter :: nconvlevmax = nuvzmax-1
integer,parameter :: na = nconvlevmax+1
! nxmax,nymax maximum dimension of wind fields in x and y
! direction, respectively
! nuvzmax,nwzmax maximum dimension of (u,v) and (w) wind fields in z
! direction (for fields on eta levels)
! nzmax maximum dimension of wind fields in z direction
! for the transformed Cartesian coordinates
! nxshift for global grids (in x), the grid can be shifted by
! nxshift grid points, in order to accomodate nested
! grids, and output grids overlapping the domain "boundary"
! nxshift must not be negative; "normal" setting would be 0
! ntracermax maximum number of tracer species in convection
! nconvlevmax maximum number of levels for convection
! na parameter used in Emanuel's convect subroutine
!*********************************************
! Maximum dimensions of the nested input grids
!*********************************************
integer,parameter :: maxnests=0, nxmaxn=0, nymaxn=0
!integer,parameter :: maxnests=1,nxmaxn=251,nymaxn=151
! maxnests maximum number of nested grids
! nxmaxn,nymaxn maximum dimension of nested wind fields in
! x and y direction, respectively
!*********************************
! Parmaters for GRIB file decoding
!*********************************
integer,parameter :: jpack=4*nxmax*nymax, jpunp=4*jpack
! jpack,jpunp maximum dimensions needed for GRIB file decoding
!**************************************
! Maximum dimensions of the output grid
!**************************************
!integer,parameter :: maxageclass=1,maxzgrid=10,nclassunc=1
integer,parameter :: maxageclass=1,nclassunc=1
! nclassunc number of classes used to calculate the uncertainty
! of the output
! maxageclass maximum number of age classes used for output
! Sabine Eckhardt, June, 2008
! the dimensions of the OUTGRID are now set dynamically during runtime
! maxxgrid,maxygrid,maxzgrid maximum dimensions in x,y,z direction
! maxxgridn,maxygridn maximum dimension of the nested grid
!integer maxxgrid,maxygrid,maxzgrid,maxxgridn,maxygridn
!integer,parameter :: maxxgrid=361,maxygrid=181,maxxgridn=0,maxygridn=0)
integer,parameter :: maxreceptor=200
! maxreceptor maximum number of receptor points
!**************************************************
! Maximum number of particles, species, and similar
!**************************************************
integer,parameter :: maxpart=50000
integer,parameter :: maxspec=1
! maxpart Maximum number of particles
! maxspec Maximum number of chemical species per release
! maxpoint is also set dynamically during runtime
! maxpoint Maximum number of release locations
! ---------
! Sabine Eckhardt: change of landuse inventary numclass=13
! ---------
integer,parameter :: maxwf=50000, maxtable=1000, numclass=13, ni=11
! maxwf maximum number of wind fields to be used for simulation
! maxtable Maximum number of chemical species that can be
! tabulated for FLEXPART
! numclass Number of landuse classes available to FLEXPART
! ni Number of diameter classes of particles
!**************************************************************************
! dimension of the OH field
!**************************************************************************
integer,parameter :: maxxOH=72, maxyOH=46, maxzOH=7
!**************************************************************************
! Maximum number of particles to be released in a single atmospheric column
! for the domain-filling trajectories option
!**************************************************************************
integer,parameter :: maxcolumn=3000
!*********************************
! Dimension of random number field
!*********************************
integer,parameter :: maxrand=2000000
! maxrand number of random numbers used
!*****************************************************
! Number of clusters to be used for plume trajectories
!*****************************************************
integer,parameter :: ncluster=5
!************************************
! Unit numbers for input/output files
!************************************
integer,parameter :: unitpath=1, unitcommand=1, unitageclasses=1, unitgrid=1
integer,parameter :: unitavailab=1, unitreleases=88, unitpartout=93
integer,parameter :: unitpartin=93, unitflux=98, unitouttraj=96
integer,parameter :: unitvert=1, unitoro=1, unitpoin=1, unitreceptor=1
integer,parameter :: unitoutgrid=97, unitoutgridppt=99, unitoutinfo=1
integer,parameter :: unitspecies=1, unitoutrecept=91, unitoutreceptppt=92
integer,parameter :: unitlsm=1, unitsurfdata=1, unitland=1, unitwesely=1
integer,parameter :: unitOH=1
integer,parameter :: unitdates=94, unitheader=90, unitshortpart=95
integer,parameter :: unitboundcond=89
end module par_mod
!**********************************************************************
! Copyright 1998,1999,2000,2001,2002,2005,2007,2008,2009,2010 *
! Andreas Stohl, Petra Seibert, A. Frank, Gerhard Wotawa, *
! Caroline Forster, Sabine Eckhardt, John Burkhart, Harald Sodemann *
! *
! This file is part of FLEXPART. *
! *
! FLEXPART is free software: you can redistribute it and/or modify *
! it under the terms of the GNU General Public License as published by*
! the Free Software Foundation, either version 3 of the License, or *
! (at your option) any later version. *
! *
! FLEXPART is distributed in the hope that it will be useful, *
! but WITHOUT ANY WARRANTY; without even the implied warranty of *
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
! GNU General Public License for more details. *
! *
! You should have received a copy of the GNU General Public License *
! along with FLEXPART. If not, see <http://www.gnu.org/licenses/>. *
!**********************************************************************
subroutine skplin(nlines,iunit)
! i i
!*****************************************************************************
! *
! This routine reads nlines from unit iunit and discards them *
! *
! Authors: Petra Seibert *
! *
! 31 Dec 1998 *
! *
!*****************************************************************************
! *
! Variables: *
! *
! iunit unit number from which lines are to be skipped *
! nlines number of lines to be skipped *
! *
!*****************************************************************************
implicit none
integer :: i,iunit, nlines
do i=1,nlines
read(iunit,*)
end do
end subroutine skplin
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment