c c ========================================================== subroutine in1eurhok(qi,mxi,lbi,ubi,q,mx,lb,ub, & lbr,ubr,shaper,meqn,nc,time) c ========================================================== 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" common /Energy/ NEnergy c integer meqn, mx, mxi dimension q(meqn,mx), qi(mxi) c integer lb(1), ub(1), lbi(1), ubi(1), lbr(1), ubr(1), shaper(1), & mresult, stride, imin(1), imax(1), i, getindx c stride = (ub(1) - lb(1))/(mx-1) imin(1) = max(lb(1), lbi(1), lbr(1)) imax(1) = min(ub(1), ubi(1), ubr(1)) c 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 if (nc.eq.1) NEnergy = 0 if (nc.eq.3) NEnergy = 1 if (nc.eq.4) NEnergy = 2 if (nc.eq.5) NEnergy = 3 c do 10 i = imin(1), imax(1) c # Total density if (nc.eq.1) then q(1,i) = qi(i) c # Convert kg/m**3 into g/cm**3 if (ckunits) q(1,i) = q(1,i)*1.d-3 do k = 2, Nsp q(k,i) = q(1,i) enddo endif c c # Velocity u if (nc.eq.2) then q(Nsp+1,i) = q(1,i)*qi(i) c # Convert cm/sec into m/sec if (ckunits) q(Nsp+1,i) = q(Nsp+1,i)*1.d2 endif c c # Total energy density if (nc.eq.3) then q(Nsp+2,i) = qi(i) c # Convert J/m**3 into ergs/cm**3 if (ckunits) q(Nsp+2,i) = q(Nsp+2,i)*1.d1 endif c c # Temperature - No unit conversion if (nc.eq.4) q(Nsp+3,i) = qi(i) c c # Pressure if (nc.eq.5) then q(Nsp+3,i) = qi(i) c # Convert Pa = J/m**2 into dynes/cm**2 if (ckunits) q(Nsp+3,i) = q(Nsp+3,i)*1.d1 endif c c # Mass fractions - No unit conversion if (nc.ge.7.and.nc.le.Nsp+6) & q(nc-6,i) = q(nc-6,i)*qi(i) c c # Total energy density if (nc.eq.Nsp+6.and.NEnergy.gt.0) then rho = 0.d0 rhoW = 0.d0 do k = 1, Nsp rho = rho + q(k,i) rhoW = rhoW + q(k,i)/Wk(k) enddo if (NEnergy.eq.1) then rhoe = q(Nsp+3,i)-0.5d0*(q(Nsp+1,i)**2)/rho call SolveTrhok(q(Nsp+3,i),rhoe,rhoW, & q(1,i),Nsp,ifail) endif if (NEnergy.eq.3) q(Nsp+3,i) = q(Nsp+3,i)/(rhoW*RU) if (NEnergy.eq.2.or.NEnergy.eq.3) q(Nsp+2,i) = & 0.5d0*(q(Nsp+1,i)**2+)/rho - rhoW*RU*q(Nsp+3,i) & + avgtabip(q(Nsp+3,i),q(1,i),hms,Nsp) endif c 10 continue return end