      INTEGER FUNCTION ISAMAX (N,X,INCX)
      INTEGER N, INCX
      DOUBLE PRECISION X(*)
      DOUBLE PRECISION SMAX
      INTEGER I, IX
      ISAMAX = 0
      SMAX = 0.0D0
      IX = 1
      DO 100 I=1,N
         IF(ABS(X(IX)).GT.SMAX) THEN
            ISAMAX = IX
            SMAX = ABS(X(IX))
         ENDIF
         IX = IX + INCX
 100  CONTINUE
      RETURN
      END
