c
c ==========================================================
subroutine flgout1eum(q,mx,lb,ub,qo,mxo,lbo,ubo,
& lbr,ubr,shaper,meqn,nc,t)
c ==========================================================
c
c # Computes primitives for two-component Euler equations
c # for output and flagging.
c
c # Copyright (C) 2002 Ralf Deiterding
c # Brandenburgische Universitaet Cottbus
c
c # Copyright (C) 2003-2007 California Institute of Technology
c # Ralf Deiterding, ralf@cacr.caltech.edu
c
implicit double precision(a-h,o-z)
common /PhysData/ Wk, g, pinf, RU, PA
dimension Wk(2), g(2), pinf(2)
c
integer meqn, mx, mxo
dimension q(meqn,mx), qo(mxo)
dimension Xk(2), cap(2)
c
integer lb(1), ub(1), lbo(1), ubo(1), lbr(1), ubr(1), shaper(1),
& mresult, stride, imin(1), imax(1), i, getindx, d
c
stride = (ub(1) - lb(1))/(mx-1)
imin(1) = max(lb(1), lbr(1))
imax(1) = min(ub(1), ubr(1))
if (mod(imin(1)-lb(1),stride) .ne. 0) then
imin(1) = imin(1) + stride - mod(imin(1)-lb(1),stride)
endif
imin(1) = getindx(imin(1), lb(1), stride)
if (mod(imax(1)-lb(1),stride) .ne. 0) then
imax(1) = imax(1) - mod(imax(1)-lb(1),stride)
endif
imax(1) = getindx(imax(1), lb(1), stride)
c
cap(1) = 1.d0 / (g(1)-1.d0)
cap(2) = 1.d0 / (g(2)-1.d0)
c
do 10 i = imin(1), imax(1)
if (nc.gt.3) then
gamma1 = 1.d0 / q(4,i)
gamma = gamma1 + 1.d0
p = gamma1*(q(3,i)-0.5d0*(q(2,i)**2)/q(1,i)-q(5,i))
pin = q(5,i)*gamma1/gamma
Xk(1) = (q(4,i)-cap(2)) / (cap(1)-cap(2))
Xk(2) = 1.d0-Xk(1)
W = Xk(1)*Wk(1) + Xk(2)*Wk(2)
endif
c
c # Density
if (nc.eq.1) qo(i) = q(1,i)
c # Velocity
if (nc.eq.2) qo(i) = q(2,i)/q(1,i)
c # Total energy density
if (nc.eq.3) qo(i) = q(3,i)
c # Temperature
if (nc.eq.4) qo(i) = p/(q(1,i)*RU/W)
c # Pressure
if (nc.eq.5) qo(i) = p
c # Gamma
if (nc.eq.6) qo(i) = gamma
c # Y1
if (nc.eq.7) qo(i) = Xk(1)*Wk(1)/W
c # Y2
if (nc.eq.8) qo(i) = Xk(2)*Wk(2)/W
c # pinf
if (nc.eq.9) qo(i) = pin
c # Speed of sound
if (nc.eq.10) qo(i) = dsqrt(gamma*(p+pin)/q(1,i))
10 continue
return
end