main_mpi added extern variables which will be needed in main after merge, main added mpi statements for different ranks and setup, still FREEING AND TERMINATING NEEEDED. Add some template method to call in the used mpi file?