```01:       INTEGER FUNCTION ICAMAX(N,CX,INCX)
02: *     .. Scalar Arguments ..
03:       INTEGER INCX,N
04: *     ..
05: *     .. Array Arguments ..
06:       COMPLEX CX(*)
07: *     ..
08: *
09: *  Purpose
10: *  =======
11: *
12: *     ICAMAX 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: *     .. External Functions ..
28:       REAL SCABS1
29:       EXTERNAL SCABS1
30: *     ..
31:       ICAMAX = 0
32:       IF (N.LT.1 .OR. INCX.LE.0) RETURN
33:       ICAMAX = 1
34:       IF (N.EQ.1) RETURN
35:       IF (INCX.EQ.1) GO TO 20
36: *
37: *        code for increment not equal to 1
38: *
39:       IX = 1
40:       SMAX = SCABS1(CX(1))
41:       IX = IX + INCX
42:       DO 10 I = 2,N
43:           IF (SCABS1(CX(IX)).LE.SMAX) GO TO 5
44:           ICAMAX = I
45:           SMAX = SCABS1(CX(IX))
46:     5     IX = IX + INCX
47:    10 CONTINUE
48:       RETURN
49: *
50: *        code for increment equal to 1
51: *
52:    20 SMAX = SCABS1(CX(1))
53:       DO 30 I = 2,N
54:           IF (SCABS1(CX(I)).LE.SMAX) GO TO 30
55:           ICAMAX = I
56:           SMAX = SCABS1(CX(I))
57:    30 CONTINUE
58:       RETURN
59:       END
60: ```