module figure_6_2
public  ::  swap
contains
! Figure 6.2
   subroutine swap(a, b)
      real, dimension(:), intent(inout) :: a, b
      real, dimension(size(a)) :: work
               ! size provides the size of an array,
               ! and is defined in Section 8.11.2.
      work = a
      a = b
      b = work
   end subroutine swap
end module figure_6_2
