The Queen's University of Belfast
Parallel Computer Centre

[Next] [Previous] [Top]

8 Redundant Features


The method of removing redundant features of Fortran, as adopted by the standards committee, was described in "Language Evolution". The obsolescent list includes features which might be removed in the next revision and should not be used in new or revised programs. Additionally, Fortran 90 includes other redundant features which are safer to use then those in the obsolescent list, but will probably be included in the obsolescent list in the next version, and therefore are recommended not to be used in new or revised programs.

The redundant features of Fortran 90 fall into five groups: Source form, Data, Control, Procedures and Input/Output.

8.1 Source Form

The fixed source form based on the layout of a punched card has now been replaced by the free source form and this should be used for all new programs. It is possible to make simple modifications to fixed source form in order to produce code which is both legal fixed and free source code.

The use of modules is recommended rather than the INCLUDE line. The INCLUDE line contained a character literal constant indicating what text should be inserted at a specified point or where text to be inserted should be obtained from.

8.2 Data

Fortran 77 provided two forms of real variables and constants, REAL and DOUBLE PRECISION. These have been superseded by the concept of parameterised data types which provide numerical portability, and hence DOUBLE PRECISION should no longer be used in new programs.

The dangerous concept of implicit typing and the IMPLICIT statement should not be used. The IMPLICIT NONE statement should be included at the beginning of every program unit to ensure explicit declaration of all variables.

The new form of declaring variables with a double colon (::) between the type and the list of variables is recommended. Additionally, the use of attribute forms of PARAMETER, DIMENSION, etc., in the type declaration, rather than the statement forms is recommended.

The DATA statement is no longer generally needed as variables may now be initialised in a type statement. Exceptions to this are octal, hexadecimal and array section initialisations.

The only form of adjustable size array in Fortran 77 was the assumed-size array. In Fortran 90 this has been superseded by the assumed-shape array, and thus the assumed-size array should no longer be used in new programs.

COMMON blocks and BLOCK DATA should no longer be used as the use of modules obviates the need for them. Similarly the EQUIVALENCE statement has become unnecessary due to the introduction of modules, dynamic storage allocation, pointers, and the intrinsic function TRANSFER.

It is recommended that the SEQUENCE attribute is never used.

8.3 Control

The obsolescent features listed in Fortran 90 are:

These should never be used in new or revised programs. Except for alternate RETURN and PAUSE, these can be replaced by the IF statement, DO and CASE control constructs, and EXIT and CYCLE statements

With the introduction of modern control constructs and the character string format specifications, the need for labels is redundant.

The DO construct and EXIT and CYCLE statements replace the use of the CONTINUE statement to end a DO loop.

GO TO and computed GO TO statements should be avoided, using IF, DO and CASE constructs, and EXIT and CYCLE statements instead.

The DO WHILE statement was introduced in Fortran 90. This functionality can equally be provided using the DO loop construct and EXIT statement, and this form is recommended.

8.4 Procedures

Intrinsic functions using specific names for different data types have been superseded by generic versions. Note that the specific names are required when an intrinsic function is being used as an actual argument.

The ENTRY statement allows a procedure to have more than one entry point. The introduction of modules, where each entry point becomes a module procedure, has made the ENTRY statement unnecessary.

The statement function provided a means of defining and using a one-line function. This has been superseded by the concept of internal procedures.

The use of module procedures and internal procedures means that it is not necessary to use external procedures. Thus, external procedures and the EXTERNAL statement are effectively redundant.

8.5 Input/Output

The obsolescent features listed in Fortran 90 are:

Assigned format specifiers should be replaced by character string format specifications.

The END, EOR and ERR specifiers are used when exceptional conditions occur in input and output. It is recommended that the IOSTAT specifier is used instead of these.

Namelist input/output is a poorly designed feature and it is recommended that namelist should not be used unless absolutely necessary.

Finally, it is recommended that six edit descriptors should not be used, namely, D, BN, BZ, P, G and X.

The D edit descriptor has been superseded by the E edit descriptor, and the BN and BZ edit descriptors have both been replaced by the BLANK specifier.

The P edit descriptor allows numeric data to be scaled on either input or output, however this can lead to unnecessary confusion and is therefore best avoided.

The G edit descriptor is a generalized edit descriptor which can be used to input or output values of any intrinsic type. However, the use of I, E, EN, F, L or A edit descriptors is preferable as these provide some check that the data types are correct.

The X edit descriptor has the same effect as the TR edit descriptor, and the latter is recommended.


[Next] [Previous] [Top]
All documents are the responsibility of, and copyright, © their authors and do not represent the views of The Parallel Computer Centre, nor of The Queen's University of Belfast.
Maintained by Alan Rea, email A.Rea@qub.ac.uk
Generated with CERN WebMaker