      SUBROUTINE output(iout)

      IMPLICIT NONE

      INCLUDE 'param.txt'
      INCLUDE 'param2.txt'
      INCLUDE 'common.txt'

      REAL react
      INTEGER ktmp,iout
      CHARACTER*6 intfil

      REAL alpha,beta,preexp,incrho,rhoi

      COMMON /heatrl/ alpha,beta,preexp,incrho,rhoi
c--------------------------------------------------------------------

      WRITE(intfil,'(i6)') iout
      intfil=ADJUSTL(intfil)

      OPEN(15,file='burnout'//intfil)

      WRITE(15,*
     $     )' VARIABLES = "R","Z","U","V","W","P","T","Y","Rx","Rho"'
      WRITE(15,*)'ZONE F=POINT, I= ',2*imax,  ' J= ',kmax

      DO k=1,kmax

         ktmp =k 
         IF(k.EQ.0) ktmp=1
      
         j=jmax/2
         DO i=imax,1,-1

            react=preexp*ynew(i,j,k)*EXP((-beta*(1.0-tnew(i
     $           ,j,k)))/(1-alpha*(1.0-tnew(i,j,k))))


            WRITE(15,1129) -ru(i),zw(k),-unew(i,j,k),vnew(i,j,k),
     1           wnew(i,j,k),p(i,j,ktmp),tnew(i,j,k),ynew(i,j,k),react
     $           ,rhonew(i,j,k)

         END DO

         j=1
         DO i=1,imax

            react=preexp*ynew(i,j,k)*EXP((-beta*(1.0-tnew(i
     $           ,j,k)))/(1-alpha*(1.0-tnew(i,j,k))))

            WRITE(15,1129) ru(i),zw(k),unew(i,j,k),vnew(i,j,k),
     1           wnew(i,j,k),p(i,j,ktmp),tnew(i,j,k),ynew(i,j,k),react
     $           ,rhonew(i,j,k)

         END DO
      END DO

      CLOSE(15)

1129  FORMAT(10E14.6)

      RETURN
      END
