      PROGRAM MATR
      INTEGER LDA
      PARAMETER(LDA = 10)
      INTEGER A, N, I, J
      DIMENSION A(LDA,100)
      NROW = 5
      NCOL = 4
      CALL MTRX(LDA,NROW,NCOL,A)
      STOP
      END

      SUBROUTINE MTRX(LDA,NROW,NCOL,A)
      INTEGER A(LDA,*), NROW, NCOL, I, J
      OPEN(UNIT=1,FILE='inpmtr.dat',STATUS='UNKNOWN')
      DO 10 I = 1,NROW
        READ(1,*) (A(I,J), J = 1,NCOL)
 10   CONTINUE
      DO 20 I = 1,3
        WRITE(*,100) (A(I,J), J = 1,3)
 20   CONTINUE
      CLOSE(1)
 100  FORMAT(5I5)
      RETURN
      END
