4.1 Fortran 2003 status
GNU Fortran supports several Fortran 2003 features; an incomplete
list can be found below. See also the
wiki page about Fortran 2003.
- Procedure pointers including procedure-pointer components with
- Procedures which are bound to a derived type (type-bound procedures)
operators bound to a type.
- Abstract interfaces and and type extension with the possibility to
override type-bound procedures or to have deferred binding.
- Polymorphic entities (“
CLASS”) for derived types – including
Note that the support for array-valued polymorphic entities is incomplete
and unlimited polymophism is currently not supported.
- Interoperability with C including enumerations,
- In structure constructors the components with default values may be
- Extensions to the
ALLOCATE statement, allowing for a
type-specification with type parameter and for allocation and initialization
optionally return an error message string via
- Reallocation on assignment: If an intrinsic assignment is
used, an allocatable variable on the left-hand side is automatically allocated
(if unallocated) or reallocated (if the shape is different). Currently, scalar
deferred character length left-hand sides are correctly handled but arrays
are not yet fully implemented.
- Transferring of allocations via
PUBLIC attributes may be given individually
to derived-type components.
- In pointer assignments, the lower bound may be specified and
the remapping of elements is supported.
- For pointers an
INTENT may be specified which affect the
association status not the value of the pointer target.
- Support for unicode characters (ISO 10646) and UTF-8, including
NEW_LINE intrinsic functions.
- Support for binary, octal and hexadecimal (BOZ) constants in the
- Support for namelist variables with allocatable and pointer
attribute and nonconstant length type parameter.
- Array constructors using square brackets. That is,
(/.../). Type-specification for array constructors like
(/ some-type :: ... /).
- Extensions to the specification and initialization expressions,
including the support for intrinsics with real and complex arguments.
- Support for the asynchronous input/output syntax; however, the
data transfer is currently always synchronously performed.
IOMSG= specifier for I/O statements.
- Support for the declaration of enumeration constants via the
ENUMERATOR statements. Interoperability with
gcc is guaranteed also for the case where the
-fshort-enums command line option is given.
- TR 15581:
ALLOCATABLE dummy arguments.
ALLOCATABLE function results
ALLOCATABLE components of derived types
OPEN statement supports the
allowing I/O without any record structure.
- Namelist input/output for internal files.
- Further I/O extensions: Rounding during formatted output, using of
a decimal comma instead of a decimal point, setting whether a plus sign
should appear for positive numbers.
PROTECTED statement and attribute.
VALUE statement and attribute.
VOLATILE statement and attribute.
IMPORT statement, allowing to import
host-associated derived types.
- The intrinsic modules
ISO_FORTRAN_ENVIRONMENT is supported,
which contains parameters of the I/O units, storage sizes. Additionally,
procedures for C interoperability are available in the
USE statement with
attribute; supported intrinsic modules:
- Renaming of operators in the