program main
    call ex1
end program

subroutine ex1
      implicit none
      real,save :: z[*]
      integer :: image
      if (this_image()==1) then
         write(*,*) 'Value of z?'
          read(*,*) z
          do image = 2, num_images()
            z[image] = z
         end do
      end if
      sync all
      write(*,*) 'z=',z,' on image',this_image()
end subroutine ex1
