2D AMRCLAW
Functions/Subroutines
shiftset2.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine shiftset2 (rectflags, ilo, ihi, jlo, jhi, mbuff)
 For an input grid, flag cells near the previously flagged cells for creating buffer zone. More...
 

Function/Subroutine Documentation

◆ shiftset2()

subroutine shiftset2 ( dimension(ilo-mbuff:ihi+mbuff,jlo-mbuff:jhi+mbuff)  rectflags,
  ilo,
  ihi,
  jlo,
  jhi,
  mbuff 
)

For an input grid, flag cells near the previously flagged cells for creating buffer zone.

Shift by + or - 1 in either direction to do bitwise calculus for proper nesting, buffering, etc. similar to cshift on CM machine. includes periodic buffering as well.

NEWER VERSION: DOES ALL DIRS AT SAME TIME rectflags array has been augmented by enough border cells to do buffering in place in the grid later will look to see if flagged pts are properly nested

Parameters
rectflagsarray to be flagged
iloglobal i index of the left border of the grid being projected to (being flagged)
ihiglobal i index of the right border of the grid being projected to (being flagged)
jloglobal j index of the lower border of the grid being projected to (being flagged)
jhiglobal i index of the upper border of the grid being projected to (being flagged)
mbuffwidth of the buffer zone

Definition at line 26 of file shiftset2.f.

References amr_module::ibuff.

Referenced by bufnst2().

26 
27  use amr_module
28  implicit double precision (a-h, o-z)
29  dimension rectflags(ilo-mbuff:ihi+mbuff,jlo-mbuff:jhi+mbuff)
30  dimension copyflags(ilo-mbuff:ihi+mbuff,jlo-mbuff:jhi+mbuff)
31 
32  do j = jlo-mbuff, jhi+mbuff
33  do i = ilo-mbuff, ihi+mbuff
34  copyflags(i,j) = 0
35  end do
36  end do
37 
38 c note: not looking at ghost cells, only real cells should be flagged
39 c but can buffer the flags into the ghost zone
40  do j = jlo, jhi
41  do i = ilo, ihi
42  rflag = rectflags(i,j)
43  if (rflag .gt. 0) then
44 c cell is flagged, buffer in all dirs by ibuff
45 c(note this is not nec same as mbuff)
46 c use second array to avoid propagation
47  mlo = i - ibuff
48  mhi = i + ibuff
49  klo = j - ibuff
50  khi = j + ibuff
51  do k = klo, khi
52  do m = mlo, mhi
53  copyflags(m,k) = rflag ! copy the flag (doesnt distinguish buffer flag from orig flag)
54  end do
55  end do
56  endif
57 
58  end do
59  end do
60 
61 
62 c copy back. need flags in original array, not temp scratch array
63 
64  do 60 j = jlo-mbuff, jhi+mbuff
65  do 60 i = ilo-mbuff, ihi+mbuff
66  rectflags(i,j) = copyflags(i,j)
67  60 continue
68 
69 
70  return
integer ibuff
Definition: amr_module.f90:198
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: