27 integer*1 igridflags(ilo-mbuff:ihi+mbuff,jlo-mbuff:jhi+mbuff)
31 integer*1 icopy(mibuff,mjbuff)
32 dimension ist(3), iend(3), jst(3), jend(3), ishift(3), jshift(3)
33 dimension igridst(lcheck), igridend(lcheck)
34 dimension jgridst(lcheck), jgridend(lcheck)
35 logical borderx, bordery
49 igridend(lcheck) = ihi
51 jgridend(lcheck) = jhi
52 do lc = lcheck-1,lbase,-1
53 ilo_coarse = floor(dfloat(igridst(lc+1))/
intratx(lc))
54 jlo_coarse = floor(dfloat(jgridst(lc+1))/
intraty(lc))
55 ihi_coarse = ceiling(dfloat(igridend(lc+1))/
intratx(lc)) - 1
56 jhi_coarse = ceiling(dfloat(jgridend(lc+1))/
intraty(lc)) - 1
57 if (ihi_coarse*
intratx(lc) .lt. igridend(lc+1))
58 . ihi_coarse = ihi_coarse+1
59 if (jhi_coarse*
intraty(lc) .lt. jgridend(lc+1))
60 . jhi_coarse = jhi_coarse+1
61 igridend(lc) = ihi_coarse
62 jgridend(lc) = jhi_coarse
63 igridst(lc) = ilo_coarse
64 jgridst(lc) = jlo_coarse
67 ilo_coarse = igridst(lbase)
68 ihi_coarse = igridend(lbase)
69 jlo_coarse = jgridst(lbase)
70 jhi_coarse = jgridend(lbase)
94 borderx = (ilo_coarse.le. 0 .or. ihi_coarse.ge.
iregsz(lbase)-1)
95 bordery = (jlo_coarse.le. 0 .or. jhi_coarse.ge.
jregsz(lbase)-1)
98 . ilo_coarse-mbuff,ihi_coarse+mbuff,
99 . jlo_coarse-mbuff,jhi_coarse+mbuff,
100 . ishift,jshift,lbase)
103 i1 = max(ilo_coarse-mbuff,ist(i))
104 i2 = min(ihi_coarse+mbuff,iend(i))
106 j1 = max(jlo_coarse-mbuff,jst(j))
107 j2 = min(jhi_coarse+mbuff, jend(j))
109 if (.not. ((i1 .le. i2) .and. (j1 .le. j2)))
go to 24
121 ixlo = max(iblo,i1+ishift(i))
122 ixhi = min(ibhi,i2+ishift(i))
123 jxlo = max(jblo,j1+jshift(j))
124 jxhi = min(jbhi,j2+jshift(j))
126 if ((ixlo .gt. ixhi) .or. (jxlo .gt. jxhi))
go to 24
130 ixlo_unwrapped = ixlo - ishift(i)
131 ixhi_unwrapped = ixhi - ishift(i)
132 jxlo_unwrapped = jxlo - jshift(j)
133 jxhi_unwrapped = jxhi - jshift(j)
135 . ixlo_unwrapped,ixhi_unwrapped,
136 . jxlo_unwrapped,jxhi_unwrapped,
137 . ilo_coarse,ihi_coarse,
138 . jlo_coarse,jhi_coarse,mbuff)
144 ixlo = max(iblo,ilo_coarse-mbuff)
145 ixhi = min(ibhi,ihi_coarse+mbuff)
146 jxlo = max(jblo,jlo_coarse-mbuff)
147 jxhi = min(jbhi,jhi_coarse+mbuff)
150 if (.not.((ixlo .le. ixhi) .and. (jxlo .le. jxhi)))
go to 30
155 . ilo_coarse,ihi_coarse,
156 . jlo_coarse,jhi_coarse,mbuff)
160 if (mbase .ne. 0)
go to 20
164 . jlo_coarse,jhi_coarse,mbuff,lbase)
173 call griddomcopy(icopy,igridflags,ilo_coarse,ihi_coarse,
174 . jlo_coarse,jhi_coarse,mbuff)
182 do 40 lev = lbase+1, lcheck
187 ilo_fine = igridst(lev)
188 ihi_fine = igridend(lev)
189 jlo_fine = jgridst(lev)
190 jhi_fine = jgridend(lev)
194 . ilo_coarse,ihi_coarse,jlo_coarse,jhi_coarse,
196 . ilo_fine,ihi_fine,jlo_fine,jhi_fine)
198 call griddomshrink(icopy,ilo_fine,ihi_fine,jlo_fine,jhi_fine,
200 ilo_coarse = ilo_fine
201 ihi_coarse = ihi_fine
202 jlo_coarse = jlo_fine
203 jhi_coarse = jhi_fine
subroutine griddomup(iflags, iflags2, ilo, ihi, jlo, jhi, mbuff, lev, ilofine, ihifine, jlofine, jhifine)
iflags described flagged cells in a rectangular region described by ilo, ihi, jlo, jhi in level lev index space This subroutine projects iflags to iflag, which has flagging information in a rectangular region described by ilofine, ihifine, jlofine, jhifine in level lev+1 index space
subroutine setphysbndryflags(iflags, ilo, ihi, jlo, jhi, mbuff, level)
If grid borders the physical domain then set domain flags to 1 in buffer zone (which is outside the p...
integer, dimension(maxlv) iregsz
subroutine griddomshrink(iflags2, ilo, ihi, jlo, jhi, mbuff, iflags, level)
Shrink domain flags one cell for allowable properly nested domain This is needed even for lcheck = lb...
integer, parameter ndihi
global i index of right border of this grid
integer, dimension(maxlv) jregsz
integer, dimension(nsize, maxgr) node
integer, parameter domflags2
domain flags, indexed within level-of-this-grid level index space
integer, parameter ndilo
global i index of left border of this grid
integer, parameter ndjlo
global j index of lower border of this grid
integer, dimension(maxlv) lstart
subroutine coarsegridflagset(iflags, ixlo, ixhi, jxlo, jxhi, ilo_coarse, ihi_coarse, jlo_coarse, jhi_coarse, mbuff)
Flag a whole subregion from (ixlo,ixhi) to (jxlo, jxhi) with integer.
integer, dimension(maxlv) intraty
subroutine setindices(ist, iend, jst, jend, ilo, ihi, jlo, jhi, ishift, jshift, level)
integer, parameter ndjhi
global j index of upper border of this grid
integer, dimension(maxlv) intratx
integer, parameter levelptr
node number (index) of next grid on the same level
subroutine griddomcopy(i1, i2, ilo, ihi, jlo, jhi, mbuff)
The module contains the definition of a "node descriptor" as well as other global variables used duri...
real(kind=8), dimension(:), allocatable alloc