      program main
      use redirect
      implicit none 
      include 'mpif.h'

      integer myProc, ierr

      call MPI_INIT (MPI_COMM_WORLD)
      call MPI_COMM_RANK (MPI_COMM_WORLD, myProc, ierr)
      if (myProc==0) call MPH_redirect_output ('test')
      write(*,*) 'a=3'
      call MPI_FINALIZE (MPI_COMM_WORLD)

      end program 


