2D AMRCLAW
fluxad.f
Go to the documentation of this file.
1 c
2 c -------------------------------------------------------
3 c
4  subroutine fluxad(xfluxm,xfluxp,yfluxm,yfluxp,
5  1 svdflx,mptr,mitot,mjtot,
6  2 nvar,lenbc,lratiox,lratioy,ng,dtf,dx,dy)
7 c
8 
9  use amr_module
10  implicit double precision (a-h,o-z)
11 
12 
13 c :::::::::::::::::::: FLUXAD ::::::::::::::::::::::::::::::::::
14 c save fine grid fluxes at the border of the grid, for fixing
15 c up the adjacent coarse cells. at each edge of the grid, only
16 c save the plus or minus fluxes, as necessary. For ex., on
17 c left edge of fine grid, it is the minus xfluxes that modify the
18 c coarse cell.
19 c :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
20 
21  dimension xfluxm(nvar,mitot,mjtot), yfluxm(nvar,mitot,mjtot)
22  dimension xfluxp(nvar,mitot,mjtot), yfluxp(nvar,mitot,mjtot)
23  dimension svdflx(nvar,lenbc)
24 
25  nx = mitot-2*ng
26  ny = mjtot-2*ng
27  nyc = ny/lratioy
28  nxc = nx/lratiox
29 
30 c ::::: left side saved first
31  lind = 0
32 
33  do 100 j=1,nyc
34  lind = lind + 1
35  jfine = (j-1)*lratioy + ng
36  do 110 ivar = 1, nvar
37  do 120 l=1,lratioy
38  svdflx(ivar,lind) = svdflx(ivar,lind) +
39  1 xfluxm(ivar,ng+1,jfine+l)*dtf*dy
40 c write(dbugunit,900)lind,xfluxm(ivar,1,jfine+l),
41 c . xfluxp(ivar,1,jfine+l)
42  900 format(' lind ', i4,' m & p ',2e15.7,' svd ',e15.7)
43 120 continue
44 110 continue
45 100 continue
46 
47 c ::::: top side
48 c write(dbugunit,*)" saving top side "
49  do 200 i=1,nxc
50  lind = lind + 1
51  ifine = (i-1)*lratiox + ng
52  do 210 ivar = 1, nvar
53  do 220 l=1,lratiox
54  svdflx(ivar,lind) = svdflx(ivar,lind) +
55  1 yfluxp(ivar,ifine+l,mjtot-ng+1)*dtf*dx
56 c write(dbugunit,900)lind,yfluxm(ivar,ifine+l,mjtot-ng+1,
57 c . ),yfluxp(ivar,ifine+l,mjtot-ng+1),
58 c . svdflx(ivar,lind)
59 220 continue
60 210 continue
61 200 continue
62 
63 c ::::: right side
64  do 300 j=1,nyc
65  lind = lind + 1
66  jfine = (j-1)*lratioy + ng
67  do 310 ivar = 1, nvar
68  do 320 l=1,lratioy
69  svdflx(ivar,lind) = svdflx(ivar,lind) +
70  1 xfluxp(ivar,mitot-ng+1,jfine+l)*dtf*dy
71 c write(dbugunit,900)lind,xfluxm(ivar,mitot-ng+1,jfine+l,
72 c ),xfluxp(ivar,mitot-ng+1,jfine+l)
73 320 continue
74 310 continue
75 300 continue
76 
77 c ::::: bottom side
78 c write(dbugunit,*)" saving bottom side "
79  do 400 i=1,nxc
80  lind = lind + 1
81  ifine = (i-1)*lratiox + ng
82  do 410 ivar = 1, nvar
83  do 420 l=1,lratiox
84  svdflx(ivar,lind) = svdflx(ivar,lind) +
85  1 yfluxm(ivar,ifine+l,ng+1)*dtf*dx
86 c write(dbugunit,900)lind,yfluxm(ivar,ifine+l,ng+1),
87 c . yfluxp(ivar,ifine+l,ng+1),svdflx(ivar,lind)
88 420 continue
89 410 continue
90 400 continue
91 
92  return
93  end
subroutine fluxad(xfluxm, xfluxp, yfluxm, yfluxp, svdflx, mptr, mitot, mjtot, nvar, lenbc, lratiox, lratioy, ng, dtf, dx, dy)
Definition: fluxad.f:4