2D AMRCLAW
fluxsv.f
Go to the documentation of this file.
1 c
2 c ----------------------------------------------------------
3 c
4  subroutine fluxsv(mptr,xfluxm,xfluxp,yfluxm,yfluxp,listbc,
5  1 ndimx,ndimy,nvar,maxsp,dtc,hx,hy)
6 c
7  use amr_module
8  implicit double precision (a-h,o-z)
9 
10 
11  dimension xfluxp(nvar,ndimx,ndimy), yfluxp(nvar,ndimx,ndimy)
12  dimension xfluxm(nvar,ndimx,ndimy), yfluxm(nvar,ndimx,ndimy)
13  dimension listbc(5,maxsp)
14 c
15 c :::::::::::::::::::: FLUXSV :::::::::::::::::::::::::
16 c
17 c coarse grids should save their fluxes in cells adjacent to
18 c their nested fine grids, for later conservation fixing.
19 c listbc holds info for where to save which fluxes.
20 c xflux holds 'f' fluxes, yflux holds 'g' fluxes.
21 c
22 c :::::::::::::::::::::::::::::;:::::::::::::::::::::::
23 
24 
25  ispot = 1
26  level = node(nestlevel,mptr)
27 
28  10 if (listbc(1,ispot).eq.0) go to 99
29 c
30  mkid = listbc(4,ispot)
31  intopl = listbc(5,ispot)
32  nx = node(ndihi,mkid) - node(ndilo,mkid) + 1
33  ny = node(ndjhi,mkid) - node(ndjlo,mkid) + 1
34  kidlst = node(ffluxptr,mkid)
35  i = listbc(1,ispot)
36  j = listbc(2,ispot)
37  inlist = kidlst + nvar*(intopl-1) - 1
38 c
39 c side k (listbc 3) has which side of coarse cell has interface
40 c so can save appropriate fluxes. (dont know why we didnt have
41 c which flux to save directly (i.e. put i+1,j to save that flux
42 c rather than putting in cell center coords).
43 
44  if (listbc(3,ispot) .eq. 1) then
45 c ::::: Cell i,j is on right side of a fine grid
46  do 100 ivar = 1, nvar
47  alloc(inlist + ivar) = -xfluxp(ivar,i,j)*dtc*hy
48 100 continue
49 c write(dbugunit,901) i,j,1,(xfluxp(ivar,i,j),ivar=1,nvar)
50  endif
51 
52  if (listbc(3,ispot) .eq. 2) then
53 c ::::: Cell i,j on bottom side of fine grid
54  do 200 ivar = 1, nvar
55  alloc(inlist + ivar) = -yfluxm(ivar,i,j+1)*dtc*hx
56 200 continue
57 c write(dbugunit,901) i,j,2,(yfluxm(ivar,i,j+1),ivar=1,nvar)
58  endif
59 
60  if (listbc(3,ispot) .eq. 3) then
61 c ::::: Cell i,j on left side of fine grid
62  do 300 ivar = 1, nvar
63  alloc(inlist + ivar) = -xfluxm(ivar,i+1,j)*dtc*hy
64 300 continue
65 c write(dbugunit,901) i,j,3,(xfluxm(ivar,i+1,j),ivar=1,nvar)
66  endif
67 
68  if (listbc(3,ispot) .eq. 4) then
69 c ::::: Cell i,j on top side of fine grid
70  do 400 ivar = 1, nvar
71  alloc(inlist + ivar) = -yfluxp(ivar,i,j)*dtc*hx
72 400 continue
73 c write(dbugunit,901) i,j,4,(yfluxp(ivar,i,j),ivar=1,nvar)
74  endif
75 c
76 c ### new bcs 5 and 6 come from spherical mapping. note sign change:
77 c ### previous fluxes stored negative flux, fine grids always add
78 c ### their flux, then the delta is either added or subtracted as
79 c ### appropriate for that side. New bc adds or subtracts BOTH fluxes.
80 c
81  if (listbc(3,ispot) .eq. 5) then
82 c ::::: Cell i,j on top side of fine grid with spherical mapped bc
83  do 500 ivar = 1, nvar
84  alloc(inlist + ivar) = yfluxm(ivar,i,j+1)*dtc*hx
85 500 continue
86 c write(dbugunit,901) i,j,5,(yfluxm(ivar,i,j+1),ivar=1,nvar)
87  901 format(2i4," side",i3,4e15.7)
88  endif
89 c
90  if (listbc(3,ispot) .eq. 6) then
91 c ::::: Cell i,j on bottom side of fine grid with spherical mapped bc
92  do 600 ivar = 1, nvar
93  alloc(inlist + ivar) = yfluxp(ivar,i,j)*dtc*hx
94 600 continue
95 c write(dbugunit,901) i,j,6,(yfluxp(ivar,i,j),ivar=1,nvar)
96  endif
97 
98  ispot = ispot + 1
99  if (ispot .gt. maxsp) go to 99
100  go to 10
101 c
102  99 return
103  end
subroutine fluxsv(mptr, xfluxm, xfluxp, yfluxm, yfluxp, listbc, ndimx, ndimy, nvar, maxsp, dtc, hx, hy)
Definition: fluxsv.f:4