c c c ========================================================= subroutine rp1(maxmx,meqn,mwaves,mbc,mx,ql,qr,auxl,auxr, & fwave,s,amdq,apdq) c ========================================================= c c # Solve Riemann problems for the 1D conservative advection equation c # q_t + (u(x)*q)_x = 0 c # with variable velocity u(x), using the f-wave approach. c # Must be used with step1fw.f instead of step1.f c c # The cell-centered velocity u_i in the i'th cell is stored in aux(i,1) c c c # On input, ql contains the state vector at the left edge of each cell c # qr contains the state vector at the right edge of each cell c # On output, fwave contains the f-waves, c # s the speeds, c # amdq the left-going flux difference A^- \Delta q c # apdq the right-going flux difference A^+ \Delta q c c # Note that the i'th Riemann problem has left state qr(i-1,:) c # and right state ql(i,:) c # From the basic clawpack routine step1, rp is called with ql = qr = q. c c implicit double precision (a-h,o-z) dimension ql(1-mbc:maxmx+mbc, meqn) dimension qr(1-mbc:maxmx+mbc, meqn) dimension auxl(1-mbc:maxmx+mbc, 1) dimension auxr(1-mbc:maxmx+mbc, 1) dimension s(1-mbc:maxmx+mbc, mwaves) dimension fwave(1-mbc:maxmx+mbc, meqn, mwaves) dimension amdq(1-mbc:maxmx+mbc, meqn) dimension apdq(1-mbc:maxmx+mbc, meqn) c c do 30 i=2-mbc,mx+mbc c uim =auxr(i-1,1) ui =auxl(i,1) c fwave(i,1,1) = ui*ql(i,1) - uim*qr(i-1,1) c if (uim.lt.0.d0 .and. ui.lt.0.d0) then s(i,1) = uim amdq(i,1) = fwave(i,1,1) apdq(i,1) = 0.d0 else if (uim.gt.0.d0 .and. ui.gt.0.d0) then s(i,1) = ui amdq(i,1) = 0.d0 apdq(i,1) = fwave(i,1,1) else c # Velocity changes sign. c # In this case this algorithm based on cell-centered c # velocities may not work well. Using edge velocities c # is generally preferable. write(6,*) '*** WARNING ... velocity changes sign' s(i,1) = 0.5d0*(uim+ui) amdq(i,1) = - uim*qr(i-1,1) apdq(i,1) = ui*ql(i,1) end if 30 continue c return end