      SUBROUTINE predc2

      IMPLICIT NONE

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

      REAL alpha,beta,preexp,incrho,rhoi

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

c     compute the new values of the temperature and scalar.

c **** temperature prediction *****

      IF (1.EQ.1)THEN

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

                  tnew(i,j,k)=told(i,j,k) + dt*0.5*(dtdtn(i,j,k)+dtdtnm(i,j
     $                 ,k))
               
                  rhonew(i,j,k) = 1.0/((incrho*alpha/(1.0-incrho*alpha))
     $                 *tnew(i,j,k)+rhoi)

               END DO
            END DO
         END DO

         CALL scbndy(tnew,ynew,rhonew,ijet)
         
      END IF

c **** scalar prediction ****

      IF (1.EQ.1)THEN

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

                  ymnew(i,j,k)=ymold(i,j,k) + dt*0.5*(dydtn(i,j,k)+dydtnm(i
     $                 ,j,k))

                  ynew(i,j,k)=ymnew(i,j,k)/rhonew(i,j,k)

               END DO
            END DO
         END DO

         CALL scbndy(tnew,ynew,rhonew,ijet)
         
      END IF

c **** velocity prediction ****

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

               umnew(i,j,k)=umold(i,j,k)+0.5*dt*(dudtn(i,j,k) + 
     $              dudtnm(i,j,k))

               unew(i,j,k)=umnew(i,j,k)/(0.5*(rhonew(i,j,k)+rhonew(i+1,j
     $             ,k)))
               
               vmnew(i,j,k)=vmold(i,j,k)+0.5*dt*(dvdtn(i,j,k) +
     $              dvdtnm(i,j,k))

               vnew(i,j,k)=vmnew(i,j,k)/(0.5*(rhonew(i,j,k)+rhonew(i,j+1
     $             ,k)))
               
            END DO
         END DO
      END DO

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

               wmnew(i,j,k)=wmold(i,j,k)+0.5*dt*(dwdtn(i,j,k) +
     $              dwdtnm(i,j,k))

               wnew(i,j,k)=wmnew(i,j,k)/(0.5*(rhonew(i,j,k)+rhonew(i,j
     $              ,k+1)))

            END DO
         END DO
      END DO

      CALL bound(unew,vnew,wnew,tnew,ynew,rhonew,time,ijet,dt,zp,zw,0,ru,rp)

      RETURN
      END
