Program test

#include "petsc/finclude/petscvec.h"
  use petscvec

  implicit none

  Vec            :: vec1, vec2
  VecScatter     :: toAll
  PetscErrorCode :: ierr
  PetscInt       :: n

  call PetscInitialize(PETSC_NULL_CHARACTER,ierr)

  n=100
  call VecCreateMPI(PETSC_COMM_WORLD,PETSC_DECIDE,n,vec1,ierr)
  call VecZeroEntries(vec1,ierr)
  call VecScatterCreateToAll(vec1,toAll,vec2,ierr)


  call PetscFinalize(ierr)


end program test
