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 classofY
Conditional expressions and argumentsN
More use of boz constantsPAll usages other than enum are supported
Intrinsics for extracting tokens from a stringY
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 valuesY
Extensions for NamelistN
Allow an object of a type with a coarray ultimate component to be an array or allocatableNMulti-image/Coarray feature
Put with NotifyNMulti-image/Coarray feature
Error conditions in collectivesPExperimental support via PRIF
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 rankY
Reduction specifier for do concurrentP
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
Collective subroutinesPExperimental support via PRIF, missing co_reduce
Intrinsic function coshapePExperimental support via PRIF
Form team statementPExperimental support via PRIF
Change team constructPExperimental support via PRIF, missing coarray association
Sync team statementPExperimental support via PRIF
Intrinsic functions get_team and team_numberPExperimental support via PRIF
Team arguments to other intrinsicsPExperimental support via PRIF
Coarrays allocated in teamsNMulti-image/Coarray feature
Critical constructNMulti-image/Coarray feature
EventsNMulti-image/Coarray feature
Intrinsic move_alloc extensionsPMulti-image/Coarray feature
Detecting failed and stopped imagesNMulti-image/Coarray feature
New and enhanced atomic subroutinesNMulti-image/Coarray feature
Image failure and stat= specifiersPMulti-image/Coarray feature. stat_failed_image is added

Fortran 2008

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

FeatureStatusComments
do concurrentYSee Do Concurrent Conversion To OpenMP for implementation details.
Internal procedure as an actual argument or pointer targetYThe default implementation requires an executable stack; -fsafe-trampoline uses a runtime-managed pool on supported targets. See FAQ and design documentation
Intrinsic functions this_image, num_imagesPExperimental support via PRIF
Sync all, sync images, sync memory statementsPExperimental support via PRIF
Non-allocatable save coarrays of intrinsic typePExperimental support via PRIF
Other coarray data objectsNMulti-image/Coarray feature
Intrinsic functions image_index, ucobound, lcoboundPExperimental support via PRIF
Image selectors (coindexed access)NMulti-image/Coarray feature
Atomic subroutinesNMulti-image/Coarray feature
Lock and unlock statementsNMulti-image/Coarray feature

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.