      real x(10000), sum, localsum
      N=10000
        ...
      localsum = 0.0
      k = nodeid()
      do i = 1+k*(N/P), (k+1)*(N/P)
         localsum = localsum + x(i)
      enddo
