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