Modern Fortran tour: 2008, 2018, 2023
| 2008: the parallel turn | |
| 2018: polish everywhere | |
| 2023: the latest standard | |
| Follow compiler support |
2008: the parallel turn
The 2008 standard made parallelism a first class part of the language and added clear tools for concurrent loops and partitioned data.
Portable parallel loops became easy to write, and large machines could run the same standard source with different runtimes.
program concurrent_demo
implicit none
real :: a(5)
integer :: i
do concurrent (i = 1:5)
a(i) = real(i) * 2.0
end do
print *, a
end program concurrent_demo
2018: polish everywhere
The 2018 standard polished many corners of the language: parallel features, interoperability details, and long standing rough edges.
For daily code this means fewer workarounds and cleaner interaction between teams, images, and procedures.
program polish_demo
implicit none
integer :: vals(3)
vals = [10, 20, 30]
print *, "size =", size(vals)
print *, "sum =", sum(vals)
end program polish_demo
2023: the latest standard
The 2023 standard is the latest published milestone in the Fortran timeline after 2008 and 2018.
Compilers implement new standards progressively, so check your compiler manual for the current support level and keep course code to widely supported constructs.
gfortran --version
recent compiler with growing support for latest standard
Follow compiler support
Standards move first and compilers follow. Track support with the compiler release notes and the -std flag.
Write course code to the 2018 level by default, then enable newer options only when the target compiler is known.
gfortran -std=f2018 main.f90 -o main
strict standard check passes on supported compilers
Next: Capstone: stats tool
Article author: Arthur Isaev