program ex6
   implicit none
   integer :: me
   real :: w(4)[*]

   me = this_image()
   w = me
   sync all
   call sub(me,w)
   sync all

contains

   subroutine sub(n,w)
      implicit none
      integer :: n
      real :: w(n)[*]
      write(*,*) 'In sub on image',this_image(), 'w(:)= ',w(:)
   end subroutine

end program 
