From SVN: r977 | james | 2011-04-22 00:00:11 +0200 (Fri, 22 Apr 2011) | 2 lines fixed problems with zero matrix and scan bug0079 :: ILA[SDCZ]LR out of bound access in the DO LOOP for array A. Change DO LOOP condition and add a IF inside the DO LOOP Index: SRC/ilazlr.f =================================================================== --- SRC/ilazlr.f (revision 976) +++ SRC/ilazlr.f (revision 977) @@ -53,9 +53,12 @@ ILAZLR = 0 DO J = 1, N I=M - DO WHILE ((A(I,J).NE.ZERO).AND.(I.GE.1)) - I=I-1 - ENDDO + DO WHILE ((A(I,J).EQ.ZERO).AND.(I.GT.1)) + I=I-1 + ENDDO + IF( (I.EQ.1).AND.(A(1,J).EQ.ZERO) ) THEN + I = 0 + END IF ILAZLR = MAX( ILAZLR, I ) END DO END IF Index: SRC/ilaclr.f =================================================================== --- SRC/ilaclr.f (revision 976) +++ SRC/ilaclr.f (revision 977) @@ -54,9 +54,12 @@ ILACLR = 0 DO J = 1, N I=M - DO WHILE ((A(I,J).NE.ZERO).AND.(I.GE.1)) - I=I-1 - ENDDO + DO WHILE ((A(I,J).EQ.ZERO).AND.(I.GT.1)) + I=I-1 + ENDDO + IF( (I.EQ.1).AND.(A(1,J).EQ.ZERO) ) THEN + I = 0 + END IF ILACLR = MAX( ILACLR, I ) END DO END IF Index: SRC/ilaslr.f =================================================================== --- SRC/ilaslr.f (revision 976) +++ SRC/ilaslr.f (revision 977) @@ -54,9 +54,12 @@ ILASLR = 0 DO J = 1, N I=M - DO WHILE ((A(I,J).NE.ZERO).AND.(I.GE.1)) - I=I-1 + DO WHILE ((A(I,J).EQ.ZERO).AND.(I.GT.1)) + I=I-1 ENDDO + IF( (I.EQ.1).AND.(A(1,J).EQ.ZERO) ) THEN + I = 0 + END IF ILASLR = MAX( ILASLR, I ) END DO END IF Index: SRC/iladlr.f =================================================================== --- SRC/iladlr.f (revision 976) +++ SRC/iladlr.f (revision 977) @@ -53,10 +53,13 @@ * Scan up each column tracking the last zero row seen. ILADLR = 0 DO J = 1, N - I=M - DO WHILE ((A(I,J).NE.ZERO).AND.(I.GE.1)) - I=I-1 + I = M + DO WHILE ((A(I,J).EQ.ZERO).AND.(I.GT.1)) + I=I-1 ENDDO + IF( (I.EQ.1).AND.(A(1,J).EQ.ZERO) ) THEN + I = 0 + END IF ILADLR = MAX( ILADLR, I ) END DO END IF