This document adds the following features to the language:
Case is not significant in keywords and identifiers.
An initial line of a statement may contain a tab character in the label field, the tab character implies 'tab to column 7'. A line of this form may not contain more than 72 significant characters after expansion of the tab.
Additional Data Types
NAGWare f77 Tools Target Fortran 77 recognises the following data types in addition to those defined in the standard:
Double Complex
The double complex data type is analogous to the complex data type, with double precision data instead of real data. A double complex datum takes four numeric storage units.
The form of a double complex constant is similar to that of the complex constant, but either the real part or the imaginary part must be a double precision constant.
A double complex constant may appear anywhere that a complex constant would be legal.
The data type of the combination using a standard arithmetic operator of double complex with any arithmetic data type except quadruple precision real is double complex. Double complex may not be combined arithmetically with quadruple precision real.
The combination of double precision with complex produces a double complex result. Note that this is an extension of the Fortran 77 standard, which prohibits such a combination.
The following standard intrinsic functions accept a double complex argument: CMPLX, DBLE, INT, REAL, ABS, COS, EXP, LOG, SIN, SQRT. ABS returns a double precision result; COS, EXP, LOG, SIN and SQRT return double complex results.
The following additional intrinsic functions are allowed:
The additional features for double precision complex defined above represent commonly found extensions. These may not be acceptable to all compilers.
INTEGER*2 and REAL*16
Half precision integer and quadruple precision real may only be used for symbolic names - there are no constants of these data types.
Half-precision integer and quadruple-precision real may be used in arithmetic expressions. The result of combining half-precision integer with any other data type is that data type. The result of combining quadruple-precision real with any other data type except double complex is quadruple-precision real; quadruple-precision real must not be combined with double complex.
Half-precision integer and quadruple-precision real may also appear in DO statements (either as the controlling variable or in any of the limit expressions), i/o implied DO loops (similarly), arithmetic IF statements and in subscript expressions.
The following standard intrinsic functions will accept an half-precision integer argument: INT, REAL, DBLE, CMPLX, DCMPLX, ABS, MAX, MIN, MOD, SIGN. The following MIL-STD functions and subroutines will accept half-precision integer arguments: IOR, IAND, NOT, IEOR, ISHFT, ISHFCT, IBITS, MVBITS, BTEST, IBSET, IBCLR.
The following standard intrinsic functions will accept a quadruple-precision real argument: INT, REAL, DBLE, CMPLX, DCMPLX, NINT, ABS, COS, EXP, LOG, MAX, MIN, MOD, SIGN, SIN, SQRT, ACOS, AINT, ANINT, ASIN, ATAN, ATAN2, COSH, DIM, LOG10, SINH, TAN, TANH.
Quadruple-precision real and half-precision integer variables may be initialised in DATA statements with integer, real or double precision values. Half precision integer variables may be initialised in DATA statements with bit constants.
LOGICAL*1 and LOGICAL*2
There are no half-precision or quarter-precision logical constants - all logical constants are full precision.
The combination of logical data of differing precisions has the data type of the higher precision occurring.
Low-precision logical may in general be used as if it were full-precision logical, except for actual arguments to subprograms, which must match in precision with the receiving dummy argument.
---------------------------------------------------------- I2 I R D Q C DC ========================================================== I2 I2 I R D Q C DC ---------------------------------------------------------- I I R D Q C DC ---------------------------------------------------------- R R D Q C DC ---------------------------------------------------------- D D Q C DC ---------------------------------------------------------- Q Q err err ---------------------------------------------------------- C C DC ---------------------------------------------------------- DC DC ----------------------------------------------------------
The results are symmetric, so only half of the diagram is filled in. The changes from the Fortran 77 standard are:
- New rows/columns for I2 (INTEGER*2), Q (REAL*16) and DC (DOUBLE COMPLEX).
- Result of "D op C" is DC, not "prohibited".
Copyright, Numerical Algorithms Group, Oxford, 1991-2001