! 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.10. Array sections.
  program F10
    implicit none
    integer, parameter :: SMALL_ARRAY = 20, LARGE_ARRAY = 144
    real, dimension(SMALL_ARRAY) :: John
    real, dimension(LARGE_ARRAY) :: Baker
! start program F10
    Baker = 0.0
    open (unit = 1, file = "f10.txt", status = "old", action = "read", position = "rewind")
    read (unit = 1, fmt = *) John
    Baker(10: 20) = 2.0 * John(1: 11)  ! Array sections
    write (unit = *, fmt = *) Baker(: 25)
    stop
  end program F10
