anchor.diff:  ! APR 2019 - Conversion to F90 (F95 standard uses SIZE intrinsic).
   !----------------------------------------------------------------------------------------------------------------------------------+
   MODULE MODLINALG
  +IMPLICIT NONE
  +PRIVATE
  +!----------------------------------------------------------------------------------------------------------------------------------+
  +PUBLIC :: MATRIX_PRINT,TEST_MODLINALG,MATRIX_RANDOMIZE
   !----------------------------------------------------------------------------------------------------------------------------------+
                                                               CONTAINS
   !----------------------------------------------------------------------------------------------------------------------------------+
  
positive.code:     END DO
    END DO
  !----------------------------------------------------------------------------------------------------------------------------------+
  END SUBROUTINE MATRIX_BACK_SUBSTITUTION
  !----------------------------------------------------------------------------------------------------------------------------------+
  SUBROUTINE MATRIX_MULTIPLY(A,B,P)
  !----------------------------------------------------------------------------------------------------------------------------------+
  ! Product of [A]*[B] is placed in P.
  !----------------------------------------------------------------------------------------------------------------------------------+
    IMPLICIT NONE
    REAL(KIND=8),INTENT(IN),DIMENSION(:,:)    :: A      ! Matrix A
    REAL(KIND=8),INTENT(IN),DIMENSION(:,:)    :: B      ! Matrix B
    REAL(KIND=8),INTENT(INOUT),DIMENSION(:,:) :: P      ! Matrix P (product: [P] = [A] * [B])
    INTEGER(KIND=4)                           :: AROWS  ! Rows of A
    INTEGER(KIND=4)                           :: ACOLS  ! Cols of A (Must match BROWS)
    INTEGER(KIND=4)                           :: BROWS  ! Rows of B (Must match ACOLS)
    INTEGER(KIND=4)                           :: BCOLS  ! Cols of B
    INTEGER(KIND=4)                           :: PROWS  ! Rows of P (Must be .GE. AROWS)
    INTEGER(KIND=4)                           :: PCOLS  ! Cols of P (Must be .GE. BCOLS)       
    INTEGER(KIND=4)                           :: I,J,K  ! Counter indicies
    REAL(KIND=8)                              :: SM     ! Accumulator for matrix multiplicaiton.
  !----------------------------------------------------------------------------------------------------------------------------------+
  !
  !                                   [A]     *         [B]         =         [P]
  !                           
  !                               | A11 A12 |   | B11 B12 B13 B14 |   | P11 P12 P13 P14 |
  !                               | A21 A22 | * | B21 B22 B23 B12 | = | P21 P22 P23 P24 |
  !                               | A31 A32 |                         | P31 P32 P33 P34 |
  !                           
  !                           
  !                                               <-------- K -------->
  !                           
  !                                         P11 = A11 * B11 + A12 * B21   ^   ^
  !                                         P21 = A21 * B11 + A22 * B21   I   |
  !                                         P31 = A31 * B11 + A32 * B21   v   |
  !                                                                           |
  !                                         P12 = A11 * B12 + A12 * B22   ^   |
  !                                         P22 = A21 * B12 + A22 * B22   I   |
  !                                         P32 = A31 * B12 + A32 * B22   v    
  !                                                                           J
  !                                         P13 = A11 * B13 + A12 * B23   ^    
  !                                         P23 = A21 * B13 + A22 * B23   I   |
  !                                         P33 = A31 * B13 + A32 * B23   v   |
  !                                                                           |
  !                                         P14 = A11 * B14 + A12 * B24   ^   |
  !                                         P24 = A21 * B14 + A22 * B24   I   |
  !                                         P34 = A31 * B14 + A32 * B24   v   v
  !
  !----------------------------------------------------------------------------------------------------------------------------------+
    AROWS = SIZE(A,1)
    ACOLS = SIZE(A,2)
    BROWS = SIZE(B,1)
    BCOLS = SIZE(B,2)
    PROWS = SIZE(B,1)
    PCOLS = SIZE(B,2)
  !----------------------------------------------------------------------------------------------------------------------------------+
    IF (ACOLS.NE.BROWS) THEN
      WRITE(0,910) ACOLS, BROWS
      STOP
    END IF
    IF (PROWS.LT.AROWS) THEN
      WRITE(0,920) PROWS, AROWS
      STOP
    END IF
    IF (PCOLS.LT.BCOLS) THEN
      WRITE(0,930) PCOLS, BCOLS
      STOP
    END IF
  !----------------------------------------------------------------------------------------------------------------------------------+
    DO I = 1, PROWS
      DO J = 1, PCOLS
        SM = 0D0
        DO K = 1, ACOLS
          SM = SM + A(I,K) * B(K,J)
        END DO
        P(I,J) = SM
      END DO
    END DO
  !----------------------------------------------------------------------------------------------------------------------------------+
   910 FORMAT('*** FATAL ERRROR: MATRIX_MULTIPLY: MATRIX A COLUMNS MUST MATCH MATRIX B ROWS:',/,18X,I8, ' .NE. ', I8)
   920 FORMAT('*** FATAL ERRROR: MATRIX_MULTIPLY: MATRIX P ROWS MUST AT LEAST EQUAL MATRIX A ROWS:',/,18X,I8, ' .LT. ', I8)
   930 FORMAT('*** FATAL ERRROR: MATRIX_MULTIPLY: MATRIX P COLUMNS MUST AT LEAST EQUAL MATRIX B COLUMNS:',/,18X,I8, ' .LT. ', I8)
  END SUBROUTINE MATRIX_MULTIPLY
  !----------------------------------------------------------------------------------------------------------------------------------+
  SUBROUTINE TEST_MODLINALG
    INTEGER(KIND=4),PARAMETER :: ROWS = 6
    INTEGER(KIND=4),PARAMETER :: COLS = 12
    REAL(KIND=8),DIMENSION(ROWS,COLS) :: D  = 0D0
    REAL(KIND=8),DIMENSION(ROWS,ROWS) :: D1
    REAL(KIND=8),DIMENSION(ROWS,ROWS) :: D2
  
negative.code:   WRITE(6,900)
    CALL MATRIX_RANDOMIZE(D1,0)
    CALL MATRIX_IDENTITY(D2)
    CALL GAUSS_ELIMINATION(D,.FALSE.)
    CALL BACK_SUBSTITUTION(D)
    CALL MATRIX_PRINT(D)
  !----------------------------------------------------------------------------------------------------------------------------------+
    WRITE(6,900)
  