program testrp1sw c c # This version for shallow water equations c c # Routine to test a Riemann solver of the form used in 1d clawpack c # You must modify to set meqn and mwaves appropriately, along with c # any values that should be passed to rp in common blocks. c c # Author: Randall J. LeVeque c c implicit double precision (a-h,o-z) c parameter (maxmx = 2) parameter (mx = 2) parameter (mbc = 0) parameter (meqn = 2) parameter (mwaves = 2) parameter (maux = 0) c dimension q(1-mbc:maxmx+mbc, meqn) dimension wave(1-mbc:maxmx+mbc, meqn,mwaves) dimension s(1-mbc:maxmx+mbc, mwaves) dimension amdq(1-mbc:maxmx+mbc, meqn) dimension apdq(1-mbc:maxmx+mbc, meqn) c dimension aux(1-mbc:maxmx+mbc, maux) common /comrp/ grav grav = 1.d0 c # read in data: write(6,*) 'input hl, hl*ul ' read(5,*) hl,hul write(6,*) 'input hr, hr*ur ' read(5,*) hr,hur c # left state: q(1,1) = hl q(1,2) = hul c # right state: q(2,1) = hr q(2,2) = hur write(6,600) do m=1,meqn write(6,604) q(1,m), q(2,m) enddo call rp1(maxmx,meqn,mwaves,mbc,mx,q,q,aux,aux, & wave,s,amdq,apdq) do mw=1,mwaves write(6,601) mw, s(2,mw) do m=1,meqn q(1,m) = q(1,m) + wave(2,m,mw) write(6,602) wave(2,m,mw),q(1,m) enddo enddo write(6,603) do m=1,meqn write(6,604) amdq(2,m), apdq(2,m) enddo write(6,*) ' ' 600 format(/,' ql qr') 601 format(/,i3,'-wave has speed s = ',d19.12,/, & /,' wave q to right of this wave:') 602 format(d22.12,' ',d22.12) 603 format(/,' amdq apdq') 604 format(2d22.12) stop end