2D AMRCLAW
Functions/Subroutines
domprep.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine domprep (domflags, lbase, ibase, jbase)
 

Function/Subroutine Documentation

◆ domprep()

subroutine domprep ( integer(kind=1), dimension(0:ibase+1,0:jbase+1)  domflags,
  lbase,
  ibase,
  jbase 
)

prepare 2 dimensional array of domain for proper nesting

Definition at line 5 of file domprep.f.

References amr_module::dprint, amr_module::levelptr, amr_module::lstart, amr_module::ndihi, amr_module::ndilo, amr_module::ndjhi, amr_module::ndjlo, amr_module::node, amr_module::outunit, amr_module::spheredom, amr_module::xperdom, and amr_module::yperdom.

5 
6  use amr_module
7  implicit double precision (a-h, o-z)
8 
9 
10  integer(kind=1) domflags(0:ibase+1,0:jbase+1)
11 
12 c
13 c ::::::::::::::::::::::::::: PREPDOM :::::::::::::::::::::
14 c
16 c
17 c :::::::::::::::::::::::::::::::::::::::::::::::::::::::
18 
19 
20  do 10 j = 0, jbase+1
21  do 10 i = 0, ibase+1
22  domflags(i,j) = 0
23  10 continue
24 
25  mptr = lstart(lbase)
26  15 continue
27 c domain flags appears to be 1 based indexing, so 0 a ghost cell.
28 c should change it to be 0 based, like grids, so border is at -1.
29  do 20 j = node(ndjlo,mptr) + 1, node(ndjhi,mptr) + 1
30  do 20 i = node(ndilo,mptr) + 1, node(ndihi,mptr) + 1
31  domflags(i,j) = 1
32  20 continue
33  mptr = node(levelptr, mptr)
34  if (mptr .ne. 0) go to 15
35 
36 c
37 c take care of periodic domains or if border of domain touches a
38 c physical boundary then set domain in ghost cell as well
39 c
40  if (xperdom) then
41  do 25 j = 0, jbase+1
42  domflags(0,j) = domflags(ibase,j)
43  domflags(ibase+1,j) = domflags(1,j)
44  25 continue
45  else
46  do 65 j = 1, jbase
47  domflags(0,j) = domflags(1,j)
48  domflags(ibase+1,j) = domflags(ibase,j)
49  65 continue
50  endif
51  if (yperdom) then
52  do 35 i = 0, ibase+1
53  domflags(i,0) = domflags(i,jbase)
54  domflags(i,jbase+1) = domflags(i,1)
55  35 continue
56  else if (spheredom) then
57  do 36 i = 0, ibase+1
58  domflags(i,0) = domflags(ibase+1-i,1)
59  domflags(i,jbase+1) = domflags(ibase+1-i,jbase)
60  36 continue
61  else
62  do 55 i = 1, ibase
63  domflags(i,0) = domflags(i,1)
64  domflags(i,jbase+1) = domflags(i,jbase)
65  55 continue
66  endif
67 c
68 c the 4 corners
69 c
70  if (domflags(0,1)+domflags(1,0) .eq. 2) domflags(0,0)=1
71  if (domflags(ibase,0)+domflags(ibase+1,1) .eq. 2)
72  . domflags(ibase+1,0)=1
73  if (domflags(ibase,jbase+1)+domflags(ibase+1,jbase) .eq. 2)
74  . domflags(ibase+1,jbase+1)=1
75  if (domflags(0,jbase)+domflags(1,jbase+1) .eq. 2)
76  . domflags(0,jbase+1)=1
77 
78  if (dprint) then
79  write(outunit,*)" from domprep: domflags at level ", lbase
80  do 40 jj = 1, jbase
81  j = jbase + 1 - jj
82  write(outunit,100)(domflags(i,j),i=1,ibase)
83  100 format(80i1)
84  40 continue
85  endif
86 
87  return
integer, parameter ndihi
global i index of right border of this grid
Definition: amr_module.f90:111
integer, dimension(nsize, maxgr) node
Definition: amr_module.f90:198
logical yperdom
Definition: amr_module.f90:230
integer, parameter ndilo
global i index of left border of this grid
Definition: amr_module.f90:108
integer, parameter ndjlo
global j index of lower border of this grid
Definition: amr_module.f90:114
logical spheredom
Definition: amr_module.f90:230
integer, dimension(maxlv) lstart
Definition: amr_module.f90:198
integer, parameter outunit
Definition: amr_module.f90:290
integer, parameter ndjhi
global j index of upper border of this grid
Definition: amr_module.f90:117
logical dprint
Definition: amr_module.f90:297
logical xperdom
Definition: amr_module.f90:230
integer, parameter levelptr
node number (index) of next grid on the same level
Definition: amr_module.f90:35
The module contains the definition of a "node descriptor" as well as other global variables used duri...
Definition: amr_module.f90:21