c
c ==========================================================
subroutine out2eurhok(q,mx,my,lb,ub,qo,mxo,myo,lbo,ubo,
& lbr,ubr,shaper,meqn,nc,time)
c ==========================================================
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)
include "ck.i"
c
integer meqn, mx, my, mxo, myo
dimension q(meqn,mx,my), qo(mxo,myo)
c
integer lb(2), ub(2), lbo(2), ubo(2), lbr(2), ubr(2), shaper(2),
& mresult, stride, imin(2), imax(2), i, j, d, getindx
c
stride = (ub(1) - lb(1))/(mx-1)
do 5 d = 1, 2
imin(d) = max(lb(d), lbr(d))
imax(d) = min(ub(d), ubr(d))
if (mod(imin(d)-lb(d),stride) .ne. 0) then
imin(d) = imin(d) + stride - mod(imin(d)-lb(d),stride)
endif
imin(d) = getindx(imin(d), lb(d), stride)
if (mod(imax(d)-lb(d),stride) .ne. 0) then
imax(d) = imax(d) - mod(imax(d)-lb(d),stride)
endif
imax(d) = getindx(imax(d), lb(d), stride)
5 continue
do 10 i = imin(1), imax(1)
do 10 j = imin(2), imax(2)
c Compute rho
rho = 0.d0
rhoW = 0.d0
do k = 1, Nsp
rho = rho + q(k,i,j)
rhoW = rhoW + q(k,i,j)/Wk(k)
enddo
c
c # Total density
if (nc.eq.1) then
qo(i,j) = rho
c # Convert g/cm**3 into kg/m**3
if (ckunits) qo(i,j) = qo(i,j)*1.d3
endif
c
c # Velocity u
if (nc.eq.2) then
qo(i,j) = q(Nsp+1,i,j)/rho
c # Convert cm/sec into m/sec
if (ckunits) qo(i,j) = qo(i,j)*1.d-2
endif
c
c # Velocity v
if (nc.eq.3) then
qo(i,j) = q(Nsp+2,i,j)/rho
c # Convert cm/sec into m/sec
if (ckunits) qo(i,j) = qo(i,j)*1.d-2
endif
c
c # Total energy density
if (nc.eq.4) then
qo(i,j) = q(Nsp+3,i,j)
c # Convert ergs/cm**3 into J/m**3
if (ckunits) qo(i,j) = qo(i,j)*1.d-1
endif
c
c # Temperature - No unit conversion
if (nc.eq.5) qo(i,j) = q(Nsp+4,i,j)
c
c # Pressure
if (nc.eq.6) then
qo(i,j) = rhoW*RU*q(Nsp+4,i,j)
c # Convert dynes/cm**2 into Pa = J/m**2
if (ckunits) qo(i,j) = qo(i,j)*1.d-1
endif
c
c # Gamma - No unit conversion
if (nc.eq.7) then
rhoCp = avgtabip(q(Nsp+4,i,j),q(1,i,j),cpk,Nsp)
qo(i,j) = RU/(rhoCp/rhoW-RU)+1.d0
endif
c
c # Mass fractions - No unit conversion
if (nc.ge.8) qo(i,j) = q(nc-7,i,j)/rho
10 continue
c
return
end