41 subroutine projec2(level,numpro,rectflags,ilo,ihi,jlo,jhi,mbuff)
44 implicit double precision (a-h,o-z)
45 dimension rectflags(ilo-mbuff:ihi+mbuff,jlo-mbuff:jhi+mbuff)
46 logical borderx, bordery
47 integer ist(3),iend(3),jst(3),jend(3),ishift(3),jshift(3)
50 lrat2x = intratx(level)*intratx(level+1)
51 lrat2y = intraty(level)*intraty(level+1)
56 10
if (mkid .eq. 0) go to 90
57 ikidlo = node(ndilo,mkid)
58 jkidlo = node(ndjlo,mkid)
59 ikidhi = node(ndihi,mkid)
60 jkidhi = node(ndjhi,mkid)
69 istc = ikidlo/intratx(level+1) - 1
70 istc = istc/intratx(level) - 1
71 jstc = jkidlo/intraty(level+1) - 1
72 jstc = jstc/intraty(level) - 1
73 iendc = ikidhi/intratx(level+1) + 1
74 iendc = iendc/intratx(level) + 1
75 jendc = jkidhi/intraty(level+1) + 1
76 jendc = jendc/intraty(level) + 1
79 borderx = (istc .le. 0 .or. iendc .ge. iregsz(level)-1)
80 bordery = (jstc .le. 0 .or. jendc .ge. jregsz(level)-1)
84 if (.not. (xperdom .and. borderx) .and.
85 . .not. (yperdom .and. bordery))
then
88 iendc = min(iendc,iregsz(level))
89 jendc = min(jendc,jregsz(level))
92 ixlo = max(istc, ilo-mbuff)
93 ixhi = min(iendc,ihi+mbuff)
94 jxlo = max(jstc, jlo-mbuff)
95 jxhi = min(jendc,jhi+mbuff)
99 if (.not.((ixlo .le. ixhi) .and. (jxlo .le. jxhi))) go to 80
104 if (rectflags(i,j) .eq. goodpt)
then
105 rectflags(i,j) = badpro
107 if (pprint)
write(outunit,101) i,j,mkid
108 101
format(
' pt.',2i5,
' of grid ',i5,
' projected' )
116 call
setindices(ist,iend,jst,jend,iclo,ichi,jclo,jhci,
117 . ishift,jshift,level)
121 i1 = max(istc, ist(i))
122 i2 = min(iendc, iend(i))
124 j1 = max(jstc, jst(j))
125 j2 = min(jendc, jend(j))
127 if (.not. ((i1 .le. i2) .and. (j1 .le. j2))) go to 25
136 ixlo = max(i1,ilo-mbuff)
137 ixhi = min(i2,ihi+mbuff)
138 jxlo = max(j1,jlo-mbuff)
139 jxhi = min(j2,jhi+mbuff)
141 if (.not.((ixlo.le.ixhi) .and. (jxlo.le.jxhi))) go to 25
146 if (rectflags(ix,jx) .eq. goodpt)
then
147 rectflags(ix,jx) = badpro
149 if (pprint)
write(outunit,101) ix,jx,mkid
160 if (spheredom .and. ibuff .eq. 0)
then
162 jendc = jkidhi/lrat2y
163 if (jstc .eq. 0)
then
164 iwrap1 = iregsz(level) - iendc - 1
165 iwrap2 = iregsz(level) - istc - 1
167 do 61 i = iwrap1, iwrap2
168 if (rectflags(i,1) .eq. goodpt)
then
169 rectflags(i,1) = badpro
171 if (pprint)
write(outunit,101) i,1,mkid
176 if (jendc .eq. jsize-1)
then
177 iwrap1 = iregsz(level) - iendc - 1
178 iwrap2 = iregsz(level) - istc - 1
180 do 62 i = iwrap1, iwrap2
181 if (rectflags(i,jsize-1) .eq. goodpt)
then
182 rectflags(i,jsize-1) = badpro
184 if (pprint)
write(outunit,101) i,j,mkid
192 80 mkid = node(levelptr, mkid)
196 write(outunit,102) numpro,level
197 102
format(i9,
' more pts. projected to level ',i5)
199 write(outunit,103) level
200 103
format(/,
' from projec: flagged pts. (incl. buffer zone)',
201 &
' at level ',i4,
':')
203 do 110 j = jhi+mbuff, jlo-mbuff, -1
204 write(outunit,104)(int(rectflags(i,j)),i=ilo-mbuff,ihi+mbuff)
subroutine projec2(level, numpro, rectflags, ilo, ihi, jlo, jhi, mbuff)
This subroutine projects all level level+1 and level+2 grids to a level level grid and flag the cells...
subroutine setindices(ist, iend, jst, jend, ilo, ihi, jlo, jhi, ishift, jshift, level)