c c ========================================================== subroutine in2eu(qi,mxi,myi,lbi,ubi,q,mx,my,lb,ub, & lbr,ubr,shaper,meqn,nc,t) c ========================================================== c c # Computes conserved quantities from primitives for c # Euler equations. The inverse to flgout2eu.f. 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 /param/ gamma,gamma1 common /PhysData/ Wk, RU, PA c integer meqn, mx, my, mxi, myi dimension q(meqn,mx,my), qi(mxi,myi) c integer lb(2), ub(2), lbi(2), ubi(2), lbr(2), ubr(2), shaper(2), & mresult, stride, imin(2), imax(2), i, getindx, d 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 # Density if (nc.eq.1) q(1,i,j) = qi(i,j) c # Velocity u if (nc.eq.2) q(2,i,j) = q(1,i,j)*qi(i,j) c # Velocity v if (nc.eq.3) q(3,i,j) = q(1,i,j)*qi(i,j) c # Total energy density if (nc.eq.4) q(4,i,j) = qi(i,j) c # Temperature if (nc.eq.5) q(4,i,j) = (qi(i,j)*RU*q(1,i,j))/ & (Wk*gamma1) + 0.5d0* & (q(2,i,j)**2+q(3,i,j)**2)/q(1,i,j) c # Pressure if (nc.eq.6) q(4,i,j) = qi(i,j)/gamma1 + 0.5d0* & (q(2,i,j)**2+q(3,i,j)**2)/q(1,i,j) 10 continue return end