Modern Fortran tour: 2008, 2018, 2023

Contents
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

Related articles
Fortran
Fortran course: zero to hero in 50 lessons
What is Fortran and where it runs
Install gfortran
Your first program
Program structure
Types: integer real complex logical character
Kind parameters
Operators
Conditions
DO loops
Arrays
Array sections
Character strings
Formatted IO
Files
Subroutines and functions
Modules
USE with ONLY
INTENT
OPTIONAL and PRESENT
Explicit interfaces
Derived types
Type-bound procedures
Object orientation
Operator overloading
Finalization
Allocatable arrays
Pointers in Fortran
DO CONCURRENT
Coarrays
OpenMP basics
Namelists
IEEE arithmetic
Intrinsic matrix math
Random numbers
String tools
Command-line arguments
Environment variables
error stop
Testing
Build with gfortran and make
Debugging
C interoperability
From fixed form to free form
Numeric models
Performance
Modern Fortran tour: 2008, 2018, 2023
Capstone: stats tool
Capstone: 1D heat equation
Style guide
Hero roadmap: the whole course on one page
Install gfortran on Windows 11
Install gfortran on Ubuntu
Install gfortran on Rocky Linux
Install gfortran on macOS
Install gfortran on FreeBSD
Fortran in Docker

Search this site

Channel @aofeed Chat @aofeedchat

Contacts and cooperation:
I recommend our hosting beget.com
Write to info@aredel.com if you:
1. Want to write an article for our site or translate an article into your native language.
2. Want to place thematically relevant ads on the site.
3. Ads on my site pass maximum censorship. If you see an ad block unsuitable for school-age children, shocking or misleading - please contact us by e-mail
4. Found a mistake, inaccuracy, bug, etc. on the site. ... .......
5. Articles can be shared on social media by clicking a network icon: