The Fortran Programming Language
This document provides a short overview of Fortran related resources, including a description of how the language is supported for use on LRZ systems via compilers, possibilities for consulting, and courses.
Introductory remarks
Fortran (which is a contraction of "FORmula TRANslator") is a programming language targeted at solving computational problems from science and engineering. It was developed in the 1950s inside IBM by a team led by John Backus; as a compiled language, it is designed for achieving the best possible speed for the generated executable code. Newer revisions of the Fortran standard are nowadays the basis for implementations of Fortran compilers by multiple vendors, which are typically deployed on computing systems ranging from workstations to large-scale HPC systems. Notwithstanding the advent of C, C++, Java and scripting languages like Perl or Python, Fortran is still quite extensively used for tasks which involve large-scale data processing or number crunching. Because modern compilers typically support creation of dynamic libraries, plug-ins written in Fortran can be embedded into applications written in other languages.
Language revisions and extensions
The following table provides an overview of relevant language revisions. In some cases language extensions were separately published as Technical Report (TR) or Technical Specification (TS); these can be considered "mini-standards" whose content is usually integrated into the regular language standard once a new revision of it is prepared.
Informal revision name | Year of publication | Comments |
Fortran 77 | 1977 | Many legacy libraries still use this version of the language; later revisions for the most part still support all the syntax and semantics of this version. However, newly developed programs should avoid using many old-fashioned features of this revision (especially fixed form and the global data concept). It is worth mentioning that many programs purporting to use Fortran 77 actually make use of language extensions defined by the US Department of Defense, most of which were subsumed into the Fortran 90 standard. |
Fortran 90 | 1990 | Major revision of the language that brought many new features (especially array processing, an extended type system, free source form, block constructs, dynamic memory management, and modules). |
Fortran 95 | 1995 | Minor revision that added corrections and some features targeted at parallel processing. Some Fortran 77 features are declared obsolescent. |
TR 15580 | 1999 | Technical Report that added IEEE floating point support, including limited exception handling. This TR was integrated into the Fortran 2003 standard and is therefore obsolete. |
TR 15581 | 1999 | Technical Report that extended the semantics of ALLOCATABLE entities. This TR was also integrated into the Fortran 2003 standard. |
Fortran 2003 | 2004 | Major revision. The most relevant new features were support for object orientation, (limited) interoperability with C, and extensions for I/O processing. |
TR 19767 | 2003 | Technical Report that specified syntax and semantics of submodules. This TR was integrated into the Fortran 2008 standard (with some improvements) and is obsolete. |
Fortran 2008 | 2010 | A moderate-sized revision that especially added a baseline set of parallel programming facilities (coarrays). |
TS 29113 | 2012 | Technical Specification that significantly extended the interoperation with C semantics. The main purpose was to permit specification and implementation of a conforming MPI interface. This TS has been integrated into the Fortran 2018 standard and is obsolete. |
TS 18508 | 2015 | Technical Specification that adds further parallel semantics to the coarray programming model. An overview of this was given at the workshop on Recent Advances in Parallel Programming - a PDF of the talk's slides is available from the linked page. This TS has been integrated into the Fortran 2018 standard and is obsolete. |
Fortran 2018 | 2018 | A minor revision that is mostly targeted at removing inconsistencies. The TS 29113 and TS 18508 have also been integrated. Mainline compilers currently support this revision. |
Fortran 2023 | Nov. 2023 | A minor revision, adding some parallel features, extended array syntax, incremental support for generic programming, conditional expressions, enumerations, additional intrinsics and other smaller items. The currently valid standard. |
F202Y | The feature list for the next revision has not yet been finalized, but is expected to include extensive support for generic programming. |
Support and Services at LRZ
Availability of compilers
On the (Linux-based) HPC systems at LRZ, the following compilers are available:
- Intel compiler: This is the current mainline compiler
- GNU Fortran
- NAG compiler
- NVidia compiler (with support for accelerator execution)
Please consult the linked documentation page of each compiler for details on configuration and usage.
Consulting
If you have questions related to Fortran programming, please open a ticket with appropriate topic and problem description at our Service Desk.
Courses
Fortran workshops of 3 and 5 days duration, respectively, are held at LRZ twice a year; please look at the course schedule for details such as topics and dates. The course materials are also available.
Fortran References
Books
- Metcalf, Reid, Cohen and Bader: Modern Fortran Explained, Oxford University Press, 2024 (incorporates Fortran 2023).
- J. Adams, W. Brainerd, R. Hendrickson, R. Maine, J. Martin, B. Smith: The Fortran 2003 Handbook, Springer 2009.
- Arjen Markus: Modern Fortran in Practice, Cambridge University Press, 2012.
- Norman Clerman, Walter Spector: Modern Fortran - Style and Usage, Cambridge University Press, 2012.
- Walter Brainerd: Guide to Fortran 2008 Programming, Springer, 2015.
- Ian Chivers, Jane Sleightholme: Introduction to Programming with Fortran, 4th edition, Springer, 2018.
- Stephen J. Chapman: Fortran for Scientists and Engineers, 4th edition, McGraw-Hill, 2017.
- Milan Curcic: Modern Fortran. Building efficient parallel applications, Manning, 2020.
- Gehrke: Fortran 90 Referenz-Handbuch; Hanser, 1991 (rather outdated by now).
Web resources
- Fortran on Wikipedia.
- Fortran 95 Language features. A comprehensive overview by Michael Metcalf.
- Fortran language web site.
- Fortran resources. Lists Compilers, Tools, Libraries, Books, Training Materials. Lots of links and ancillary material, by Ian Chivers and Jane Sleightholme.
- Einarsson, Bo und Shokin, Yurij: Fortran 90 for the Fortran 77 Programmer. A web tutorial.
- Fortran pages of the Open Directory Project.
- SIGPLAN Fortran Forum (published 3 times per year).
- The flang LLVM project
Here some information about compilers not provided on the LRZ HPC systems:
- Open64 (open-sourced by SGI)
- IBM xlf (targeted at POWER-based systems)
- Cray (select an entry in the Supercomputing Category and search from there)
- Oracle Studio (used to be Sun Studio) provides Fortran compilers for Solaris and Linux
John Reid has written a number of papers that summarize language features in newer revisions:
- the new features of Fortran 2003
- the new features of Fortran 2008
- coarrays in Fortran 2008
- the new features of Fortran 2018
- the new features of Fortran 2023
Newsgroups / Mailing Lists / Blogs
- comp.lang.fortran on Google Groups
- Fortran 90 list on JISCmail
- Steve Lionel's Dr Fortran blog
- https://fortran-lang.discourse.group/
Standardization
The standardization effort is driven by two committees: The international working group ISO/IEC JTC1/SC22/WG5 that is responsible for establishing the work items, and evaluating them when they're done, and the US Fortran standards committee J3 (formally INCITS/PL22.3) that does the actual technical development.
- The WG5 web space and its documents.
- The J3 web space and its documents.
The current Fortran standard document can be purchased from ISO. The same applies for currently active Technical Specifications.
An ancillary web site for discussion of potential new language features is the Fortran Proposals Github.