      include 'mpif.h'
      integer,parameter :: numdat=100
      integer::idat(numdat)
      integer::nprocs,myrank,ierr
      integer::ist,ied
c 
      call MPI_INIT(ierr)
      call MPI_COMM_RANK(MPI_COMM_WORLD,myrank,ierr)
      call MPI_COMM_SIZE(MPI_COMM_WORLD,nprocs,ierr)
c
      ist = ((numdat-1)/nprocs+1)*myrank+1
      ied = ((numdat-1)/nprocs+1)*(myrank+1)
      open(10,file='fort.10')
      read(10,*) idat
c
      isum=0
      do i=ist,ied
        isum = isum + idat(i)
      enddo
c
      write(6,*) myrank,';partial sum=',isum
c
      call MPI_FINALIZE(ierr)
      stop
      end
