! Program Example from "Essential Fortran 90 & 95" by Loren P. Meissner
! Copyright 1996. Copying for sale requires permission from the author.
! Otherwise, distribution is permitted if these three lines are included.

! Example 5.11. (File input.) Matrix input by rows.
  program F11
    implicit none
    integer, parameter :: N_ROWS = 5, N_COLS = 8
    integer :: Row
    real, dimension(N_ROWS, N_COLS) :: Vector
! start program F11
    open (unit = 1, file = "f11.txt", status = "old", action = "read", position = "rewind")
    do Row = 1, N_ROWS
      read (unit = 1, fmt = *) Vector(Row, 1: N_COLS)
    end do
    do Row = 1, N_ROWS
      write (unit = *, fmt = *) " Row: ", Row
      write (unit = *, fmt = *) Vector(Row, 1: N_COLS)
    end do
    stop
  end program F11
