47 integer :: metdata_format = unknown_metdata
48 integer :: itime, nstop1
50 character(len=256) :: arg
51 character(len=512) :: dumppath
52 character(len=512) :: inputfilename
53 character(len=512) :: nestedfilename
54 character(len=32) :: lsubgridtxt
55 integer :: useavailable = 0
59 print*,
'Welcome to GRIB2FLEXPART Version 1.0'
60 print*,
'FLEXPART is free software released under the GNU Genera'// &
64 if (( iargc().lt.2 ).or.( iargc().eq.3))
then
66 print *,
'Usage in use-available mode: grib2flexpart useAvailable <output directory>'
67 print *,
'Usage in command line mode: grib2flexpart forward|backward subgrid <output directory> <source file> [<source file>...]'
69 stop
'Error: Missing arguments'
70 elseif ( iargc().eq.2 )
then
72 if ( arg.eq.
"useAvailable" )
then
73 print *,
'Running in use-available mode'
77 print *,
'Usage in use-available mode: grib2flexpart useAvailable <output directory>'
78 print *,
'Usage in command line mode: grib2flexpart forward|backward subgrid <output directory> &
79 <source file> [<source file>...]'
81 stop
'Error: Incorrect arguments'
86 if ( arg.eq.
"forward")
then
88 else if ( arg.eq.
"backward")
then
92 print *,
'Usage in use-available mode: grib2flexpart useAvailable <output directory>'
93 print *,
'Usage in command line mode: grib2flexpart forward|backward subgrid <output directory> &
94 <source file> [<source file>...]'
96 stop
'Error: Incorrect arguments'
98 print *,
'Running in command line mode'
102 if ( useavailable.eq.0 )
then
103 call getarg(2,lsubgridtxt)
104 read (lsubgridtxt,
'(i10)') lsubgrid
106 call getarg(3,dumppath)
108 call getarg(i,inputfilename)
110 if ( ldirect.eq.1 )
then
111 wfname(i-4+1) = inputfilename
113 wfname(iargc()+1-i) = inputfilename
118 call getarg(2,dumppath)
137 if (metdata_format.eq.ecmwf_metdata)
then
138 print*,
'ECMWF metdata detected'
139 elseif (metdata_format.eq.gfs_metdata)
then
140 print*,
'NCEP metdata detected'
142 stop
'Unknown metdata format'
154 if ( ( useavailable.eq.0 ).or.(numbwf.eq.1) )
then
159 if (((ldirect*wftime(i).le.0).and. &
160 (ldirect*wftime(i+1).gt.0)).or. &
161 (ldirect*wftime(i).gt.0))
then
169 write(*,*)
'CONGRATULATIONS: YOU HAVE SUCCESSFULLY COMPLETED A GRIB2FLE&
170 &XPART PREPROCESSING RUN!'
subroutine convertfields(ind, metdata_format, dumpPath)
subroutine gridcheck_ecmwf
subroutine gridcheck_nests