2D AMRCLAW
Functions/Subroutines
setPhysBndryFlags.f File Reference

Go to the source code of this file.

Functions/Subroutines

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 physical domain). More...
 

Function/Subroutine Documentation

◆ setphysbndryflags()

subroutine setphysbndryflags ( integer*1, dimension(ilo-mbuff:ihi+mbuff, jlo-mbuff:jhi+mbuff)  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 physical domain).

That way when shrink by 1 to get proper nested domain, you wont lose the first border cell of a grid

flag array uses 0-based index space

if periodic, then have to look elsewhere to see if last interior row/col that is flagged is ok. this is done in the calling routine that transfers flagged points to base grids

Parameters
iflagsarray that stores the flags for this grid
iloglobal i index of left border of the grid
ihiglobal i index of right border of the grid
jloglobal j index of lower border of the grid
jhiglobal j index of upper border of the grid
mbuffwidth of buffer zone
levelAMR level of the grid being flagged

Definition at line 29 of file setPhysBndryFlags.f.

References amr_module::iregsz, amr_module::jregsz, amr_module::xperdom, and amr_module::yperdom.

Referenced by griddomshrink(), and setdomflags().

29 
30  use amr_module
31  implicit double precision (a-h, o-z)
32 
33  integer*1 iflags(ilo-mbuff:ihi+mbuff, jlo-mbuff:jhi+mbuff)
34 
35  if (ilo-mbuff .lt. 0 .and. .not. xperdom) then ! grid extends out of left side of domain
36 c set left flagged points to be ok
37  do j = jlo-mbuff, jhi+mbuff
38  do i = ilo-mbuff, -1
39 c iflags(i,j) = iflags(0,j) ! extend using whatever 1st col inside is
40  iflags(i,j) = 1 ! set to 1 for bndry buffers that touch exterior domain
41  end do
42  end do
43  endif
44 
45  if (ihi+mbuff .ge. iregsz(level) .and. .not. xperdom) then
46 c set right flagged points to be ok
47  do j = jlo-mbuff, jhi+mbuff
48  do i = iregsz(level), ihi+mbuff
49 c iflags(i,j) = iflags(iregsz(level)-1,j)
50  iflags(i,j) = 1
51  end do
52  end do
53  endif
54 
55 
56  if (jlo-mbuff .lt. 0 .and. .not. yperdom) then
57 c set bottom flagged points to be ok
58  do j = jlo-mbuff, -1
59  do i = ilo-mbuff, ihi+mbuff
60 c iflags(i,j) = iflags(i,0)
61  iflags(i,j) = 1
62  end do
63  end do
64  endif
65 
66  if (jhi+mbuff .ge. jregsz(level) .and. .not. yperdom) then
67 c set top flagged points to be ok
68  do j = jregsz(level), jhi+mbuff
69  do i = ilo-mbuff, ihi+mbuff
70 c iflags(i,j) = iflags(i,jregsz(level)-1) ! extend using last flag in domain
71  iflags(i,j) = 1
72  end do
73  end do
74  endif
75 
76 
77  return
integer, dimension(maxlv) iregsz
Definition: amr_module.f90:198
integer, dimension(maxlv) jregsz
Definition: amr_module.f90:198
logical yperdom
Definition: amr_module.f90:230
logical xperdom
Definition: amr_module.f90:230
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 caller graph for this function: