40 subroutine flagregions2(mx,my,mbuff,xlower,ylower,dx,dy,level,t, &
41 amrflags,DONTFLAG,DOFLAG)
48 integer,
intent(in) :: mx,my,level,mbuff
49 real(kind=8),
intent(in) :: xlower,ylower,dx,dy,t
52 real(kind=8),
intent(inout) :: amrflags(1-mbuff:mx+mbuff,1-mbuff:my+mbuff)
53 real(kind=8),
intent(in) :: DONTFLAG
54 real(kind=8),
intent(in) :: DOFLAG
57 integer :: i,j,m,i1,i2,j1,j2
58 real(kind=8) :: x_low,y_low,x_hi,y_hi, xupper,yupper
59 integer,
allocatable :: minlevel(:,:), maxlevel(:,:)
61 allocate(minlevel(mx,my), maxlevel(mx,my))
66 xupper = xlower + mx*dx
67 yupper = ylower + my*dy
74 if (xlower >=
regions(m)%x_hi .or. xupper <=
regions(m)%x_low)
then 77 i1 = max(floor((
regions(m)%x_low - xlower) / dx) + 1, 1)
78 i2 = min(floor((
regions(m)%x_hi -xlower) / dx) + 1, mx)
81 if (ylower >=
regions(m)%y_hi .or. yupper <=
regions(m)%y_low)
then 84 j1 = max(floor((
regions(m)%y_low - ylower) / dy) + 1, 1)
85 j2 = min(floor((
regions(m)%y_hi - ylower) / dy) + 1, my)
90 minlevel(i,j) = max(minlevel(i,j),
regions(m)%min_level)
91 maxlevel(i,j) = max(maxlevel(i,j),
regions(m)%max_level)
98 if (minlevel(i,j) > maxlevel(i,j))
then 99 write(6,*)
'*** Error: this should never happen!' 100 write(6,*)
'*** minlevel > maxlevel in flagregions' 104 if (maxlevel(i,j) /= 0)
then 107 if (level < minlevel(i,j))
then 109 amrflags(i,j) = doflag
110 else if (level >= maxlevel(i,j))
then 112 amrflags(i,j) = dontflag
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.
type(region_type), dimension(:), allocatable regions