      SUBROUTINE interp

      IMPLICIT NONE

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

      INTEGER cnt

      REAL upipe(0:pi1,0:pj1,0:pk1)
      REAL vpipe(0:pi1,0:pj1,0:pk1)
      REAL wpipe(0:pi1,0:pj1,0:pk1)
      REAL drpipe
      INTEGER aup(0:i1)

      COMMON /indata/ upipe,vpipe,wpipe,drpipe,aup

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

      drpipe=0.5/pimax

      cnt=1
      DO i=0,ijet
         
         IF(ru(i) .gt. cnt*drpipe) cnt=cnt+1
         aup(i)=cnt-1

      END DO

      RETURN
      END

