Understanding IEC 1539-1-12:2018 – The Fortran 2018 Standard for High-Performance Computing

Comprehensive guide to the scope, technical requirements, and compliance of Fortran 2018

Scope and General Overview

IEC 1539-1-12:2018, more formally identified as ISO/IEC 1539-1:2018, is the official standard for the Fortran programming language, often referred to as Fortran 2018. This international standard specifies the form and interpretation of programs expressed in the Fortran language. It supersedes the previous Fortran 2008 and Fortran 2003 standards and introduces enhancements that improve expressiveness, safety, and parallel performance for scientific and engineering computation.

The standard is developed jointly by the International Organization for Standardization (ISO) and the International Electrotechnical Commission (IEC), under the technical committee ISO/IEC JTC 1/SC 22. It addresses the base language syntax, semantics, intrinsic procedures, and storage association. Fortran 2018 is fully backward compatible with Fortran 2008, enabling a smooth migration for existing codebases.

Key objectives of the standard include:

  • Support for high-performance computing (HPC) with explicit parallelism (coarrays, teams, events).
  • Enhanced array operations and rank-agnostic programming.
  • Improved interoperability with C and other languages.
  • Clearer specifications for conformance and portability.

Technical Requirements and New Features

Fortran 2018 introduces a set of technical enhancements that extend the capabilities of the language while maintaining strict backward compatibility. The table below summarises the major new features and their impact on programming practice.

Feature Description Benefit
IMPRURE function Allows a function with side effects (e.g., I/O, modifying global variables) to be used in a pure context within DO CONCURRENT. Enables earlier error detection while still permitting necessary side effects.
DO CONCURRENT locality Enhanced locality specifiers (LOCAL, SHARED, LOCAL_INIT) for better control of data sharing in concurrent loops. Improves safety and optimiser information in parallel regions.
Conformance to TS 29113 Full adoption of the Technical Specification for Further Interoperability with C. Seamless binding of Fortran entities with C structures, pointers, and functions.
Rank-agnostic programming Select rank dummy arguments can be assumed shape without fixing the rank at compile time. Simplifies writing library routines that work on arrays of any dimensionality.
Coarray enhancements Teams, events, and coarray collective subroutines (e.g., CO_SUM, CO_BROADCAST). Robust support for partitioned global address space (PGAS) parallel models.
Unlimited polymorphic I/O Extended user-defined derived-type I/O (DTIO) to handle unlimited polymorphic objects. Greater flexibility in generic formatted I/O.

Additionally, the standard clarifies the interaction between the BLOCK construct and SAVE attributes, introduces ERROR STOP with a new QUIET specifier, and provides a revised set of intrinsic modules (such as ISO_FORTRAN_ENV) that expose environmental parameters.

Implementation Highlights

Implementers (compiler vendors, toolsmiths) and application developers should consider the following implementation aspects when adopting IEC 1539-1-12:2018:

  • Parallel execution model: The coarray model requires runtime support for communication and synchronisation. Most modern Fortran compilers (e.g., GNU Fortran, Intel Fortran, Cray Fortran) now implement either full or partial coarray support, including teams and events.
  • Interoperability: The C binding features are mature in all major compilers, but the new TS 29113 features (such as CFI_cdesc_t) may require updated runtime libraries. Developers should verify that their compiler version supports ISO_C_BINDING for all intended targets.
  • Rank-agnostic arguments: Using assumed-rank (DIMENSION(..)) dummy arguments requires careful handling of the SELECT RANK construct. Not all compilers implement the full semantics; refer to the compiler’s conformance report.
  • Source form and encoding: The standard retains free-source form as the primary form but clarifies support for Unicode in comments and string literals. Implementations may impose restrictions on character encodings beyond the required Fortran character set.
Tip: When migrating legacy Fortran 77/90/95 code to Fortran 2018, use the compiler’s strict standards-checking options (e.g., -std=f2018 in GNU Fortran) to identify non‑conforming constructs early.
Warning: Coarray collective operations (e.g., CO_SUM) are collective and introduce implicit synchronisation. Mixing them with explicit SYNC ALL statements can lead to deadlocks if not carefully managed.

Compliance and Conformance Notes

Conformance to IEC 1539-1-12:2018 is established at the level of a program or a processor (compiler plus runtime). According to the standard, a conforming program is solely written using the syntax and semantics described in the standard document, without relying on extensions or undefined behaviour. A conforming processor must correctly execute any conforming program, reject programs that violate syntax rules or explicit constraints, and may offer additional capabilities as long as they do not alter the behaviour of a conforming program.

Key compliance considerations are:

  • Obsolescent features: The standard lists several obsolescent features (e.g., COMMON, EQUIVALENCE, arithmetic IF, and PAUSE). While still supported, their use is discouraged and may not appear in future revisions.
  • Deleted features: Features deleted in Fortran 95 (e.g., real and double precision DO loops) remain removed; a conforming processor must not interpret them as Fortran.
  • Intrinsic module conformance: Procedures and constants defined in ISO_FORTRAN_ENV and IEEE_ARITHMETIC must be implemented exactly as described. Vendors should publish a list of supported intrinsics and their numerical characteristics.
  • Diagnostics: A conforming processor is required to diagnose all violations of syntax and constraints. Many compilers report warnings for non‑standard usage even if the program is accepted; this is considered good practice.
Good Practice: Always include the implicit none statement in every program unit and use the intent attribute for dummy arguments. These habits enhance readability and help the compiler catch logical errors.
Critical: Relying on processor‑specific extensions that conflict with the standard can cause portability failures. Where extensions are unavoidable, isolate them with pre‑processor conditionals (e.g., #ifdef _CRAY) and document the porting assumptions.

Frequently Asked Questions

Q: Is IEC 1539-1-12:2018 identical to the Fortran 2018 standard?
A: Yes. The official standard number is ISO/IEC 1539‑1:2018, often cross‑referenced internally as IEC 1539‑1‑12:2018. Both refer to the same document that defines the Fortran 2018 base language.
Q: Do all major compilers fully implement Fortran 2018?
A: Most compilers (GNU Fortran, Intel Fortran, IBM XL Fortran, Cray Fortran, NAG Fortran) have near‑complete support for core language features. However, advanced coarray features such as teams and events may still be partially implemented. Always consult the compiler’s release notes or conformance report.
Q: What is the most significant improvement over Fortran 2008?
A: The most impactful change is the formal adoption of the Technical Specification for Further Interoperability with C (TS 29113), which makes calling between Fortran and C far more robust. Additionally, the DO CONCURRENT locality enhancements improve the safety of parallel loops.
Q: Can I use Fortran 2018 features in a production environment right now?
A: Yes, but with caution. For production HPC codes, using basic coarrays (without teams) and the interoperability features is safe on modern compilers. Because the standard is still relatively new, avoid less‑tested features in time‑critical applications without a thorough validation plan.

Publication reference: ISO/IEC 1539‑1:2018 (commonly referred to as IEC 1539‑1‑12:2018). This article provides a technical overview and does not replace the full normative text.

Document revision date: 2026

📥 Standard Documents Download

🔒
Please wait 10 seconds, the download links will appear after the ad loads

Leave a Reply

Your email address will not be published. Required fields are marked *