! 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.4. Operations with arrays of higher rank.
  program F04
    implicit none
    integer, parameter :: I = 3, J = 1
    real, dimension(14) :: Vector
    real, dimension(20, 20) :: Matrix
    real, dimension(3, 4, 5, 6, 2) :: Fives
! start program F04
    write (unit = *, fmt = *) " Please enter two real numbers. "
    read (unit = *, fmt = *) Matrix(16, 3), Fives(3, 4, 2, 6, 2)
    Vector(I) = Matrix(J + 15, I) + Fives(I, I + J, J + 1, 2 * I, 2)
    write (unit = *, fmt = *) Vector(J + 2)
    stop
  end program F04
