      INTEGER FUNCTION IFINDNE(N,A,ISKIP,TARGET,TOLER)
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
      DIMENSION A(1)
      IOFF=1
      IPASS=1
c1     DIFF=ABS(A(IOFF)-a(max(1,ioff-1)))
1     DIFF=ABS(A(IOFF)-TARGET)
      IF(DIFF.GT.TOLER.OR.IPASS.EQ.N+1)THEN
       IFINDNE=IPASS
      ELSE
       IPASS=IPASS+1
       IOFF=IOFF+ISKIP
       GOTO 1
      ENDIF
      RETURN
      END
