program hello_world
include 'mpif.h'
integer ierr
integer myrank, size
integer numsend, numrecv
integer :: status(MPI_STATUS_SIZE) 

    call MPI_INIT ( ierr )
    !print *, "Hello world"

    call MPI_Comm_rank(MPI_COMM_WORLD, myrank, ierr);
    call MPI_Comm_size(MPI_COMM_WORLD, size, ierr);
    !print *, "Hello World! I am rank ",myrank," of ", size

    numsend=33
    numrecv=50

    if ( myrank == 0 ) then
     call MPI_Send(numsend,1,MPI_INT,1,10,MPI_COMM_WORLD, ierr)
    else if ( myrank == 1 ) then
    call MPI_Recv(numrecv,1,MPI_INT,0,10,MPI_COMM_WORLD,status, ierr)
    else
      print *, "No MPI call assigned to me"
    end if

    if (myrank==1) then
    print *," I am rank",myrank," of ", size
    print *,"Received value numrecv= ", numrecv
    end if

call MPI_FINALIZE ( ierr )

end program hello_world
