      include 'mpif.h'
      parameter(numdat=100)
      integer filedata(numdat),dataarea(numdat)
      call MPI_INIT(ierr)
      call MPI_COMM_RANK(MPI_COMM_WORLD,myrank,ierr)
      call MPI_COMM_SIZE(MPI_COMM_WORLD,nprocs,ierr)
      icount=(numdat-1)/nprocs+1
      if(myrank==0) then
        open(10,file='fort.10')
        read(10,*) filedata
      endif
      call MPI_SCATTER(filedata, icount, MPI_INTEGER,
     &            dataarea(icount*myrank+1), icount, MPI_INTEGER,
     &            0, MPI_COMM_WORLD, ierr)
      isum1=0
      ist=icount*myrank+1
      ied=icount*(myrank+1)
      do i=ist,ied
         isum1=isum1+dataarea(i)
      enddo
      call MPI_REDUCE(isum1, isum, 1,
     &           MPI_INTEGER,MPI_SUM,
     &           0, MPI_COMM_WORLD, ierr)
      if(myrank==0)
     &  write(6,*)'isum=',isum
      call MPI_FINALIZE(ierr)
      stop
      end
