Gfortran and Intel oneAPI have options for enforcing the Fortran 2018 standard. The compilers raise additional warnings or errors for code that is not deemed compliant with the Fortran 2018 standard.
It’s also important in code you’re responsible for to always use
implicit none so that each variable must be assigned beforehand.
We recommend the Fortran 2018 statement:
implicit none (type, external)
which requires procedure interfaces to be explicitly defined as well.
type: the traditional
external: new for Fortran 2018, requires external procedures to have an explicit interface.
Get the latest Gfortran by:
At minimum a modern Fortran program should use these Gfortran options:
gfortran -std=f2018 -Wall -fimplicit-none
The Nvidia HPC Fortran compiler
nvfortran can enforce
implicit none via:
The currently supported Intel compilers should be used with at least these options for modern Fortran programs:
Linux / MacOS
ifort -stand f18 -warn
ifort /stand:f18 /warn
NAG 7.0 added the Fortran 2018 standard: