Navigation: Previous   Up   Next

5.1 Non-standard Extensions

The following extensions to the standard Fortran language are accepted by the NAG Fortran Compiler.

5.1.1 BOZ literal constants outside DATA statements

The NAG Fortran Compiler accepts hexadecimal, octal and binary literal constants in any context where an integer literal would be accepted. Such constants have a data type of default INTEGER, unless there are more digits in the BOZ constant than will fit in a default INTEGER; e.g., Z'12345678' would be of type default INTEGER, and Z'123456789' would be a 64-bit integer.

5.1.2 Longer Names

Names may be up to 199 characters long.

5.1.3 Dollar Sign in Names

The dollar sign ‘$’ may appear in names as if it were a letter. On some systems this name is directly used in the link name, but on others, it is translated to DOLLAR.

5.1.4 Input/output endian/format conversion

Runtime conversion of unformatted input/output files is enabled by the CONVERT= specifier. This is an OPEN statement specifier, and takes a scalar default character argument; the accepted values are:
BIG_ENDIAN
synonym for BIG_IEEE;
BIG_IEEE_DD
big-endian with IEEE single and double precision floating point but with double-double for quad precision;
BIG_IEEE
big-endian with IEEE floating point include 128-bit quad precision;
BIG_NATIVE
big-endian with native floating-point formats;
LITTLE_ENDIAN
synonym for LITTLE_IEEE;
LITTLE_IEEE_DD
little-endian with IEEE single and double precision floating point but with double-double for quad precision;
LITTLE_IEEE
little-endian with IEEE floating point include 128-bit quad precision;
LITTLE_NATIVE
little-endian with native floating-point formats;
NATIVE
native endianness and data format.

It is also possible to specify this with an environment variable at runtime; when unit n is opened, if the environment variable FORT_CONVERTn exists, its value is interpreted as a CONVERT= specifier value. If the environment variable exists it takes precedence over any CONVERT= specifier in the OPEN statement. If the environment variable does not exist, and there is no CONVERT= specifier in the OPEN statement, the conversion mode is taken from the -convert= option at compile time; the default is NATIVE (i.e. no conversion).

The CONVERT= specifier is also available in the INQUIRE statement, and sets its argument to the current conversion mode or to 'UNKNOWN' if the file is not connected for unformatted input/output.

5.1.5 Elemental BIND(C) procedures

Interoperable (BIND(C)) procedures are permitted to be declared as ELEMENTAL. Such a procedure must satisfy the normal Fortran requirements for elemental procedures, in particular they must have scalar dummy arguments and must be pure (free from side-effects).

5.1.6 Maximum array rank is 31

The maximum rank of an array has been increased to 31 (the Fortran 2008 standard only requires 15, and previous Fortran standards only required 7). For example,
   REAL array(2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2)
declares a 30-dimensional array (which will take 4GiB of memory to store).