Flang Fortran Standards Support

---
local:
---

This document summarizes Fortran standards support in Flang. The information is only provided as a guideline. The TODOs/Not Yet Implemented messages emitted by the compiler for unimplemented features should be treated as authoritative.

The standards support information is provided as a table with three columns that are self explanatory. The Status column uses the letters Y, P, N for the implementation status:

  • Y : Yes. When the implementation is complete
  • P : Partial. When the implementation is incomplete for a few cases
  • N : No. When the implementation is absent

There is no distinction made between support in the Parser/Semantics and the MLIR or Lowering stages.

Note: The two major missing features in Flang at present are coarrays and parameterized derived types (PDTs) with length type parameters.

Fortran 2023

See document for a brief discussion about the new features in Fortran 2023. The following table summarizes the status of all important Fortran 2023 features. The table entries are based on the document The new features in Fortran 2023.

FeatureStatusComments
Allow longer statement lines and overall statement lengthY
Automatic allocation of lengths of character variablesN
The specifiers typeof and classofN
Conditional expressions and argumentsN
More use of boz constantsPAll usages other than enum are supported
Intrinsics for extracting tokens from a stringN
Intrinsics for Trig functions that work in degreesY
Intrinsics for Trig functions that work in half revolutionsY
Changes to system_clockN
Changes for conformance with the new IEEE standardY
Additional named constants to specify kindsY
Extensions for c_f_pointer intrinsicY
Procedures for converting between fortran and c stringsN
The at edit descriptorN
Control over leading zeros in output of real valuesN
Extensions for NamelistN
Allow an object of a type with a coarray ultimate component to be an array or allocatableN
Put with NotifyN
Error conditions in collectivesN
Simple proceduresN
Using integer arrays to specify subscriptsN
Using integer arrays to specify rank and bound of an arrayN
Using an integer constant to specify rankN
Reduction specifier for do concurrentPSyntax is accepted
EnumerationsN

Fortran 2018

All features except those listed in the following table are supported. Almost all of the unsupported features are related to the multi-image execution. The table entries are based on the document The new features in Fortran 2018.

FeatureStatusComments
Asynchronous communicationPSyntax is accepted
TeamsNMulti-image/Coarray feature
Image failurePMulti-image/Coarray feature. stat_failed_image is added
Form team statementNMulti-image/Coarray feature
Change team constructNMulti-image/Coarray feature
Coarrays allocated in teamsNMulti-image/Coarray feature
Critical constructNMulti-image/Coarray feature
Lock and unlock statementsNMulti-image/Coarray feature
EventsNMulti-image/Coarray feature
Sync team constructNMulti-image/Coarray feature
Image selectorsNMulti-image/Coarray feature
Intrinsic functions get_team and team_numberNMulti-image/Coarray feature
Intrinsic function image_indexNMulti-image/Coarray feature
Intrinsic function num_imagesNMulti-image/Coarray feature
Intrinsic function this_imageNMulti-image/Coarray feature
Intrinsic move_alloc extensionsPMulti-image/Coarray feature
Detecting failed and stopped imagesNMulti-image/Coarray feature
Collective subroutinesNMulti-image/Coarray feature
New and enhanced atomic subroutinesNMulti-image/Coarray feature
Failed images and stat= specifiersNMulti-image/Coarray feature
Intrinsic function coshapeNMulti-image/Coarray feature

Fortran 2008

All features except those listed in the following table are supported.

FeatureStatusComments
CoarraysNLowering and runtime support is not implemented
do concurrentPSequential execution works. Parallel support in progress
Internal procedure as an actual argument or pointer targetYCurrent implementation requires stack to be executable. See Proposal

Fortran 2003

All features except those listed in the following table are supported.

FeatureStatusComments
Parameterized Derived TypesPPDT with length type parameters is not supported. See Proposal
Assignment to allocatablePAssignment to whole allocatable in FORALL is not implemented
Asynchronous input/outputPIO will happen synchronously
MIN/MAX extensions for CHARACTERPSome variants are not supported

Fortran 95

All features are supported.

Fortran 90

All features are supported.

FORTRAN 77

All features are supported.