c
c ==========================================================
subroutine flgout1eu(q,mx,lb,ub,qo,mxo,lbo,ubo,
& lbr,ubr,shaper,meqn,nc,t)
c ==========================================================
c
c # Computes primitives for Euler equations for output
c # 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@amroc.net
c
implicit double precision(a-h,o-z)
common /param/ gamma,gamma1
common /PhysData/ Wk, RU, PA
c
integer meqn, mx, mxo
dimension q(meqn,mx), qo(mxo)
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
do 10 i = imin(1), imax(1)
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) = (Wk*gamma1*(q(3,i) -
& 0.5d0*q(2,i)**2/q(1,i)))/(RU*q(1,i))
c # Pressure
if (nc.eq.5) qo(i) = gamma1*(q(3,i) -
& 0.5d0*q(2,i)**2/q(1,i))
c # Gamma
if (nc.eq.6) qo(i) = gamma
10 continue
return
end