c c ========================================================== subroutine flgout2(q,mx,my,lb,ub,qo,mxo,myo,lbo,ubo, & lbr,ubr,shaper,meqn,nc,t) c ========================================================== c c # Computes primitives for the RIM solver for output c # and flagging. c implicit double precision(a-h,o-z) c include 'rim2d.i' common /PhysData/ Wk(2), RU, PA 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), & 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) qo(i,j) = q(1,i,j) c # Velocity u if (nc.eq.2) qo(i,j) = q(2,i,j)/q(1,i,j) c # Velocity v if (nc.eq.3) qo(i,j) = q(3,i,j)/q(1,i,j) c # Total energy density if (nc.eq.4) qo(i,j) = q(4,i,j) c # Temperature if (nc.eq.5) qo(i,j) = ((q(4,i,j)-q0*q(5,i,j) & -0.5d0*(q(2,i,j)*q(2,i,j)+q(3,i,j)*q(3,i,j)) & /q(1,i,j))*(q(6,i,j)-1.d0)*Wk(1))/(RU*q(1,i,j)) c # Pressure if (nc.eq.6) qo(i,j) = (q(4,i,j)-q0*q(5,i,j) & -0.5d0*(q(2,i,j)*q(2,i,j)+q(3,i,j)*q(3,i,j)) & /q(1,i,j))*(q(6,i,j)-1.d0) c # Gamma if (nc.eq.7) qo(i,j) = q(6,i,j) c # 1-Z - Product if (nc.eq.8) qo(i,j) = 1.d0-q(5,i,j)/q(1,i,j) c # Z - Reactant if (nc.eq.9) qo(i,j) = q(5,i,j)/q(1,i,j) 10 continue c return end c c ========================================================== subroutine stdcdat(wk1,wk2,rru,ppa) c ========================================================== implicit double precision(a-h,o-z) c include 'rim2d.i' common /PhysData/ Wk(2), RU, PA c parameter( lmechout = 11 ) character *16 cwork dimension cwork(2) c cwork(1)= 'Product' cwork(2)= 'Reactant' Wk(1) = wk1 Wk(2) = wk2 c RU = rru PA = ppa c open(unit=lmechout, status='unknown', form='formatted', & file='chem.dat') write (lmechout,400) RU write (lmechout,401) PA write (lmechout,402) (k,cwork(k),k=1,2) write (lmechout,403) (k,Wk(k),k=1,2) close (lmechout) 400 format('RU ',e16.8) 401 format('PA ',e16.8) 402 format('Sp(',i2.2,') ',a16) 403 format('W(',i2.2,') ',e16.8) c return end c