Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 6/24/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Deleted Language Features in the Fortran Standard

Some language features, considered redundant in older versions of the Fortran Standard, are not included in the current Fortran Standard. However, they are still fully supported by Intel® Fortran.

In the examples below, both forms are supported by Intel® Fortran, but the Fortran 2018 Standard only supports the second form:

  • ASSIGN and assigned GO TO statements

    The ASSIGN statement, when assigning a label for use with the assigned GO TO statement, can be replaced by assigning the integer value of the label to an integer variable; the assigned GO TO statement can then be replaced by an IF statement that tests the integer variable for various values and then goes to the label that represents that value. For example, replace:

    ASSIGN 10 TO J
    ...
    ASSIGN 20 TO J
    ...
    GO TO J

    with:

    J = 10
    ...
    J = 20
    ...
    IF (J .EQ. 10) THEN
        GO TO 10
    ELSE IF (J .EQ. 20) THEN
        GO TO 20
    END IF
  • Arithmetic IF statement

    The arithmetic IF statement can be replace by an IF-THEN-ELSE construct or a CASE SELECT construct.

    For example, replace:

    IF (expr) 10, 20, 30

    with:

    IF (expr .LT. 0) THEN
      GO TO 10
    ELSE IF (expr .EQ. 0) THEN
      GO TO 20
    ELSE
      GO TO 30
    ENDIF
  • Assigned FORMAT specifier

    The assigned FORMAT specifier sets an integer variable to the label of a FORMAT statement and then the integer variable is used in an I/O statement instead of the FORMAT label. You can replace the integer variable with a character variable whose value is the contents of the FORMAT statement, and then use the character variable in the I/O statement as the format. For example, replace:

    ASSIGN 1000 TO IFMT
    ...
    WRITE (6, IFMT) X, Y
    ...
    1000     FORMAT (2E10.2)

    with:

    CHARACTER(20) :: IFMT = "(2E10.2)"
    ...
    WRITE (6, IFMT) X, Y
  • The non-block form of a DO statement

    The non-block form of a DO loop contains a statement label in the DO statement identifying the terminal statement of the DO. The terminal statement may be an executable statement and may be shared with another non-block DO statement. Use an END DO statement as the terminal statement for each DO loop.

    You should not use statement labels on the terminating statement and in the DO statement, because labeled DO loops are now obsolescent.

    For example, replace the following:

       DO 10 I = 1, N
         DO 10 J = 1, M
    10 A(I, J) = F_OF (I, J)
    

    with this:

    DO I = 1, N
      DO J = 1, M
        A(I, J) = F_OF (I, J)
      END DO
    END DO
    
  • Branching to an END IF statement from outside its IF block

    The END IF statement can no longer be a target of a GO TO statement that is outside the IF block that ends with that END IF statement. Use a CONTINUE statement after the END IF as the target of the GO TO statement. For example, replace:

    IF ...
        GO TO 100
    ELSE IF ...
    100  END IF

    with:

    IF ...
         GO TO 100
    ELSE IF ...
    END IF
    100  CONTINUE
  • H edit descriptor

    Replace the H edit descriptor of the form nHcharacters with "characters". Remember to double any quotes or apostrophes in the string characters.

  • PAUSE statement

    The PAUSE statement displays a character string on the standard output device and then suspends program execution until any character is typed on the standard input device. You can replace the PAUSE statement with a WRITE statement followed by a READ statement. For example, replace:

    PAUSE " don't forget to buy milk"

    with:

    WRITE (6, *) " don't forget to buy milk"
    READ (5, *)    ! no io-list is necessary, the input is ignored
  • Real and double precision DO control variables and DO loop control expressions

    REAL variables of any KIND can no longer be used as DO loop control variables and expressions. You can replace such DO loops with the appropriate DO WHILE loop that explicitly initializes, increments, and tests the REAL variable. For example, replace:

    DO X = 0.1, 0.5, 0.01
       ...
    END DO

    with:

    X = 0.1
    DO WHILE (X .LE. 0.5)
       ...
       X = X + 0.01
    END DO
  • Vertical format control

    Formatted output to certain printing output units used to result in the first character of each record being interpreted as controlling vertical spacing on the unit. There is no standard way to detect whether output to such a unit should result in such vertical format control and no way to specify that it should be applied. The effect can be achieved by post-processing a formatted file after it is created to interpret the first character as some form of control character. This is left to the user.

Intel Fortran flags these features if you specify compiler option stand.