      program hello

      include 'mpif.h'
      integer myrank, tnode, error

c  Initialize the MPI environment
      call MPI_INIT(error)
c
c  Determines the size of the group associated whith a communicater 
      call MPI_COMM_SIZE(MPI_COMM_WORLD, tnode, error)
c
c  Determines the rank of the calling process in the communicator
      call MPI_COMM_RANK(MPI_COMM_WORLD, myrank, error)

 100  format(a14,a10,i3,a11,i3)
      write(*,100)'Hello World.',' myrank =',myrank,',  tnode =',tnode
c
c  Terminates MPI execution environment
      call MPI_FINALIZE(error)
      stop
      end

c
ccc   Compile  ccc
c
c % mpif77 helloworld.f
c
ccc   Result   ccc
c
c % mpirun -np 4 ./a.out
c  Hello World.  myrank =  0 ,  tnode =  4
c  Hello World.  myrank =  1 ,  tnode =  4
c  Hello World.  myrank =  2 ,  tnode =  4
c  Hello World.  myrank =  3 ,  tnode =  4
