For each coarse-fine interface, a Riemann problem between an inner ghost cell value on the fine grid and cell value in the adjacent coarse cell must be solved and added to corresponding location in node(ffluxptr, mptr) for conservative fix later.
14 implicit double precision (a-h, o-z)
19 dimension valbig(nvar,mitot,mjtot)
20 dimension qc1d(nvar,lenbc)
21 dimension svdflx(nvar,lenbc)
22 dimension aux(maux,mitot,mjtot)
23 dimension auxc1d(maux,lenbc)
44 parameter(max1dp1 =
max1d+1)
45 dimension ql(nvar,max1dp1), qr(nvar,max1dp1)
47 dimension amdq(nvar,max1dp1), apdq(nvar,max1dp1)
54 iaddaux(iaux,i) = iaux + maux*(i-1)
67 .
write(
dbugunit,*)
" working on grid ",mptr,
" time ",tgrid
81 if (
auxtype(ma).eq.
"xleft")
then 97 ncrse = (mjtot-2*
nghost)/lratioy
104 auxr(iaddaux(ma,lind)) = auxc1d(ma,index)
108 25 qr(ivar,lind) = qc1d(ivar,index)
112 write(
dbugunit,*)
'side 1, ql and qr:' 114 write(
dbugunit,4101) i,qr(1,i-1),ql(1,i)
116 4101
format(i3,4e16.6)
117 if (maux .gt. 0)
then 120 write(
dbugunit,4101) i,(auxr(iaddaux(ma,i-1)),ma=1,maux)
124 write(
dbugunit,4101) i,(auxl(iaddaux(ma,i)),ma=1,maux)
130 . nc+1-2*
nghost,ql,qr,auxl,auxr,wave,s,amdq,apdq)
135 do 30 j = 1, nc/lratioy
137 jfine = (j-1)*lratioy
140 svdflx(ivar,influx) = svdflx(ivar,influx)
141 . + amdq(ivar,jfine+l+1) * hy * delt
142 . + apdq(ivar,jfine+l+1) * hy * delt
151 if (mjtot .eq. 2*
nghost+1)
then 165 do 210 ivar = 1, nvar
170 ncrse = (mitot-2*
nghost)/lratiox
173 do 225 l = 1, lratiox
177 if (
auxtype(ma).eq.
"yleft")
then 180 ifine = (ic-1)*lratiox +
nghost + l
181 auxl(iaddaux(ma,lind+1)) = aux(ma,ifine,mjtot-
nghost+1)
183 auxl(iaddaux(ma,lind+1)) = auxc1d(ma,index)
187 do 225 ivar = 1, nvar
188 225 ql(ivar,lind+1) = qc1d(ivar,index)
192 write(
dbugunit,*)
'side 2, ql and qr:' 194 write(
dbugunit,4101) i,ql(1,i+1),qr(1,i)
196 if (maux .gt. 0)
then 199 write(
dbugunit,4101) i, (auxr(iaddaux(ma,i)),ma=1,maux)
203 write(
dbugunit,4101) i, (auxl(iaddaux(ma,i)),ma=1,maux)
208 . nr+1-2*
nghost,ql,qr,auxl,auxr,wave,s,amdq,apdq)
212 do 230 i = 1, nr/lratiox
214 ifine = (i-1)*lratiox
215 do 240 ivar = 1, nvar
216 do 250 l = 1, lratiox
217 svdflx(ivar,influx) = svdflx(ivar,influx)
218 . - amdq(ivar,ifine+l+1) * hx * delt
219 . - apdq(ivar,ifine+l+1) * hx * delt
236 do 310 ivar = 1, nvar
241 ncrse = (mjtot-2*
nghost)/lratioy
244 do 325 l = 1, lratioy
248 if (
auxtype(ma).eq.
"xleft")
then 251 jfine = (jc-1)*lratioy +
nghost + l
252 auxl(iaddaux(ma,lind+1)) = aux(ma,mitot-
nghost+1,jfine)
254 auxl(iaddaux(ma,lind+1)) = auxc1d(ma,index)
258 do 325 ivar = 1, nvar
259 325 ql(ivar,lind+1) = qc1d(ivar,index)
263 write(
dbugunit,*)
'side 3, ql and qr:' 265 write(
dbugunit,4101) i,ql(1,i),qr(1,i)
269 . nc+1-2*
nghost,ql,qr,auxl,auxr,wave,s,amdq,apdq)
273 do 330 j = 1, nc/lratioy
275 jfine = (j-1)*lratioy
276 do 340 ivar = 1, nvar
277 do 350 l = 1, lratioy
278 svdflx(ivar,influx) = svdflx(ivar,influx)
279 . - amdq(ivar,jfine+l+1) * hy * delt
280 . - apdq(ivar,jfine+l+1) * hy * delt
289 if (mjtot .eq. 2*
nghost+1)
then 300 if (
auxtype(ma).eq.
"yleft")
then 309 do 410 ivar = 1, nvar
314 ncrse = (mitot-2*
nghost)/lratiox
317 do 425 l = 1, lratiox
321 auxr(iaddaux(ma,lind)) = auxc1d(ma,index)
324 do 425 ivar = 1, nvar
325 425 qr(ivar,lind) = qc1d(ivar,index)
329 write(
dbugunit,*)
'side 4, ql and qr:' 331 write(
dbugunit,4101) i, ql(1,i),qr(1,i)
335 . nr+1-2*
nghost,ql,qr,auxl,auxr,wave,s,amdq,apdq)
339 do 430 i = 1, nr/lratiox
341 ifine = (i-1)*lratiox
342 do 440 ivar = 1, nvar
343 do 450 l = 1, lratiox
344 svdflx(ivar,influx) = svdflx(ivar,influx)
345 . + amdq(ivar,ifine+l+1) * hx * delt
346 . + apdq(ivar,ifine+l+1) * hx * delt
354 if (
method(5) .ne. 0)
then 355 call src1d(nvar,
nghost,lenbc,qc1d,maux,auxc1d,tgrid,delt)
integer, parameter dbugunit
integer, dimension(7) method
integer, parameter timemult
current simulation time on this grid
subroutine src1d(meqn, mbc, mx1d, q1d, maux, aux1d, t, dt)
integer, dimension(nsize, maxgr) node
integer, parameter nestlevel
AMR level of the grid.
real(kind=8), dimension(rsize, maxgr) rnode
integer, parameter maxaux
subroutine rpn2(ixy, maxm, meqn, mwaves, maux, mbc, mx, ql, qr, auxl, auxr, wave, s, amdq, apdq)
character(len=10), dimension(:), allocatable auxtype
The module contains the definition of a "node descriptor" as well as other global variables used duri...