49 integer :: ix,jy,kz,ks,kp,nage,l,iix,jjy,ixp,jyp,i1,j1,j,ngrid
51 real :: ylat,gridarea,ylatp,ylatm,hzone,cosfactm,cosfactp
52 real :: xlon,xl,yl,ddx,ddy,rddx,rddy,p1,p2,p3,p4,xtn,ytn,oroh
53 real,
parameter :: eps=nxmax/3.e5
58 allocate(griduncn(0:numxgridn-1,0:numygridn-1,numzgrid,maxspec, &
59 maxpointspec_act,nclassunc,maxageclass),stat=stat)
60 if (stat.ne.0)
write(*,*)
'ERROR:could not allocate nested gridunc'
62 if (ldirect.gt.0)
then
63 allocate(wetgriduncn(0:numxgridn-1,0:numygridn-1,maxspec, &
64 maxpointspec_act,nclassunc,maxageclass),stat=stat)
65 if (stat.ne.0)
write(*,*)
'ERROR:could not allocate nested gridunc'
66 allocate(drygriduncn(0:numxgridn-1,0:numygridn-1,maxspec, &
67 maxpointspec_act,nclassunc,maxageclass),stat=stat)
68 if (stat.ne.0)
write(*,*)
'ERROR:could not allocate nested gridunc'
76 ylat=outlat0n+(
real(jy)+0.5)*dyoutn
79 if ((ylatm.lt.0).and.(ylatp.gt.0.))
then
80 hzone=dyoutn*r_earth*pi180
87 cosfactp=cos(ylatp*pi180)
88 cosfactm=cos(ylatm*pi180)
89 if (cosfactp.lt.cosfactm)
then
90 hzone=sqrt(1-cosfactp**2)- &
94 hzone=sqrt(1-cosfactm**2)- &
105 gridarea=2.*pi*r_earth*hzone*dxoutn/360.
108 arean(ix,jy)=gridarea
113 volumen(ix,jy,1)=arean(ix,jy)*outheight(1)
115 volumen(ix,jy,kz)=arean(ix,jy)*(outheight(kz)-outheight(kz-1))
136 ylat=outlat0n+(
real(jjy)+
real(j1)/10.-0.05)*dyoutn
139 xlon=outlon0n+(
real(iix)+
real(i1)/10.-0.05)*dxoutn
147 if ((xl.gt.xln(j)+eps).and.(xl.lt.xrn(j)-eps).and. &
148 (yl.gt.yln(j)+eps).and.(yl.lt.yrn(j)-eps))
then
159 xtn=(xl-xln(ngrid))*xresoln(ngrid)
160 ytn=(yl-yln(ngrid))*yresoln(ngrid)
181 oroh=oroh+p1*oron(ix ,jy ,ngrid) &
182 + p2*oron(ixp,jy ,ngrid) &
183 + p3*oron(ix ,jyp,ngrid) &
184 + p4*oron(ixp,jyp,ngrid)
186 oroh=oroh+p1*oro(ix ,jy) &
197 orooutn(iix,jjy)=oroh/100.
207 do kp=1,maxpointspec_act
214 if (ldirect.gt.0)
then
215 wetgriduncn(ix,jy,ks,kp,l,nage)=0.
216 drygriduncn(ix,jy,ks,kp,l,nage)=0.
220 griduncn(ix,jy,kz,ks,kp,l,nage)=0.
subroutine outgrid_init_nest