2D AMRCLAW
griddomshrink.f
Go to the documentation of this file.
1 c
2 c ----------------------------------------------------
3 c
4  subroutine griddomshrink(iflags2,ilo,ihi,jlo,jhi,mbuff,iflags,
5  . level)
6 
7  use amr_module
8  implicit double precision (a-h, o-z)
9 
10 
11  integer*1 iflags (ilo-mbuff:ihi+mbuff,jlo-mbuff:jhi+mbuff)
12  integer*1 iflags2(ilo-mbuff:ihi+mbuff,jlo-mbuff:jhi+mbuff)
13 
14 
15 c
16 c ::::::::::::::::::::::::: GRIDDOMSHRINK ::::::::::::::::::::::::::::
17 c
18 c shrink domain flags one cell for allowable properly nested domain
19 c This is needed even for lcheck = lbase. More shrinking needed
20 c for finer levels.
21 c flags starts in iflags2, should end in iflags array
22 c
23 c :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
24 
25  if (dprint) then
26  write(outunit,*)" from griddomshrink: on entry, iflags2"
27  do 10 j = jhi+mbuff,jlo-mbuff,-1
28  write(outunit,100)(iflags2(i,j),i=ilo-mbuff,ihi+mbuff)
29  100 format(80i1)
30  10 continue
31  endif
32 
33 c NB this untagging alg. includes corner cells in determining proper
34 c nesting. not always nec., or always done
35  do 40 j = jlo-mbuff+1,jhi+mbuff-1
36  do 40 i = ilo-mbuff+1,ihi+mbuff-1
37  iflags(i,j) = iflags2(i,j)
38  if (iflags2(i ,j ) .le. 0 .or.
39  1 iflags2(i+1,j ) .le. 0 .or. iflags2(i-1,j ) .le. 0 .or.
40  2 iflags2(i+1,j+1) .le. 0 .or. iflags2(i-1,j+1) .le. 0 .or.
41  3 iflags2(i ,j-1) .le. 0 .or. iflags2(i ,j+1) .le. 0 .or.
42  4 iflags2(i+1,j-1) .le. 0 .or. iflags2(i-1,j-1) .le. 0) then
43  iflags(i,j) = 0
44  endif
45  iflags(ilo-mbuff,j) = 0 ! set last border to 0 instead of leaving uninitialized
46  iflags(ihi+mbuff,j) = 0
47  40 continue
48  do i = ilo-mbuff,ihi+mbuff ! finish zeroing out first and last col
49  iflags(i,jlo-mbuff) = 0
50  iflags(i,jhi+mbuff) = 0
51  end do
52 
53 c dont need to handle periodicity here. Setting of initial grid included enough room to shrink 1
54 c for proper nesting. If expand up then will need to add periodic domain flagging
55 
56 c
57 c if border of domain touches a physical boundary then set domain in
58 c ghost cell as well
59 c
60  call setphysbndryflags(iflags,ilo,ihi,jlo,jhi,mbuff,level)
61 
62  99 if (dprint) then
63  write(outunit,*)" from griddomshrink: on exit, iflags"
64  do 70 j = jhi+mbuff-1, jlo-mbuff+1, -1
65  write(outunit,101)(iflags(i,j),i=ilo-mbuff+1,ihi+mbuff-1)
66  101 format(80i1)
67  70 continue
68  endif
69 
70  return
71  end
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...
subroutine griddomshrink(iflags2, ilo, ihi, jlo, jhi, mbuff, iflags, level)
Definition: griddomshrink.f:4