2D AMRCLAW
intcopy.f
Go to the documentation of this file.
1 c
2 c --------------------------------------------------------------------
3 c
4  subroutine intcopy(val,mitot,mjtot,nvar,ilo,ihi,jlo,jhi,level,
5  & iputst,jputst)
6 
7  use amr_module
8  implicit double precision (a-h, o-z)
9 
10  dimension val(nvar,mitot,mjtot)
11 
12 
13 c OLD INDEXING
14 c iadd(i,j,ivar) = loc + i - 1 + mi*((ivar-1)*mj+j-1)
15 c NEW INDEXING ORDER SWITCHED
16  iadd(ivar,i,j) = loc + ivar-1 + nvar*((j-1)*mi+i-1)
17 
18 c ::::::::::::::::::::::::::: INTCOPY :::::::::::::::::::::::::::::::
19 c
20 c find intersecting grids at the same level. copy data from
21 c old grid to val.
22 c old grid has "nghost" ghost cells - passed in nodal common block.
23 c new grid has no ghost cells - indices describe entire patch.
24 c iputst, jputst: where to copy values into. may not be in
25 c location corresponding to ilo,ihi,etc. if
26 c the patch has been periodically wrapped.
27 c
28 c :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
29 
30 
31  mptr = lstart(level)
32 
33  10 if (mptr .eq. 0) go to 99
34  iglo = node(ndilo,mptr)
35  ighi = node(ndihi,mptr)
36  jglo = node(ndjlo,mptr)
37  jghi = node(ndjhi,mptr)
38 
39 c # does it intersect?
40  ixlo = max(iglo,ilo)
41  ixhi = min(ighi,ihi)
42  jxlo = max(jglo,jlo)
43  jxhi = min(jghi,jhi)
44 
45  if (ixlo .le. ixhi .and. jxlo .le. jxhi) then
46  loc = node(store1,mptr)
47  nx = ighi - iglo + 1
48  ny = jghi - jglo + 1
49  mi = nx + 2*nghost
50  mj = ny + 2*nghost
51  do 20 j = jxlo, jxhi
52  do 20 ivar = 1, nvar
53  do 30 i = ixlo, ixhi
54  val(ivar,iputst+i-ilo,jputst+j-jlo) =
55  1 alloc(iadd(ivar,i-iglo+nghost+1,j-jglo+nghost+1))
56  30 continue
57  20 continue
58  endif
59  mptr = node(levelptr, mptr)
60  go to 10
61 
62  99 return
63  end
integer pure function iadd(ivar, i, j)
Definition: intfil.f90:293
subroutine intcopy(val, mitot, mjtot, nvar, ilo, ihi, jlo, jhi, level, iputst, jputst)
Definition: intcopy.f:4