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.
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)
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.
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.
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.
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.
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)). |
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).
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.
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.