      program nodesend

c     Note: This program should only demonstrate the functionality, but
c           it is a very inefficient program

      parameter (N=100)
      real ra (N), a(N), s
cmf$  layout ra(:serial)

      integer i, N

      do i = 1, N
         a(i) = i     ! initialize the distributed array
      end do

      do i = 1, N
         x = a(i)     ! node_get, host_get, indeed N broadcasts
         ra(i) = x    ! have_i_value
      end do

      s = sum (ra)    ! prove that host has correct values
      print *, 'Result is ', s, ' should be ', N * (N+1) / 2

      a = a + ra(N:1:-1)  ! local operation on nodes
      s = sum (a)     ! prove that nodes have correct values
      print *, 'Result is ', s, ' should be ', N * (N+1) 

      end
