52 real :: outhelp,xr,xr1,yr,yr1
53 real,
parameter :: eps=1.e-4
60 open(unitoutgrid,file=path(1)(1:length(1))//
'OUTGRID',status=
'old', &
71 read(unitoutgrid,
'(4x,f11.4)') outlon0
73 read(unitoutgrid,
'(4x,f11.4)') outlat0
75 read(unitoutgrid,
'(4x,i5)') numxgrid
77 read(unitoutgrid,
'(4x,i5)') numygrid
79 read(unitoutgrid,
'(4x,f12.5)') dxout
81 read(unitoutgrid,
'(4x,f12.5)') dyout
87 xr=outlon0+
real(numxgrid)*dxout
88 yr=outlat0+
real(numygrid)*dyout
89 xr1=xlon0+
real(nxmin1)*dx
90 yr1=ylat0+
real(nymin1)*dy
91 if ((outlon0+eps.lt.xlon0).or.(outlat0+eps.lt.ylat0) &
92 .or.(xr.gt.xr1+eps).or.(yr.gt.yr1+eps))
then
93 write(*,*) outlon0,outlat0
94 write(*,*) xr1,yr1,xlon0,ylat0,xr,yr,dxout,dyout
95 write(*,*)
' #### FLEXPART MODEL ERROR! PART OF OUTPUT ####'
96 write(*,*)
' #### GRID IS OUTSIDE MODEL DOMAIN. CHANGE ####'
97 write(*,*)
' #### FILE OUTGRID IN DIRECTORY ####'
98 write(*,
'(a)') path(1)(1:length(1))
107 read(unitoutgrid,*,end=99)
109 read(unitoutgrid,
'(4x,f7.1)',end=99) outhelp
110 if (outhelp.eq.0.) goto 99
114 allocate(outheight(numzgrid) &
116 if (stat.ne.0)
write(*,*)
'ERROR: could not allocate outh'
117 allocate(outheighthalf(numzgrid) &
119 if (stat.ne.0)
write(*,*)
'ERROR: could not allocate outh'
123 call
skplin(29,unitoutgrid)
131 read(unitoutgrid,*,end=990)
133 read(unitoutgrid,
'(4x,f7.1)',end=990) outhelp
134 if (outhelp.eq.0.) goto 99
144 if (outheight(j).le.outheight(j-1))
then
145 write(*,*)
' #### FLEXPART MODEL ERROR! YOUR SPECIFICATION#### '
146 write(*,*)
' #### OF OUTPUT LEVELS IS CORRUPT AT LEVEL #### '
147 write(*,*)
' #### ',j,
' #### '
148 write(*,*)
' #### PLEASE MAKE CHANGES IN FILE OUTGRID. #### '
155 outheighthalf(1)=outheight(1)/2.
157 outheighthalf(j)=(outheight(j-1)+outheight(j))/2.
161 xoutshift=xlon0-outlon0
162 youtshift=ylat0-outlat0
165 allocate(oroout(0:numxgrid-1,0:numygrid-1) &
167 if (stat.ne.0)
write(*,*)
'ERROR: could not allocate outh'
168 allocate(area(0:numxgrid-1,0:numygrid-1) &
170 if (stat.ne.0)
write(*,*)
'ERROR: could not allocate outh'
171 allocate(volume(0:numxgrid-1,0:numygrid-1,numzgrid) &
173 if (stat.ne.0)
write(*,*)
'ERROR: could not allocate outh'
174 allocate(areaeast(0:numxgrid-1,0:numygrid-1,numzgrid) &
176 if (stat.ne.0)
write(*,*)
'ERROR: could not allocate outh'
177 allocate(areanorth(0:numxgrid-1,0:numygrid-1,numzgrid) &
179 if (stat.ne.0)
write(*,*)
'ERROR: could not allocate outh'
183 999
write(*,*)
' #### FLEXPART MODEL ERROR! FILE "OUTGRID" #### '
184 write(*,*)
' #### CANNOT BE OPENED IN THE DIRECTORY #### '
185 write(*,*)
' #### xxx/flexpart/options #### '
subroutine skplin(nlines, iunit)