MPI 3 Fortran 2008 interface

We recommend Fortran MPI programs use the MPI-2 interface via:

use mpi

or even better, the Fortran 2008 MPI-3 interface via:

use mpi_f08

instead of the deprecated and not recommended:

include 'mpif.h'

Intel MPI

IntelMPI supports MPI Fortran 2008 use mpi_f08 including on Windows using free Intel oneAPI compiler.

Interfacing MPI 3 with legacy Fortran code

MPI 3 constants like mpi_comm_world and mpi_real are no longer integer data type, but rather derived types. Some libraries have not yet updated to be polymorphic for this enhanced MPI 3 variable type. For such libraries, access the integer value via the %mpi_val property.

use mpi_f08

integer :: comm = mpi_comm_world%mpi_val
!! %mpi_var emits the legacy integer