Takes flagged points on all grids on level lcheck and pack their (i,j) cell centered indices into the badpts array.
Points in the badpts array are unique and sorted based on one dimensional packing of their 2D indices.
13 implicit double precision (a-h,o-z)
14 dimension badpts(2,len)
15 dimension ist(3), iend(3), jst(3), jend(3), ishift(3), jshift(3)
17 integer*8 largestintequiv
22 iadd(i,j) = locamrflags + i-(ilo-mbuff) + mibuff*(j-(jlo-mbuff))
62 mibuff = nx + 2 *mbuff
63 mjbuff = ny + 2 *mbuff
78 imax = min(ihi+mbuff,
iregsz(lcheck)-1)
82 jmax = min(jhi+mbuff,
jregsz(lcheck)-1)
101 . imin,imax,jmin,jmax,mptr)
110 939
format(
"NOT NESTED: ignoring point ",2i5)
111 write(*,*)
" still have neg points" 127 if (i .lt. 0) iwrap = i +
iregsz(lcheck)
132 if (j .lt. 0) jwrap = j +
jregsz(lcheck)
137 badpts(1,index) = dble(iwrap)+.5
138 badpts(2,index) = dble(jwrap)+.5
139 if (db)
write(
outunit,101) badpts(1,index), badpts(2,index)
151 call reclam(locamrflags,mibuff*mjbuff)
154 iflagsize = (mibuff*mjbuff)/ibytesperdp+1
160 if (mptr .ne. 0)
go to 10
165 write(
outunit,100) npts, lcheck,len
166 100
format( i9,
' flagged points initially colated on level ',i4,
167 .
" badpts len = ",i10)
179 largestintequiv =
iregsz(lcheck)+mbuff +
181 largestsingle = 2**30
182 if (largestintequiv .le. 0)
then 189 call drivesort(npts,badpts,lcheck,nuniquepts,mbuff)
subroutine reclam(index, nwords)
subroutine flagcheck(rectflags, ilo, ihi, jlo, jhi, mbuff, iflags,
Check if every cell in grid mptr is properly nested in base level grids (base level in current refine...
integer, dimension(maxlv) iregsz
integer, parameter ndihi
global i index of right border of this grid
integer, dimension(maxlv) jregsz
integer, dimension(nsize, maxgr) node
real(kind=8), parameter goodpt
integer pure function iadd(ivar, i, j)
integer, parameter domflags_base
domain flags, indexed within base level (lbase) index space
integer, parameter storeflags
pointer to the address of memory storing flags for refinement on this grid
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
integer, parameter outunit
subroutine drivesort(npts, badpts, level, index, mbuff)
Sort 2D points (stored in badpts) based on their equivalent integer value (based on their x...
integer, parameter ndjhi
global j index of upper border of this grid
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...
integer, parameter numflags
number of flagged cells on this grid
real(kind=8), dimension(:), allocatable alloc