01:       INTEGER FUNCTION ISAMAX(N,SX,INCX)
02: *     .. Scalar Arguments ..
03:       INTEGER INCX,N
04: *     ..
05: *     .. Array Arguments ..
06:       REAL SX(*)
07: *     ..
08: *
09: *  Purpose
10: *  =======
11: *
12: *     ISAMAX finds the index of element having max. absolute value.
13: *
14: *  Further Details
15: *  ===============
16: *
17: *     jack dongarra, linpack, 3/11/78.
18: *     modified 3/93 to return if incx .le. 0.
19: *     modified 12/3/93, array(1) declarations changed to array(*)
20: *
21: *  =====================================================================
22: *
23: *     .. Local Scalars ..
24:       REAL SMAX
25:       INTEGER I,IX
26: *     ..
27: *     .. Intrinsic Functions ..
28:       INTRINSIC ABS
29: *     ..
30:       ISAMAX = 0
31:       IF (N.LT.1 .OR. INCX.LE.0) RETURN
32:       ISAMAX = 1
33:       IF (N.EQ.1) RETURN
34:       IF (INCX.EQ.1) GO TO 20
35: *
36: *        code for increment not equal to 1
37: *
38:       IX = 1
39:       SMAX = ABS(SX(1))
40:       IX = IX + INCX
41:       DO 10 I = 2,N
42:           IF (ABS(SX(IX)).LE.SMAX) GO TO 5
43:           ISAMAX = I
44:           SMAX = ABS(SX(IX))
45:     5     IX = IX + INCX
46:    10 CONTINUE
47:       RETURN
48: *
49: *        code for increment equal to 1
50: *
51:    20 SMAX = ABS(SX(1))
52:       DO 30 I = 2,N
53:           IF (ABS(SX(I)).LE.SMAX) GO TO 30
54:           ISAMAX = I
55:           SMAX = ABS(SX(I))
56:    30 CONTINUE
57:       RETURN
58:       END
59: