# What value does modern Fortran add?

For scientists, engineers and other performance-sensitive coders modern Fortran offers immediate advantages in developer time savings. The clarity, conciseness and power of modern Fortran are widely available in contemporary compilers. This brief post was motivated by viewpoints encountered including:

- those whose boss insisted on Fortran 77–they didn’t know anything newer than Fortran 90 existed.
- those who thought essentially no compilers supported newer than Fortran 95 standard (in calendar year 2018).

To be effective with programmer time, one generally shouldn’t needlessly upgrade all Fortran 77 code to modern Fortran, since Fortran has always maintained good backward compatibility. However, new and upgraded Fortran code should almost never be written in Fortran 77 unless specific job conditions dictate. Of course, Fortran 66 / Fortran IV is little supported and will need to be upgraded to Fortran 77 syntax, which is very similar except for file I/O.

New Fortran code should at least use Fortran 2003, which is universally supported by current compilers. In HPC environments, Gfortran and Intel oneAPI are widely supported, so we use modern Fortran features in virtually every program.

## Modern Fortran support

The compilers easily available supporting modern Fortran include:

- Gfortran: Most of Fortran 2018
- Intel oneAPI: “full” Fortran 2018 support
- NAG: Fortran 2008
- LLVM Flang: built from the ground up with Fortran 2018 standard as the target
- Nvidia HPC: Fortran 2003

Every year or so, Polyhedral updates their list of compilers supporting modern Fortran features.

## What did the major Fortran versions add

- Fortran 95 brought strong N-dimensional array operations. It is a key step toward modern Fortran, enabling arbitrary size (elemental) intrinsic and non-intrinsic procedures. With Fortran 95, one no longer had to to explicitly loop over almost every array operation.
- Fortran 2003 brought polymorphism and true object-oriented procedures, critical parts of modern generic programming.
- Fortran 2008 strengthened polymorphism, and baked coarray (distributed parallelism) directly into Fortran, transparently using underlying libraries such as OpenMPI.
Improved Fortran software architecture comes through
`submodule`

enabled by Fortran 2008. - Fortran 2018 strengthened coarray support, and did further important language cleanup such as enabling
`error stop`

within`pure`

procedures

Related: Gfortran feature set vs. OS and version