C=====================================================================
SUBROUTINE inpmat(nmax, nrow, ncol, a)
REAL a(nmax, nmax)
WRITE(*, *) 'input Matrix Size ( row & col ).'
READ(*, *) nrow, ncol
IF (nrow .GT. nmax .OR. ncol .GT. nmax) THEN
WRITE(*, *) 'matrix size must be smaller than', nmax, '.'
STOP 'Increase nmax!'
END IF
DO 10 irow = 1, nrow
WRITE(*, *) 'input Matrix element of ', irow, ' th row.'
READ(*, *) (a(irow, icol), icol = 1, ncol)
10 CONTINUE
RETURN
END
C=====================================================================
SUBROUTINE primat(nmax, nrow, ncol, a)
REAL a(nmax, nmax)
WRITE(*, *)
DO 10 irow = 1, nrow
WRITE(*, '(1x, 40F5.1)') ( a(irow, icol), icol = 1, ncol )
10 CONTINUE
RETURN
END
>>552