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
PASSattribute. - Procedures which are bound to a derived type (type-bound procedures) including
PASS,PROCEDUREandGENERIC, and operators bound to a type. - Abstract interfaces and type extension with the possibility to override type-bound procedures or to have deferred binding.
- Polymorphic entities (“
CLASS”) for derived types and unlimited polymorphism (“CLASS(*)”) – includingSAME_TYPE_AS,EXTENDS_TYPE_OFandSELECT TYPEfor scalars and arrays and finalization. - Generic interface names, which have the same name as derived types, are now supported. This allows one to write constructor functions. Note that Fortran does not support static constructor functions. For static variables, only default initialization or structure-constructor initialization are available.
- The
ASSOCIATEconstruct. - Interoperability with C including enumerations,
- In structure constructors the components with default values may be omitted.
- Extensions to the
ALLOCATEstatement, allowing for a type-specification with type parameter and for allocation and initialization from aSOURCE=expression;ALLOCATEandDEALLOCATEoptionally return an error message string viaERRMSG=. - 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.
- Deferred-length character variables and scalar deferred-length character components of derived types are supported. (Note that array-valued compoents are not yet implemented.)
- Transferring of allocations via
MOVE_ALLOC. - The
PRIVATEandPUBLICattributes 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
INTENTmay be specified which affect the association status not the value of the pointer target. - Intrinsics
command_argument_count,get_command,get_command_argument, andget_environment_variable. - Support for Unicode characters (ISO 10646) and UTF-8, including the
SELECTED_CHAR_KINDandNEW_LINEintrinsic functions. - Support for binary, octal and hexadecimal (BOZ) constants in the intrinsic functions
INT,REAL,CMPLXandDBLE. - Support for namelist variables with allocatable and pointer attribute and nonconstant length type parameter.
-
Array constructors using square brackets. That is,
[...]rather than(/.../). 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.
-
FLUSHstatement. -
IOMSG=specifier for I/O statements. -
Support for the declaration of enumeration constants via the
ENUMandENUMERATORstatements. Interoperability withgccis guaranteed also for the case where the-fshort-enumscommand line option is given. -
TR 15581:
-
ALLOCATABLEdummy arguments. -
ALLOCATABLEfunction results -
ALLOCATABLEcomponents of derived types
-
-
The
OPENstatement supports theACCESS='STREAM'specifier, allowing I/O without any record structure. - Namelist input/output for internal files.
- Minor I/O features: Rounding during formatted output, using of a decimal comma instead of a decimal point, setting whether a plus sign should appear for positive numbers. On system where
strtodhonours the rounding mode, the rounding mode is also supported for input. -
The
PROTECTEDstatement and attribute. -
The
VALUEstatement and attribute. -
The
VOLATILEstatement and attribute. -
The
IMPORTstatement, allowing to import host-associated derived types. - The intrinsic modules
ISO_FORTRAN_ENVIRONMENTis supported, which contains parameters of the I/O units, storage sizes. Additionally, procedures for C interoperability are available in theISO_C_BINDINGmodule. -
USEstatement withINTRINSICandNON_INTRINSICattribute; supported intrinsic modules:ISO_FORTRAN_ENV,ISO_C_BINDING,OMP_LIBandOMP_LIB_KINDS. - Renaming of operators in the
USEstatement.
© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-4.9.3/gfortran/Fortran-2003-status.html