```01:       INTEGER FUNCTION ILADLR(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:       DOUBLE PRECISION   A( LDA, * )
13: !     ..
14: !
15: !  Purpose
16: !  =======
17: !
18: !  ILADLR 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) DOUBLE PRECISION 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:       DOUBLE PRECISION ZERO
39:       PARAMETER ( ZERO = 0.0D+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