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