2D AMRCLAW
Functions/Subroutines
griddomshrink.f File Reference

Go to the source code of this file.

Functions/Subroutines

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 = lbase. More...
 

Function/Subroutine Documentation

◆ griddomshrink()

subroutine griddomshrink ( integer*1, dimension(ilo-mbuff:ihi+mbuff,jlo-mbuff:jhi+mbuff)  iflags2,
  ilo,
  ihi,
  jlo,
  jhi,
  mbuff,
integer*1, dimension (ilo-mbuff:ihi+mbuff,jlo-mbuff:jhi+mbuff)  iflags,
  level 
)

Shrink domain flags one cell for allowable properly nested domain This is needed even for lcheck = lbase.

More shrinking needed for finer levels. Flags starts in iflags2, should end in iflags array

The output iflags has flagged zone one cell smaller (shrinked) than input **iflags2.

The flags and indices, ilo, ihi, jlo and jhi are all with respect to level level index space

input:

  • iflags2 output:
  • iflags

Definition at line 26 of file griddomshrink.f.

References amr_module::dprint, amr_module::outunit, and setphysbndryflags().

Referenced by setdomflags().

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
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...
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
Here is the call graph for this function:
Here is the caller graph for this function: