Please also put IMPICIT NONE to your SUBROUTINE and replace INCLUDE
'mpif.h' by USE mpi. This comes with the benefit of interface checking.
The compiler will throw an error due to missing tags.
It is even better style to write:
END SUBROUTINE ...
END PROGRAM main
For more complex programs please use modules instead.