Shuts down the MPI environment if it was started by this module.
subroutine mpi_flow_shutdown() logical :: finalized integer :: ierr call MPI_Finalized(finalized, ierr) if (ierr /= MPI_SUCCESS) return if (finalized) return if (mpi_started_here) then call MPI_Finalize(ierr) end if end subroutine mpi_flow_shutdown