19 logical function basecheck(mnew,lbase,ilo,ihi,jlo,jhi,
23 implicit double precision (a-h, o-z)
25 logical debug/.false./
26 integer ist(3),iend(3),jst(3),jend(3),ishift(3),jshift(3)
27 logical borderx, bordery
31 iadd(i,j) = locm + i - iclo + leni*(j-jclo)
50 borderx = (ilo .eq. 0 .or. ihi .eq.
iregsz(levnew)-1)
51 bordery = (jlo .eq. 0 .or. jhi .eq.
jregsz(levnew)-1)
61 do 5 lev = lbase, levnew-1
62 levratx = levratx *
intratx(lev)
63 levraty = levraty *
intraty(lev)
73 do lev = levnew-1,lbase,-1
103 if (.not. (
xperdom .and. borderx) .and.
104 . .not. (
yperdom .and. bordery))
then 107 ichi = min(ichi,
iregsz(lbase)-1)
108 jchi = min(jchi,
jregsz(lbase)-1)
112 leni = ichi - iclo + 1
113 lenj = jchi - jclo + 1
114 lenrect = leni * lenj
116 alloc(locm:locm+lenrect-1) = 0.
120 if (ilo .eq. 0 .and. .not.
xperdom)
then 133 if (jlo .eq. 0 .and. .not.
yperdom)
then 153 if ((.not. (
xperdom .and. borderx)) .and.
154 . .not. (
yperdom .and. bordery))
then 155 ixlo = max(iclo,iblo)
156 ixhi = min(ichi,ibhi)
157 jxlo = max(jclo,jblo)
158 jxhi = min(jchi,jbhi)
159 if (.not.((ixlo.le.ixhi) .and. (jxlo.le.jxhi)))
go to 30
173 call setindices(ist,iend,jst,jend,iclo,ichi,jclo,jchi,
174 . ishift,jshift,lbase)
178 i1 = max(iclo,ist(i))
179 i2 = min(ichi, iend(i))
181 j1 = max(jclo, jst(j))
182 j2 = min(jchi, jend(j))
184 if (.not. ((i1 .le. i2) .and. (j1 .le. j2)))
go to 25
188 i1_shifted = i1 + ishift(i)
189 i2_shifted = i2 + ishift(i)
190 j1_shifted = j1 + jshift(j)
191 j2_shifted = j2 + jshift(j)
193 ixlo = max(i1_shifted,iblo)
194 ixhi = min(i2_shifted,ibhi)
195 jxlo = max(j1_shifted,jblo)
196 jxhi = min(j2_shifted,jbhi)
198 if (.not.((ixlo.le.ixhi) .and. (jxlo.le.jxhi)))
go to 25
203 ix_unshifted = (ix - ishift(i))
204 jx_unshifted = (jx - jshift(j))
205 alloc(
iadd(ix_unshifted,jx_unshifted)) = 1.
212 if (mptr .ne. 0)
go to 20
237 99
call reclam(locm, lenrect)
function igetsp(nwords)
Allocate contiguous space of length nword in main storage array alloc.
subroutine reclam(index, nwords)
integer, dimension(maxlv) iregsz
logical function basecheck(mnew, lbase, ilo, ihi, jlo, jhi, nvar, naux, thisBuff)
Check that potential grid mnew is completely contained in coarser grids at level lbase (>1) that will...
integer, parameter ndihi
global i index of right border of this grid
integer, dimension(maxlv) jregsz
integer, dimension(nsize, maxgr) node
integer, parameter nestlevel
AMR level of the grid.
integer pure function iadd(ivar, i, j)
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
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
The module contains the definition of a "node descriptor" as well as other global variables used duri...
real(kind=8), dimension(:), allocatable alloc