8 c ----------------------------------------------------------
10 subroutine fluxsv(mptr,xfluxm,xfluxp,yfluxm,yfluxp,listbc,
11 1 ndimx,ndimy,nvar,maxsp,dtc,hx,hy)
14 implicit double precision (a-h,o-z)
17 dimension xfluxp(nvar,ndimx,ndimy), yfluxp(nvar,ndimx,ndimy)
18 dimension xfluxm(nvar,ndimx,ndimy), yfluxm(nvar,ndimx,ndimy)
19 dimension listbc(5,maxsp)
21 c ::::::::::::::::::::
fluxsv :::::::::::::::::::::::::
23 c coarse grids should
save their fluxes in cells adjacent to
24 c their nested fine grids, for later conservation fixing.
25 c listbc holds info for
where to
save which fluxes.
26 c xflux holds
'f' fluxes, yflux holds
'g' fluxes.
28 c :::::::::::::::::::::::::::::;:::::::::::::::::::::::
34 10
if (listbc(1,ispot).eq.0)
go to 99
36 mkid = listbc(4,ispot)
37 intopl = listbc(5,ispot)
43 inlist = kidlst + nvar*(intopl-1) - 1
45 c side k(listbc 3) has which side of coarse cell has
interface 46 c so can
save appropriate fluxes. (dont know why we didnt have
47 c which flux to
save directly(i.e. put i+1,j to
save that flux
48 c rather than putting in cell center coords).
50 if (listbc(3,ispot) .eq. 1)
then 51 c ::::: cell i,j is on right side of a fine grid
53 alloc(inlist + ivar) = -xfluxp(ivar,i,j)*dtc*hy
55 c
write(
dbugunit,901) i,j,1,(xfluxp(ivar,i,j),ivar=1,nvar)
58 if (listbc(3,ispot) .eq. 2)
then 59 c ::::: cell i,j on bottom side of fine grid
61 alloc(inlist + ivar) = -yfluxm(ivar,i,j+1)*dtc*hx
63 c
write(
dbugunit,901) i,j,2,(yfluxm(ivar,i,j+1),ivar=1,nvar)
66 if (listbc(3,ispot) .eq. 3)
then 67 c ::::: cell i,j on left side of fine grid
69 alloc(inlist + ivar) = -xfluxm(ivar,i+1,j)*dtc*hy
71 c
write(
dbugunit,901) i,j,3,(xfluxm(ivar,i+1,j),ivar=1,nvar)
74 if (listbc(3,ispot) .eq. 4)
then 75 c ::::: cell i,j on top side of fine grid
77 alloc(inlist + ivar) = -yfluxp(ivar,i,j)*dtc*hx
79 c
write(
dbugunit,901) i,j,4,(yfluxp(ivar,i,j),ivar=1,nvar)
82 c
### new bcs 5 and 6 come from spherical mapping. note sign change: 83 c
### previous fluxes stored negative flux, fine grids always add 84 c
### their flux, then the delta is either added or subtracted as 85 c
### appropriate for that side. New bc adds or subtracts BOTH fluxes. 87 if (listbc(3,ispot) .eq. 5)
then 88 c ::::: cell i,j on top side of fine grid with spherical mapped bc
90 alloc(inlist + ivar) = yfluxm(ivar,i,j+1)*dtc*hx
92 c
write(
dbugunit,901) i,j,5,(yfluxm(ivar,i,j+1),ivar=1,nvar)
93 901
format(2i4,
" side",i3,4e15.7)
96 if (listbc(3,ispot) .eq. 6)
then 97 c ::::: cell i,j on bottom side of fine grid with spherical mapped bc
99 alloc(inlist + ivar) = yfluxp(ivar,i,j)*dtc*hx
101 c
write(
dbugunit,901) i,j,6,(yfluxp(ivar,i,j),ivar=1,nvar)
105 if (ispot .gt. maxsp)
go to 99
integer, parameter dbugunit
integer, parameter ndihi
global i index of right border of this grid
integer, dimension(nsize, maxgr) node
integer, parameter nestlevel
AMR level of the grid.
integer, parameter ndilo
global i index of left border of this grid
integer, parameter ndjlo
global j index of lower border of this grid
subroutine fluxsv(mptr, xfluxm, xfluxp, yfluxm, yfluxp, listbc,
When a coarse grid cell is advanced, if it borders a coarse-fine interface, the flux or wave that emi...
integer, parameter ndjhi
global j index of upper border of this grid
The module contains the definition of a "node descriptor" as well as other global variables used duri...
real(kind=8), dimension(:), allocatable alloc
integer, parameter ffluxptr
pointer to the address of memory storing fluxes in a layer around the grid, to be used in conservatio...