pull mpi generate out of fortran/core into mpi
rank_switch routine