      SUBROUTINE tec3d

      IMPLICIT NONE

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

      REAL react
      INTEGER ktmp,itmp

      REAL xr,yr
      REAL y(0:j1)

      REAL alpha,beta,preexp,incrho,rhoi

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

c-----------------------------------------------------------------------

      OPEN(15,file='tec3d.out')

      WRITE(15,*)
     $     'VARIABLES = "X","Y","Z","U","V","W","P","T","Yr","Rx","Rho"'
      WRITE(15,*) 'ZONE F=POINT, I=',i1, ', J=',j1, ',K=',kmax

      DO j=0,j1
         y(j)=j*2*3.14159/jmax
      END DO

      DO k=1,kmax
         DO j=0,jmax
            DO i=0,imax

               itmp=i
               if(i .eq. 0) itmp=1

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


               xr=ru(i)*cos(y(j))
               yr=ru(i)*sin(y(j))

               WRITE(15,10) xr,yr,zw(k),unew(i,j,k),vnew(i,j,k),wnew(i,j
     $              ,k),p(itmp,j,k),tnew(i,j,k),ynew(i,j,k),react
     $              ,rhonew(i,j,k)
 10            FORMAT(1x,11(e12.4))

            END DO
         END DO
      END DO

      CLOSE(15)

      RETURN

      END 

