c c c
      module assign
c    Modules, unlike COMMON may contain allocatable arrays
c
c
         real, allocatable :: a(:)
c
         integer :: isize=5
      end module
c
      program testmod
      use assign
c
c    By using MODULE to pass information about allocatable arrays
c    we can duck the earlier prohibition against allocating
c    space in a subroutine for use in the main program or
c    other subprograms called by the main program.
c
c      John Mahaffy    4/13/96
c
c
      call sub1
      print *,' Main: Array A is still defined, with values:'
      print *, a
      call sub2
      stop
      end
      subroutine sub1
      use assign
c
c     This subroutine allocates space in array "a" and
c     loads some values
c
c      John Mahaffy    4/13/96
c
      allocate(a(isize))
c
      a=(/(i,i=1,isize)/)
      return
      end
      subroutine sub2
      use assign
c
c     This subroutine prints values in array "a" and
c     deallocates space
c
c      John Mahaffy    4/13/96
c
      print *,' Sub2: Array A is still defined, with values:'
      print *, a
c
      deallocate(a)
c
c
c    I can actually get away with the following print, but
c    results are strange.
c
      print *,' After Dealloation of A "print *, a " gives:'
      print *, a
      return
      end
c
c c