```01:       INTEGER FUNCTION ILACLR(M, N, A, LDA)
02:       IMPLICIT NONE
03: !
04: !  -- LAPACK auxiliary routine (version 3.2) --
05: !     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
06: !     December 2007
07: !
08: !     .. Scalar Arguments ..
09:       INTEGER            M, N, LDA
10: !     ..
11: !     .. Array Arguments ..
12:       COMPLEX            A( LDA, * )
13: !     ..
14: !
15: !  Purpose
16: !  =======
17: !
18: !  ILACLR scans A for its last non-zero row.
19: !
20: !  Arguments
21: !  =========
22: !
23: !  M       (input) INTEGER
24: !          The number of rows of the matrix A.
25: !
26: !  N       (input) INTEGER
27: !          The number of columns of the matrix A.
28: !
29: !  A       (input) COMPLEX          array, dimension (LDA,N)
30: !          The m by n matrix A.
31: !
32: !  LDA     (input) INTEGER
33: !          The leading dimension of the array A. LDA >= max(1,M).
34: !
35: !  =====================================================================
36: !
37: !     .. Parameters ..
38:       COMPLEX          ZERO
39:       PARAMETER ( ZERO = (0.0E+0, 0.0E+0) )
40: !     ..
41: !     .. Local Scalars ..
42:       INTEGER I, J
43: !     ..
44: !     .. Executable Statements ..
45: !
46: !     Quick test for the common case where one corner is non-zero.
47:       IF( M.EQ.0 .OR. A(M, 1).NE.ZERO .OR. A(M, N).NE.ZERO ) THEN
48:          ILACLR = M
49:       ELSE
50: !     Scan up each column tracking the last zero row seen.
51:          ILACLR = 0
52:          DO J = 1, N
53:             DO I = M, 1, -1
54:                IF( A(I, J).NE.ZERO ) EXIT
55:             END DO
56:             ILACLR = MAX( ILACLR, I )
57:          END DO
58:       END IF
59:       RETURN
60:       END FUNCTION
61: ```