$\newcommand{\vector}[1]{\left[\begin{array}{c} #1 \end{array}\right]}$ $\newenvironment{matrix}{\left[\begin{array}{cccccccccc}}{\end{array}\right]}$ $\newcommand{\A}{{\cal A}}$ $\newcommand{\W}{{\cal W}}$

CLAWPACK fortran file rp1.f

The file can have a different name, but should contain a subroutine called rp1 if claw1ez is used. (If you need to use multiple Riemann solvers in the same program, e.g. to compare different methods, then you can use claw1, which takes the name of the Riemann solver subroutine as an input parameter.)

For additional documentation on Riemann solvers, see the CLAWPACK documentation at www.clawpack.org/doc.html, or the book FVMHP.

The rp1 subroutine should have the form



c
c
c     =====================================================
      subroutine rp1(maxm,meqn,mwaves,mbc,mx,ql,qr,auxl,auxr,
     &                  wave,s,amdq,apdq)
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, *)
      dimension auxr(1-mbc:maxmx+mbc, *)
      dimension    s(1-mbc:maxmx+mbc, mwaves)
      dimension wave(1-mbc:maxmx+mbc, meqn, mwaves)
      dimension amdq(1-mbc:maxmx+mbc, meqn)
      dimension apdq(1-mbc:maxmx+mbc, meqn)
c
c     # compute wave, s, amdq, apdq...
c
      return
      end


          

On input:
maxm = leading dimension of the q and aux arrays.
meqn = number of equations in the system (second dimension of q).
mwaves = number of waves returned from the Riemann solver,
mbc = number of ghost cells on left and on right.
mx = number of interior grid cells.
ql contains the state vector at the left edge of each cell,
qr contains the state vector at the right edge of each cell,
auxl contains the auxiliary array at the left edge,
auxr contains the auxiliary array at the right edge,

The i'th Riemann problem has left state qr(i-1,:) and right state ql(i,:).

The Riemann solver may use data in the aux array, in which case the values auxr(i-1,:) and auxl(i,:) should generally be used.

From the basic clawpack routine step1, rp1 is called with ql = qr = q and auxl = auxr = aux.

On output:
wave contains the waves,
s the speeds,
amdq the left-going flux difference $\A^-\Delta Q$,
apdq the right-going flux difference $\A^+\Delta Q$