2D AMRCLAW
Functions/Subroutines
griddomup.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine griddomup (iflags, iflags2, ilo, ihi, jlo, jhi, mbuff, lev, ilofine, ihifine, jlofine, jhifine)
 iflags described flagged cells in a rectangular region described by ilo, ihi, jlo, jhi in level lev index space This subroutine projects iflags to iflag, which has flagging information in a rectangular region described by ilofine, ihifine, jlofine, jhifine in level lev+1 index space More...
 

Function/Subroutine Documentation

◆ griddomup()

subroutine griddomup ( integer*1, dimension (ilo-mbuff:ihi+mbuff,jlo-mbuff:jhi+mbuff)  iflags,
integer*1, dimension(ilofine-mbuff:ihifine+mbuff, jlofine-mbuff:jhifine+mbuff)  iflags2,
  ilo,
  ihi,
  jlo,
  jhi,
  mbuff,
  lev,
  ilofine,
  ihifine,
  jlofine,
  jhifine 
)

iflags described flagged cells in a rectangular region described by ilo, ihi, jlo, jhi in level lev index space This subroutine projects iflags to iflag, which has flagging information in a rectangular region described by ilofine, ihifine, jlofine, jhifine in level lev+1 index space

input:

  • iflags output:
  • iflags2

Definition at line 18 of file griddomup.f.

References amr_module::dprint, amr_module::intratx, amr_module::intraty, and amr_module::outunit.

Referenced by setdomflags().

18 
19  use amr_module
20  implicit double precision (a-h, o-z)
21 
22  integer*1 iflags (ilo-mbuff:ihi+mbuff,jlo-mbuff:jhi+mbuff)
23  integer*1 iflags2(ilofine-mbuff:ihifine+mbuff,
24  . jlofine-mbuff:jhifine+mbuff)
25 
26 c
27 c ::::::::::::::::::::::::::: DOMUP :::::::::::::::::::::
28 c
29 c domain flags for THIS GRID are in iflags. copy into iflags2, which is
30 c at a different level, dimensions differently
31 c
32 c :::::::::::::::::::::::::::::::::::::::::::::::::::::::
33 
34  if (dprint) then
35  write(outunit,*)" from griddomup: flags (before expansion,",
36  . " with buff cells)"
37  do 5 j=jhi+mbuff,jlo-mbuff,-1
38  write(outunit,100)(iflags(i,j),i=ilo-mbuff,ihi+mbuff)
39  5 continue
40  endif
41 c
42  lratiox = intratx(lev)
43  lratioy = intraty(lev)
44 
45  do 10 j = jlofine-mbuff,jhifine+mbuff
46  do 10 i = ilofine-mbuff,ihifine+mbuff
47  iflags2(i,j) = 0
48  10 continue
49 
50 c
51 c careful with buffer - cant just take coarse grid buffer and refine it
52 c since have same size buffer on finer grid
53  do 20 j = jlo,jhi
54  do 20 i = ilo,ihi
55  ifine = i * lratiox - 1 ! subtract 1 so can add in next loop
56  jfine = j * lratioy - 1
57  do 15 mj = 1, lratioy
58  do 15 mi = 1, lratiox
59  iset = min(ifine+mi,ihifine+mbuff) ! might as well include buffer, though done later
60  jset = min(jfine+mj,jhifine+mbuff) ! needed since grids dont align over many levels
61  iset = max(iset,ilofine-mbuff) ! but so expensive
62  jset = max(jset,jlofine-mbuff)
63  iflags2(iset,jset) = iflags(i,j)
64  15 continue
65  20 continue
66 c
67 c need to be careful due to possibly odd buffer size
68 c cant just take coarse cell and do all fine fine cells within, as above loop
69 c
70 c handle left and right buffer zones
71  do 25 j = jlofine-mbuff, jhifine+mbuff
72  do 23 i = ihifine+1, ihifine+mbuff
73 c get coarse indices for fine pt. i,j (in buffer zone)
74  ic = i/lratiox
75  jc = j/lratioy
76  iflags2(i,j) = iflags(ic,jc)
77  23 continue
78  do 24 i = ilofine-mbuff, ilofine-1
79 c get coarse indices for fine pt. i,j (in buffer zone)
80  ic = i/lratiox
81  jc = j/lratioy
82  iflags2(i,j) = iflags(ic,jc)
83  24 continue
84  25 continue
85 
86 c handle top and bottom buffer zones
87  do 33 i = ilofine, ihifine
88  do 35 j = jlofine-mbuff, jlofine-1
89 c get coarse indices for fine pt. i,j (in buffer zone)
90  ic = i/lratiox
91  jc = j/lratioy
92  iflags2(i,j) = iflags(ic,jc)
93  35 continue
94  do 34 j = jhifine+1, jhifine+mbuff
95 c get coarse indices for fine pt. i,j (in buffer zone)
96  ic = i/lratiox
97  jc = j/lratioy
98  iflags2(i,j) = iflags(ic,jc)
99  34 continue
100  33 continue
101 c
102 c do not need to do something special for periodicity. already taken into account when
103 c setting enlarged grid woth buffer zone at level lbase
104 c
105  90 continue
106  if (dprint) then
107  write(outunit,*)"from griddomup: flags (after ref 1 level up,",
108  . "with buff cells)"
109  do 70 j = jlofine-mbuff,jhifine+mbuff,-1
110  write(outunit,100)(iflags2(i,j),i=ilofine-mbuff,ihifine+mbuff)
111  100 format(80i1)
112  70 continue
113  endif
114 
115  return
integer, dimension(maxlv) intraty
Definition: amr_module.f90:198
integer, parameter outunit
Definition: amr_module.f90:290
logical dprint
Definition: amr_module.f90:297
integer, dimension(maxlv) intratx
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: