After error estimation, need to tag the cell for refinement, buffer the tags, take care of level nesting, etc.
18 implicit double precision (a-h,o-z)
23 integer omp_get_thread_num, omp_get_max_threads
24 integer mythread/0/, maxthreads/1/
29 iadd(i,j) = locamrflags + i-1+ mibuff*(j-1)
87 call reclam(locbig,mitot*mjtot*nvar)
90 if (
eprint .and. maxthreads .eq. 1)
then 91 write(
outunit,*)
" flagged points before projec2",
92 . lcheck,
" grid ",mptr,
" (no buff cells)" 93 do j = mjbuff-mbuff, mbuff+1, -1
95 & i=mbuff+1,mibuff-mbuff)
107 if (lcheck+2 .le.
mxnest)
then 110 . ilo,ihi,jlo,jhi,mbuff)
114 if (
eprint .and. maxthreads .eq. 1)
then 115 write(
outunit,*)
" flagged points before buffering on level",
116 " grid ",mptr,
" (no buff cells)" 117 do 47 j = mjbuff-mbuff, mbuff+1, -1
119 & i=mbuff+1,mibuff-mbuff)
124 if (
eprint .and. maxthreads .eq. 1)
then 125 write(
outunit,*)
" flagged points after projecting to level",
127 .
"(withOUT buff cells)" 131 do 49 j = mjbuff-mbuff, mbuff+1, -1
133 . i=mbuff+1,mibuff-mbuff)
143 if (
eprint .and. maxthreads .eq. 1)
then 144 write(
outunit,*)
" flagged points after buffering on level",
145 . lcheck,
" grid ",mptr,
" (WITHOUT buff cells))" 146 do 51 j = mjbuff-mbuff, mbuff+1, -1
148 . i=mbuff+1, mibuff-mbuff)
158 numflagged=numflagged + 1
163 116
format(i5,
' points flagged on level ',i4,
' grid ',i4)
166 numbad = numbad + numflagged
174 locdomflags =
igetsp( (mibuff*mjbuff)/ibytesperdp+1)
175 locdom2 =
igetsp( (mibuff*mjbuff)/ibytesperdp+1)
180 . mbuff,lbase,lcheck,mibuff,mjbuff)
189 write(
outunit,*)
" total flagged points counted on level ",
190 . lcheck,
" is ",numbad
191 write(
outunit,*)
"this may include double counting buffer cells",
192 &
" on multiple grids" integer, parameter timemult
current simulation time on this grid
subroutine flagregions2(mx, my, mbuff, xlower, ylower, dx, dy, level, t, amrflags, DONTFLAG, DOFLAG)
Modify array of flagged points to respect minlevels and maxlevels specified by regions.
integer, parameter cornxlo
x-coordinate of the left border of this grid
function igetsp(nwords)
Allocate contiguous space of length nword in main storage array alloc.
integer, parameter tempptr
temporary pointer
subroutine reclam(index, nwords)
real(kind=8), dimension(maxlv) hyposs
real(kind=8), dimension(maxlv) hxposs
integer, parameter ndihi
global i index of right border of this grid
subroutine shiftset2(rectflags, ilo, ihi, jlo, jhi, mbuff)
For an input grid, flag cells near the previously flagged cells for creating buffer zone...
integer, dimension(nsize, maxgr) node
integer, dimension(0:maxlv+1) liststart
real(kind=8), parameter goodpt
integer, dimension(maxlv) numgrids
real(kind=8), dimension(rsize, maxgr) rnode
integer, dimension(maxgr) listofgrids
integer pure function iadd(ivar, i, j)
integer, parameter domflags_base
domain flags, indexed within base level (lbase) index space
subroutine projec2(level, numpro, rectflags, ilo, ihi, jlo, jhi, mbuff)
This subroutine projects all level level+2 grids to a level level grid and flag the cells being proje...
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
real(kind=8), parameter badpt
integer, parameter outunit
integer, parameter ndjhi
global j index of upper border of this grid
integer, parameter cornylo
y-coordinate of the lower border of this grid
subroutine setdomflags(mptr, igridflags, ilo, ihi, jlo, jhi, mbuff, lbase, lcheck, mibuff, mjbuff)
set domain flags (not AMR flags) for grid mptr (only), enlarged by buffer zone.
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