Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 3/22/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Conformance, Compatibility, and Fortran Features

This section contains information about Fortran language standards conformance, language compatibility, and supported features.

Language Standards Conformance

The Fortran standard has undergone several revisions since its initial publication as FORTRAN 66 (also known as FORTRAN IV). Subsequent revisions have been FORTRAN 77, Fortran 90, Fortran 95, Fortran 2003, Fortran 2008, and Fortran 2018. Each revision has added new features; some revisions have labeled features as "deprecated" (or obsolescent) or they have removed them. Intel® Fortran continues to support deprecated and deleted features.

Intel® Fortran conforms to these standards:

  • Fortran 2018 standard (ISO/IEC 1539-1:2018)

  • Fortran 2008 standard (ISO/IEC 1539-1:2010)

  • Fortran 2003 standard (ISO/IEC 1539-1:2004)

  • American National Standard Fortran 95 (ANSI X3J3/96-007)

    This is the same as International Standards Organization standard ISO/IEC 1539-1:1997 (E).

  • American National Standard Fortran 90 (ANSI X3.198-1992).

    This is the same as International Standards Organization standard ISO/IEC 1539:1991 (E).

The Fortran Standards committee is currently answering questions of interpretation on Fortran 2018 language features. Any answers given by the committee that are related to features implemented in Intel® Fortran may result in changes in future releases of the Intel® Fortran Compiler, even if the changes produce incompatibilities with earlier releases of Intel® Fortran.

Intel Fortran provides a number of extensions to the Fortran 2018 Standard. In the language reference, extensions (non-standard features) are displayed in this color.

Intel® Fortran also includes support for programs that conform to the previous Fortran standards (ANSI X3.9-1978 and ANSI X3.0-1966), the International Standards Organization standard ISO 1539-1980 (E), the Federal Information Processing Institute standard FIPS 69-1, and the Military Standard 1753 Language Specification.

Language Compatibility

Intel® Fortran is highly source-compatible with Compaq* Visual Fortran on supported systems, and it is substantially source-compatible with DEC* Fortran 90 and VAX* FORTRAN 77.

Fortran 2023 Features

The following Fortran 2023 features are new in this release:

  • Source input lines in free format can have up to 10,000 characters.

  • A Fortran statement can contain up to 1,000,000 characters.

  • New named constants LOGICAL8, LOGICAL16, LOGICAL32, LOGICAL64, and REAL16 in the intrinsic module ISO_FORTRAN_ENV.

  • New procedures C_F_STRPOINTER and F_C_STRING for C interoperability have been added to the intrinsic module ISO_C_BINDING.

  • Optional argument lower to subroutine C_F_POINTER in the intrinsic module ISO_C_BINDING, which allows specifying lower bounds for the fptr array pointer argument.

  • Two argument form of the intrinsic trigonometric function ATAND (Y, X) whose arguments are in degrees.

The following Fortran 2023 features are also supported:

  • The REDUCE locality spec on DO CONCURRENT

  • Binary, octal, and hexadecimal (BOZ) constants on the right-hand side of INTEGER and REAL assignment statements

  • BOZ constants as INTEGER and REAL values in PARAMETER statements

  • BOZ constants as INTEGER or REAL as array constructor values

  • BOZ constants as INTEGER values in ENUMERATION statements

  • Intrinsic trigonometric functions returning degrees: ACOSD(X), ASIND(X), ATAND(X), ATAN2D(Y, X), COSD(X), SIND(X), and TAND(X)

Fortran 2018 Features

The following Fortran 2018 feature is new in this release:

  • ifort now enforces strict F2018 conformance for arguments to the C_LOC function.

The following Fortran 2018 features are also supported:

  • Coarray teams have been implemented.

  • The derived type TEAM_TYPE has been added to the ISO_FORTRAN_ENV intrinsic module.

  • The CHANGE TEAM and END TEAM statements have been implemented.

  • The FORM TEAM statement has been implemented.

  • The SYNC TEAM statement has been implemented.

  • The TEAM_NUMBER intrinsic function has been implemented.

  • The GET_TEAM intrinsic function has been implemented.

  • The TEAM argument has been added to the intrinsic functions FAILED_IMAGES, IMAGE_STATUS, and STOPPED_IMAGES.

  • The optional TEAM argument has been added to the intrinsic functions STOPPED_IMAGES, NUM_IMAGES, and IMAGE_STATUS.

  • New forms of the intrinsic function IMAGE_INDEX and NUM_IMAGES allow optional TEAM and TEAM_NUMBER arguments have been implemented.

  • A new form of THIS_IMAGE with a TEAM argument has been implemented.

  • An optional TEAM or TEAM_NUMBER specifier is now permitted in image selectors.

  • Implicit allocation of an unallocated coarray in a variable definition context is now prohibited.

  • Nonpolymorphic pointer arguments to the EXTENDS_TYPE_OF and SAME_TYPE_AS intrinsics no longer need to have defined allocation status.

  • Deallocation during finalization has been clarified and now occurs using the semantics defined in Fortran 2018.

  • Output from the STOP and ERROR_STOP statement may now be conditionally suppressed.

  • STOP and ERROR STOP codes can now be non-constant expressions.

  • Named constants of type LOCK_TYPE are no longer allowed.

  • The DIM argument to the intrinsic functions ALL, ANY, IALL, IANY, IPARITY, MAXLOC, MAXVAL, MINLOC, MINVAL, NORM2, PARITY, PRODUCT, SUM, and THIS_IMAGE may now be a present OPTIONAL dummy argument.

  • VALUE dummy arguments to PURE procedures may appear in variable definition contexts.

  • The optional ERRMSG argument has been added to the intrinsic procedures GET_COMMAND_ARGUMENT, GET_ENVIRONMENT_VARIABLE, and GET_COMMAND.

  • The OUT_OF_RANGE intrinsic function has been implemented.

  • The RANDOM_INIT intrinsic subroutine has been implemented.

  • Dummy arguments to defined assignment and operator procedures need not have the INTENT(IN) attribute if they have the VALUE attribute.

  • A dummy argument of PURE procedure may appear in a variable definition context if it has the VALUE attribute.

  • Constant properties of an object can be used in the objects initialization.

  • Polymorphic structure constructor components no longer need to have the same dynamic type as their corresponding structure component expression.

  • The RANDOM_INIT intrinsic subroutine has been implemented.

  • Several new Fortran 2018 terms have been added to the Glossary; for example: current team, ancestor team, parent team, and established coarrays.

  • Non-pointer variables with the PROTECTED attribute may no longer appear as a data-target or as a initial-data-target.

  • VOLATILE variables are now prohibited in PURE procedures and statement functions.

  • The type and kind of an implied DO loop variable can now be specified in an implied-do loop of array constructors and data statements.

  • Floating point comparisons perform IEEE compareSignaling<relation> operations when the assume ieee_compares or -standard-semantics compiler option is specified.

  • The REDUCE intrinsic that performs user-defined reductions has been implemented.

  • Enhancements to the IMPLICIT NONE statement allow specifying that all external procedures must be declared as EXTERNAL.

  • Enhancements to the GENERIC statement permit it to be used to declare generic interfaces.

  • You can now specify locality for variables in a DO CONCURRENT statement.

  • Enhancements to edit descriptor forms E and D, EN, ES, and G allow a field width of zero, analogous to the F edit descriptor.

  • The exponent width e in a data edit descriptor can now be zero, analogous to a field width of zero.

  • The RN edit descriptor now rounds to nearest as specified by Fortran 2018 and ISO/IEC/IEEE 60559:2011.

  • The EX edit descriptor allows for hexadecimal format output of floating-point values, and hexadecimal format floating-point values are allowed on input.

  • SIZE= can be specified for non-advancing I/O.

  • The values for SIZE= and POS= in an INQUIRE statement for pending asynchronous operations have been standardized.

  • The value assigned to the RECL= specifier in an INQUIRE statement now has standardized values.

  • A new form of the intrinsic function CMPLX does not require the KIND= keyword if the first argument is type COMPLEX.

  • The arguments to the SIGN function can be of different kinds.

  • The named constants STAT_FAILED_IMAGE and STAT_UNLOCKED_FAILED_IMAGE have been defined in the intrinsic ISO_FORTRAN_ENV modules.

  • The named constant kind type C_PTRDIFF_T has been added to the intrinsic module ISO_C_BINDING.

  • The non-block DO statement and the arithmetic IF statement are now deleted in Fortran 2018. Intel® Fortran fully supports features deleted in the Fortran Standard.

  • COMMON, EQUIVALENCE and BLOCKDATA statements are now obsolescent.

  • The labeled form of a DO loop is now obsolescent.

  • Specific names of intrinsic procedures are now obsolescent.

  • The following atomic subroutines have been implemented: ATOMIC_ADD, ATOMIC_AND, ATOMIC_CAS, ATOMIC_FETCH_ADD, ATOMIC_FETCH_AND, ATOMIC_FETCH_OR, ATOMIC_FETCH_XOR, ATOMIC_OR, and ATOMIC_XOR.

  • The following collective subroutines have been implemented: CO_BROADCAST, CO_MAX, CO_MIN, CO_REDUCE, and CO_SUM.

  • The SELECT RANK construct has been implemented allowing manipulation of assumed rank dummy arguments..

  • The compiler will now diagnose the use of nonstandard intrinsic procedures and modules as required by Fortran 2018.

  • To comply with the latest Fortran 2018 standards, C_F_PROCPOINTER is now IMPURE.

  • Transformational intrinsic functions from the intrinsic modules ISO_C_BINDING, IEEE_ARITHMETIC, and IEEE_EXCEPTIONS are now allowed in specification expressions.

  • You can now specify optional argument RADIX for the IEEE_GET_ROUNDING_MODE and IEEE_SET_ROUNDING_MODE intrinsic module procedures.

  • IEEE_ROUND_TYPE and IEEE_AWAY have been added to the IEEE_ARITHMETIC intrinsic module.

  • The optional ROUND argument has been added to the IEEE_RINT function defined in the intrinsic module IEEE_ARITHMETIC.

  • The intrinsic module IEEE_ARITHMETIC now includes the functions IEEE_FMA, IEEE_SIGNBIT, IEEE_NEXT_UP, and IEEE_NEXT_DOWN.

  • The intrinsic module IEEE_EXCEPTIONS now contains a new derived type, IEEE_MODES_TYPE, which can be used to save and restore the IEEE_MODES using the IEEE_GET_MODES and the IEEE_SET_MODES intrinsic module procedures.

  • SUBNORMAL is now synonymous with DENORMAL.

  • The following intrinsic module procedures have been implemented:

  • An optional STAT= specifier has been added to ATOMIC_REF and ATOMIC_DEFINE intrinsic procedures.

  • Optional STAT= and ERRMSG= specifiers have been added to the MOVE_ALLOC intrinsic procedure, to image selectors, and to the CRITICAL statement and construct.

  • INTEGER and LOGICAL arguments to intrinsic procedures are no longer required to be of default kind.

  • The intrinsic module procedures IEEE_INT and IEEE_REAL have been implemented.

  • The FAIL IMAGE statement has been implemented. It allows debugging recovery code for failed images without having to wait for an actual image failure.

  • Intrinsic functions FAILED_IMAGES, IMAGE_STATUS, and STOPPED_IMAGES have been implemented.

  • The COSHAPE intrinsic function returns the cobounds of a coarray argument.

  • You can now add module names, OpenMP reduction identifiers, and defined I/O generic specs to PUBLIC and PRIVATE statements.

  • Coarray EVENTs provide synchronization capabilities between images:

    EVENT_QUERY intrinsic subroutine

    EVENT_POST and EVENT_WAIT statements

    The derived type EVENT_TYPE is defined in the ISO_FORTRAN_ENV intrinsic module.

  • The IMPORT statement can now be used in internal subprograms and BLOCK constructs to control host association. There are three new forms:

    • IMPORT, ALL

    • IMPORT, NONE

    • IMPORT, ONLY: import-name-list

  • A module name that is accessed via used association can appear in a PUBLIC or PRIVATE access-id-list . It can be used to set the default accessibility for all accessible entities from that module.

  • C language interoperability :

    • An assumed-rank array is now permitted to be an argument to the C_SIZEOF intrinsic function.

    • With the exception of C_F_POINTER, all standard procedures in the ISO_C_BINDING intrinsic module are now PURE.

    • Assumed type variables

    • Assumed-rank arrays

    • C descriptors

    • RANK intrinsic function

  • The NON_RECURSIVE keyword declares a procedure as not recursive. The default in previous Fortran standards was that procedures were non-recursive unless declared RECURSIVE. Fortran 2018 changes that default. Intel® Fortran has implemented the NON_RECURSIVE keyword, but the default compilation mode for this release remains non-recursive.

  • The ERROR STOP statement is allowed in PURE procedures

Fortran 2008 Features

The following Fortran 2008 features are new in this release:

  • Specification expressions can now contain user-defined operators.

  • Direct access user-defined I/O has been implemented.

The following Fortran 2008 features are also supported:

  • The FINDLOC intrinsic function

  • You can specify optional argument BACK in MAXLOC and MINLOC intrinsic functions.

  • You can declare multiple type-bound procedures in a PROCEDURE list.

  • Intrinsic assignment to an allocatable polymorphic variable is allowed if the variable is not a coarray. For more information, see Examples of Intrinsic Assignment to Polymorphic Variables.

  • The intrinsic module functions COMPILER_OPTIONS and COMPILER_VERSION

  • Subscripts and nested implied-DO limits in a data statement can be any constant expression instead of being limited to combinations of constants, implied-DO variables, and intrinsic operations.

  • The intrinsic functions ACOS, ACOSH, ASIN, ASINH, ATAN, ATANH, COSH, SINH, TAN, and TANH now take arguments of type COMPLEX. The intrinsic function ATAN (Y, X) is defined as ATAN2 (Y, X).

  • A pointer dummy argument with INTENT(IN) can be argument associated with a non-pointer actual argument with the TARGET attribute.

  • A reference to a function that returns a data pointer is treated as a variable and is permitted in any variable-definition context .

  • Allocatable components are allowed to be of recursive type, that is, the type being defined, or of a forward type, that is, a derived type that is not yet defined.

  • In an ALLOCATE statement, you can specify more than one allocate object for a given SOURCE= or MOLD=. Also, if you do not specify upper and lower bounds in an ALLOCATE statement's s-spec list, the shape of the array is that of SOURCE=source-expr or MOLD=source-expr.

  • Initialization expressions are now referred to as constant expressions.

  • An EXIT statement can appear in a BLOCK, IF, ASSOCIATE, SELECT CASE, or SELECT TYPE construct.

  • You can specify intrinsic types in a TYPE statement

  • You can specify implied-shape array specifications for named constant arrays

  • You can specify %re and %im designators for the real and imaginary parts of values of COMPLEX type

  • Pointer Initialization

  • Binary, octal, and hexadecimal constants are allowed for one or more arguments in intrinsic routines BGE, BGT, BLE, BLT, CMPLX, DBLE, DSHIFTL, DSHIFTR, IAND, IEOR, INT, IOR, MERGE_BITS, and REAL.

  • You can specify an optional integer datatype for the subscript-name in the triplet-spec in the FORALL statement.

  • An ALLOCATE statement can give a polymorphic variable the shape and type of another variable without copying the value. This is done with MOLD= replacing SOURCE=.

  • Except for procedure arguments and pointer dummy arguments, a PURE function may have a dummy argument with the VALUE attribute without the explicit INTENT(IN) attribute.

  • Dummy arguments of ELEMENTAL procedures may appear in specification expressions in the procedure.

  • You can specify an optional RADIX argument for the intrinsic function SELECTED_REAL_KIND and the intrinsic module procedure IEEE_SELECTED_REAL_KIND.

  • Submodules

  • IMPURE keyword

  • The EXECUTE_COMMAND_LINE subroutine

  • The BLOCK construct

  • The FUNCTION and SUBROUTINE keywords on the END statement are optional for internal procedures and module procedures.

  • A negative value that is not zero but rounds to zero on output is displayed with a leading minus sign

  • Generic resolution of procedures where one dummy argument has the ALLOCATABLE attribute and the other has the POINTER attribute without INTENT (IN), or where one is a procedure and the other is a data object.

  • The ENTRY statement is an obsolescent feature.

  • A source statement can begin with one or more semicolon characters.

  • Coarray intrinsic routines: ATOMIC_DEFINE and ATOMIC_REF

  • A polymorphic MOLD= specifier for ALLOCATE

  • Coarrays (Windows* and Linux* only)

  • Image control statements: SYNC ALL, SYNC IMAGES, SYNC MEMORY, CRITICAL, LOCK, and UNLOCK

  • Coarray intrinsic routines: IMAGE_INDEX, LCOBOUND, NUM_IMAGES, THIS_IMAGE, and UCOBOUND

  • CRITICAL construct

  • Maximum array rank of 15 (Intel® Fortran allows 31 dimensions)

  • G0 and G0.d format edit descriptors

  • FINAL routines

  • GENERIC, OPERATOR, and ASSIGNMENT overloading in type-bound procedures

  • A generic interface may have the same name as a derived type

  • Bounds specification and bounds remapping list on a pointer assignment

  • In formatting, a * indicates an unlimited repeat count

  • NEWUNIT= specifier in OPEN

  • A CONTAINS section can be empty

  • Attributes CODIMENSION and CONTIGUOUS

  • Coarrays can be specified in ALLOCATABLE, ALLOCATE, and TARGET statements

  • MOLD keyword in ALLOCATE

  • DO CONCURRENT statement

  • ERROR STOP statement

  • Intrinsic functions BESSEL_J0, BESSEL_J1, BESSEL_JN, BESSEL_Y0, BESSEL_Y1, BESSEL_YN, BGE, BGT, BLE, BLT, DSHIFTL, DSHIFTR, ERF, ERFC, ERFC_SCALED, GAMMA, HYPOT, IALL, IANY, IPARITY, IS_CONTIGUOUS, LEADZ, LOG_GAMMA, MASKL, MASKR, MERGE_BITS, NORM2, PARITY, POPCNT, POPPAR, SHIFTA, SHIFTL, SHIFTR, STORAGE_SIZE, TRAILZ

  • ISO_FORTRAN_ENV module constants ATOMIC_INT_KIND, ATOMIC_LOGICAL_KIND, CHARACTER_KINDS, INTEGER_KINDS, INT8, INT16,INT32, INT64, LOGICAL_KINDS, REAL_KINDS, REAL32, REAL64, REAL128, STAT_LOCKED, STAT_LOCKED_OTHER_IMAGE, STAT_UNLOCKED

  • ISO_FORTRAN_ENV type LOCK_TYPE

  • SCALAR keyword for ALLOCATED

Fortran 2003 Features

Fortran 2003 is fully supported, including the following features:

  • Parameterized derived types with KIND and LENGTH type parameters and the %KIND and %LEN type parameter designators

  • A polymorphic dummy argument that has the attribute INTENT(OUT) becomes UNDEFINED or it will have DEFAULT INITIALIZATION applied.

  • User-Defined Derived-Type I/O

  • A polymorphic SOURCE= specifier for ALLOCATE

  • Bounds specification and bounds remapping list on a pointer assignment

  • FINAL routines

  • GENERIC, OPERATOR, and ASSIGNMENT overloading in type-bound procedures

  • Enumerators

  • Type extension (not polymorphic)

  • Type-bound procedures

  • Allocatable scalar variables (not deferred-length character)

  • ERRMSG keyword for ALLOCATE and DEALLOCATE

  • SOURCE= keyword for ALLOCATE

  • Character arguments for MAX, MIN, MAXVAL, MINVAL, MAXLOC, and MINLOC

  • Intrinsic modules IEEE_EXCEPTIONS, IEEE_ARITHMETIC and IEEE_FEATURES

  • ASSOCIATE construct

  • DO CONCURRENT construct

  • PROCEDURE declaration

  • Procedure pointers

  • ABSTRACT INTERFACE

  • PASS and NOPASS attributes

  • CONTIGUOUS attribute

  • Structure constructors with component names and default initialization

  • Array constructors with type and character length specifications

  • I/O keywords BLANK, DECIMAL, DELIM, ENCODING, IOMSG, PAD, ROUND, SIGN, and SIZE

  • Format edit descriptors DC, DP, RD, RC, RN, RP, RU, and RZ

  • The COUNT_RATE argument to the SYSTEM_CLOCK intrinsic may be a REAL of any kind.

  • NAMELIST I/O for internal files

  • Intrinsic functions EXTENDS_TYPE_OF and SAME_TYPE_AS

  • SELECT TYPE construct

  • CLASS declaration

  • PUBLIC types with PRIVATE components and PRIVATE types with PUBLIC components

  • RECORDTYPE setting STREAM_CRLF

  • A file can be opened for stream access (ACCESS='STREAM')

  • Specifier POS can be specified in an INQUIRE, READ, or WRITE statement

  • BIND attribute and statement

  • Language binding can be specified in a FUNCTION or SUBROUTINE statement, or when defining a derived type

  • IS_IOSTAT_END intrinsic function

  • IS_IOSTAT_EOR intrinsic function

  • INTRINSIC and NONINTRINSIC can be specified for modules in USE statements

  • ASYNCHRONOUS attribute and statement

  • VALUE attribute and statement

  • Specifier ASYNCHRONOUS can be specified in an OPEN, INQUIRE, READ, or WRITE statement

  • An ID can be specified for a pending data transfer operation

  • FLUSH statement

  • WAIT statement

  • IMPORT statement

  • NEW_LINE intrinsic function

  • SELECTED_CHAR_KIND intrinsic function

  • Intrinsic modules ISO_C_BINDING and ISO_FORTRAN_ENV

  • Specifiers ID and PENDING can be specified in an INQUIRE statement

  • User-defined operators can be renamed in USE statements

  • MOVE_ALLOC intrinsic subroutine

  • PROTECTED attribute and statement

  • Pointer objects can have the INTENT attribute

  • GET_COMMAND intrinsic

  • GET_COMMAND_ARGUMENT intrinsic

  • COMMAND_ARGUMENT_COUNT intrinsic

  • GET_ENVIRONMENT_VARIABLE intrinsic

  • Allocatable components of derived types

  • Allocatable dummy arguments

  • Allocatable function results

  • VOLATILE attribute and statement

  • Names of length up to 63 characters

  • Statements up to 256 lines

  • A named PARAMETER constant may be part of a complex constant

  • In all I/O statements, the following numeric values can be of any kind: UNIT=, IOSTAT=

  • The following OPEN numeric values can be of any kind: RECL=

  • The following READ and WRITE numeric values can be of any kind: REC=, SIZE=

  • The following INQUIRE numeric values can be of any kind: NEXTREC=, NUMBER=, RECL=, SIZE=

  • Recursive I/O is allowed when the new I/O being started is internal I/O that does not modify any internal file other than its own

  • IEEE infinities and Nans are displayed by formatted output as specified by Fortran 2003

  • In an I/O format, the comma after a P edit descriptor is optional when followed by a repeat specifier

  • The following intrinsics take an optional KIND= argument: ACHAR, COUNT, IACHAR, ICHAR, INDEX, LBOUND, LEN, LEN_TRIM, MAXLOC, MINLOC, SCAN, SHAPE, SIZE, UBOUND, VERIFY

  • Square brackets [ ] are permitted to delimit array constructors instead of (/ /)

  • The Fortran character set has been extended to contain the 8-bit ASCII characters ~ \ [ ] ` ^ { } | # @