Intel® Fortran Compiler 18.0 Developer Guide and Reference
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 2003 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
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
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.