60 integer :: itime,ix,jy,ixp,jyp,indexh,i,j,k,m,n,il,ind,indz,indzp
61 real :: xl(maxpart),yl(maxpart),zl(maxpart)
62 real :: xcenter,ycenter,zcenter,dist,
distance,rmsdist,zrmsdist
64 real :: xclust(ncluster),yclust(ncluster),zclust(ncluster)
65 real :: fclust(ncluster),rms,rmsclust(ncluster),zrms
67 real :: dt1,dt2,dtt,ddx,ddy,rddx,rddy,p1,p2,p3,p4,dz1,dz2,dz
68 real :: topo,topocenter,hm(2),hmixi,hmixfract,hmixcenter
69 real :: pv1(2),pvprof(2),pvi,pvcenter,pvfract,tr(2),tri,tropofract
73 dt1=
real(itime-memtime(1))
74 dt2=
real(memtime(2)-itime)
82 if (abs(ireleasestart(j)-itime).gt.lage(nageclass)) goto 10
95 if (itra1(i).ne.itime) goto 20
96 if (npoint(i).ne.j) goto 20
98 xl(n)=xlon0+xtra1(i)*dx
99 yl(n)=ylat0+ytra1(i)*dy
113 ddx=xtra1(i)-
real(ix)
114 ddy=ytra1(i)-
real(jy)
125 topo=p1*oro(ix ,jy) &
129 topocenter=topocenter+topo
135 if (height(il).gt.zl(n))
then
143 dz1=zl(n)-height(indz)
144 dz2=height(indzp)-zl(n)
151 pv1(m)=p1*pv(ix ,jy ,ind,indexh) &
152 +p2*pv(ixp,jy ,ind,indexh) &
153 +p3*pv(ix ,jyp,ind,indexh) &
154 +p4*pv(ixp,jyp,ind,indexh)
156 pvprof(ind-indz+1)=(pv1(1)*dt2+pv1(2)*dt1)*dtt
158 pvi=(dz1*pvprof(2)+dz2*pvprof(1))*dz
159 pvcenter=pvcenter+pvi
160 if (yl(n).gt.0.)
then
161 if (pvi.lt.2.) pvfract=pvfract+1.
163 if (pvi.gt.-2.) pvfract=pvfract+1.
173 tr(m)=p1*tropopause(ix ,jy ,1,indexh) &
174 + p2*tropopause(ixp,jy ,1,indexh) &
175 + p3*tropopause(ix ,jyp,1,indexh) &
176 + p4*tropopause(ixp,jyp,1,indexh)
178 hm(m)=p1*hmix(ix ,jy ,1,indexh) &
179 + p2*hmix(ixp,jy ,1,indexh) &
180 + p3*hmix(ix ,jyp,1,indexh) &
181 + p4*hmix(ixp,jyp,1,indexh)
184 hmixi=(hm(1)*dt2+hm(2)*dt1)*dtt
185 tri=(tr(1)*dt2+tr(2)*dt1)*dtt
186 if (zl(n).lt.tri) tropofract=tropofract+1.
187 tropocenter=tropocenter+tri+topo
188 if (zl(n).lt.hmixi) hmixfract=hmixfract+1.
190 hmixcenter=hmixcenter+hmixi
201 topocenter=topocenter/
real(n)
202 hmixcenter=hmixcenter/
real(n)
203 pvcenter=pvcenter/
real(n)
204 tropocenter=tropocenter/
real(n)
205 hmixfract=100.*hmixfract/
real(n)
206 pvfract=100.*pvfract/
real(n)
207 tropofract=100.*tropofract/
real(n)
212 call
clustering(xl,yl,zl,n,xclust,yclust,zclust,fclust,rms, &
220 call
mean(zl,zcenter,zrmsdist,n)
226 dist=
distance(yl(k),xl(k),ycenter,xcenter)
227 rmsdist=rmsdist+dist*dist
229 if (rmsdist.gt.0.) rmsdist=sqrt(rmsdist/
real(n))
230 rmsdist=max(rmsdist,0.)
235 write(unitouttraj,
'(i5,i8,2f9.4,4f8.1,f8.2,4f8.1,3f6.1,&
236 &5(2f8.3,f7.0,f6.1,f8.1))')&
237 &j,itime-(ireleasestart(j)+ireleaseend(j))/2, &
238 xcenter,ycenter,zcenter,topocenter,hmixcenter,tropocenter, &
239 pvcenter,rmsdist,rms,zrmsdist,zrms,hmixfract,pvfract, &
241 (xclust(k),yclust(k),zclust(k),fclust(k),rmsclust(k), &
subroutine clustering(xl, yl, zl, n, xclust, yclust, zclust, fclust, rms, rmsclust, zrms)
real function distance(rlat1, rlon1, rlat2, rlon2)
subroutine centerofmass(xl, yl, n, xcenter, ycenter)
subroutine plumetraj(itime)
subroutine mean(x, xm, xs, number)