      SUBROUTINE jets(umb,vmb,wmb,ub,vb,wb,yb,tb,rho,time)

      IMPLICIT NONE

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

      REAL umb(0:i1,0:j1,0:k1)
      REAL vmb(0:i1,0:j1,0:k1)
      REAL wmb(0:i1,0:j1,0:k1)

      REAL ub(0:i1,0:j1,0:k1)
      REAL vb(0:i1,0:j1,0:k1)
      REAL wb(0:i1,0:j1,0:k1)
      REAL tb(0:i1,0:j1,0:k1)
      REAL yb(0:i1,0:j1,0:k1)
      REAL rho(0:i1,0:j1,0:k1)

      REAL time

      REAL alpha,beta,preexp,incrho,rhoi

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


c...test flow from pipe...

      IF(1.EQ.0)THEN
         DO i=0,i1
            DO j=0,j1
               wb(i,j,0) = 1.0
               ub(i,j,0) = 0.0
               vb(i,j,0) = 0.0
            END DO
         END DO
      END IF

c...at this stage, inflow velocity profiles from pipe database are
c   stored in arrays wb(i,j,0), ub(i,j,0), and vb(i,j,0)

      DO i=0,i1
         DO j=0,j1
            wb(i,j,0) = wb(i,j,0)
            ub(i,j,0) = -ub(i,j,1) + ub(i,j,0)
            vb(i,j,0) = -vb(i,j,1) + vb(i,j,0)
         END DO
      END DO

c...grid...take the pipe velocity profile and run it through the grid.


      IF(1.EQ.1)THEN

c...radial filter

c...fine mesh...

c         DO i=4,i1,5
c            DO j=0,j1
c               wb(i,j,0) = 0.0
c               ub(i,j,0) = -ub(i,j,1)
c               vb(i,j,0) = -vb(i,j,1)
c            END DO
c         END DO

         DO i=4,i1,3
            DO j=0,j1
               wb(i,j,0) = 0.0
               ub(i,j,0) = -ub(i,j,1)
               vb(i,j,0) = -vb(i,j,1)
            END DO
         END DO

c         DO i=5,i1,5
c            DO j=0,j1
c               wb(i,j,0) = 0.0
c               ub(i,j,0) = -ub(i,j,1)
c               vb(i,j,0) = -vb(i,j,1)
c            END DO
c         END DO

         DO j=0,j1
            wb(imax,j,0) = 0.0
            ub(imax,j,0) = -ub(i1,j,1)
            vb(imax,j,0) = -vb(i1,j,1)
            wb(i1,j,0) = 0.0
            ub(i1,j,0) = -ub(i1,j,1)
            vb(i1,j,0) = -vb(i1,j,1)
         END DO

      ELSE

c...coarse mesh...

         DO i=5,i1,8
            DO j=0,j1
               wb(i,j,0) = 0.0
               ub(i,j,0) = -ub(i,j,1)
               vb(i,j,0) = -vb(i,j,1)
            END DO
         END DO

         DO i=6,i1,8
            DO j=0,j1
               wb(i,j,0) = 0.0
               ub(i,j,0) = -ub(i,j,1)
               vb(i,j,0) = -vb(i,j,1)
            END DO
         END DO

         DO j=0,j1
            wb(imax,j,0) = 0.0
            ub(imax,j,0) = -ub(i1,j,1)
            vb(imax,j,0) = -vb(i1,j,1)
            wb(i1,j,0)   = 0.0
            ub(i1,j,0)   = -ub(i1,j,1)
            vb(i1,j,0)   = -vb(i1,j,1)
         END DO

      END IF
         
c...circumferential filter

      DO j=3,j1,8
         DO i=5,20
            wb(i,j,0) = 0.0
            ub(i,j,0) = -ub(i,j,1)
            vb(i,j,0) = -vb(i,j,1)
         END DO
      END DO


      DO j=3,j1,4
         DO i=21,i1
            wb(i,j,0) = 0.0
            ub(i,j,0) = -ub(i,j,1)
            vb(i,j,0) = -vb(i,j,1)
         END DO
      END DO

      RETURN
      END



