Navigation: Previous   Up   Next

5.2 Obsolete Extensions

The following extensions were common in the Fortran 77 era, and are still in frequent use (though they have been superseded and are thus unnecessary). Warning messages (marked ‘Extension:’) are produced for each occurrence of any extension; these particular ones may be suppressed with the -w=x77 option.

5.2.1 Byte Sizes

Byte sizes for REAL, INTEGER, LOGICAL and COMPLEX are accepted and mapped to Fortran 90/95 KINDS.

Byte Size Specification Standard Fortran Using F90_KIND
REAL*4 Real Real(real32)
REAL*8 Double Precision Real(real64)
REAL*16 Real(Selected_Real_Kind(30)) Real(real128)
COMPLEX*8 Complex Complex(real32)
COMPLEX*16 Complex(Kind(0d0)) Complex(real64)
COMPLEX*32 Complex(Selected_Real_Kind(30)) Complex(real128)
INTEGER*1 Integer(Selected_Int_Kind(2)) Integer(int8)
INTEGER*2 Integer(Selected_Int_Kind(4)) Integer(int16)
INTEGER*4 Integer Integer(int32)
INTEGER*8 Integer(Selected_Int_Kind(18)) Integer(int64)
LOGICAL*1 Logical(1) Logical(byte)
LOGICAL*2 Logical(2) Logical(twobyte)
LOGICAL*4 Logical Logical(word)
LOGICAL*8 Logical(logical64)

The byte length may also be overridden in the type declaration, similar to overriding the character length. For example,

    REAL X*4, Y*(8)

5.2.2 TAB Format

The occurrence of a TAB character in fixed-form source is treated as follows:
  1. an initial TAB followed by a digit is expanded to 5 spaces (putting the digit in the continuation column),
  2. an initial TAB followed by any other character is expanded to 6 spaces (putting the character after the TAB in column 7, making the line the initial line of a statement), and
  3. other TAB characters are treated as single blanks except in character context where they remain TABs (but they are still treated as taking one column for the purposes of line length).

5.2.3 Hollerith Constants

Hollerith constants may be used as actual arguments or to initialise objects in DATA. In either case they must be associated with an object of intrinsic numeric data type, not with a CHARACTER or derived type object.

Hollerith i/o (i.e., use of the A edit descriptor with non-CHARACTER data) is only enabled if the using subprogram was compiled with the -hollerith_io or -dusty option.

5.2.4 D (debug) lines in Fixed Source Form

A line with the letter ‘D’ (or ‘d’) in column one is a D line. If the -d_lines option is used, this will be treated as a normal Fortran line, as if the D were a space. Otherwise, it will be treated as a comment line, as if the D were a C.

For example, in

      SUBROUTINE TEST(N)
      INTEGER N
D     PRINT *,'TESTING N'
      ...
the PRINT statement will be compiled only if -d_lines is used.

Note that if the initial line of a statement is a D line, any continuation lines it may have must also be D lines. Similarly, if the initial line of a statement is not a D line, any continuation lines must not be D lines.

A D line can use TAB format, with the TAB expanding to one less space as the letter D already accounts for a space.

5.2.5 Increased Line Length in Fixed Source Form

The -132 option increases the effective length of each fixed source form input line from 72 characters to 132 characters.

Note that when this option is used the NAG Fortran Compiler no longer conforms to the Fortran language standard. The meaning of a program will change if it contains a character constant which is continued across a line boundary. A standard-conforming program containing an H-edit descriptor which is continued across a line boundary will very likely be rejected.

For new Fortran programs we recommend the use of free source form instead of this option. Free source form provides superior detection of typographical errors and is also part of the Fortran standard and thus fully portable to all standard-conforming compilers.

5.2.6 Increased Maximum Number of Continuation Lines

The -maxcontin=N option increases the limit on the maximum number of continuation lines to N. Note that this option can affect both fixed source form and free source form, but never decreases the continuation line limit below the standard.

The Fortran 90 and 95 standards specified that the maximum number of continuation lines in fixed source form was 19, and that the maximum number of continuation lines in free source form was 39. The Fortran 2003 standard increased this to 255 lines regardless of source form.

5.2.7 Intrinsic functions with mixed-kind arguments

The ATAN, ATAN2, DIM, MAX, MIN, MOD, MODULO and SIGN intrinsic functions will accept integer and real arguments that differ in kind; note that integer and real arguments still cannot be mixed in a single intrinsic function reference.

For SIGN, the kind of the result is the same as the kind of the first argument (which supplies the magnitude of the result), ignoring the kind of the second argument (which only supplies the sign of the result). For all the others, the kind of the result is the same as for arithmetic operations, i.e. for integers the kind with the largest number of digits, and for reals the kind with the greatest precision.

For example, if X is REAL(real32) and Y is REAL(real64):

MAX(X,Y) has kind real64 and its value is equal to MAX(REAL(X,real64),Y);
SIGN(X,Y) has kind real32 and its value is equal to SIGN(X,REAL(SIGN(1.0_real64,Y),real32)).

5.2.8 Legacy Application Support

The -dusty option downgrades the category of common errors found in “legacy” software from “Error” to “Warning”, allowing such programs to be compiled and run. (The messages may be suppressed altogether by additionally specifying the -w option.)

This option also effectively provides the extensions of allowing COMMON blocks to be initialised outside of BLOCK DATA, and of accepting VAX format octal and hexadecimal constants (these have the forms '...'O and '...'X respectively).

5.2.9 Mismatched Argument Lists

The -mismatch option downgrades checking of procedure argument lists so that inconsistencies between calls to routines which are not in the current file being processed produce warning messages rather than error messages.

The -mismatch_all option further downgrades argument list checking so that incorrect calls to routines present in the current file being processed produce warning messages instead of error messages.

5.2.10 Double Precision Complex Extensions

Double precision complex entities may be declared with the DOUBLE COMPLEX keywords instead of the standard Fortran ‘Complex(Kind(0d0))’ specification.

If the -dcfuns option has been used, additional intrinsic functions are available (see the documentation of the option for full details). These functions have all been redundant since Fortran 90.