! 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.

  module F05M
    implicit none
    public :: Swap
    integer, parameter, public :: ARRAY_SIZE = 10
    real, dimension(ARRAY_SIZE), public :: Data_Array
  contains
    subroutine Swap( I, J )  ! Module subprogram
      ! Obtains Data_Array by inheritance from module.
      integer, intent (in) :: I, J
      real :: Aux
  ! start subroutine Swap
      Aux = Data_Array(I)
      Data_Array(I) = Data_Array(J)
      Data_Array(J) = Aux
      return
    end subroutine Swap
  end module F05M

