This chapter discusses issues that affect the behavior of Fortran 77 and Fortran 90 code when processed by LF95.
Different Interpretation Under Fortran 95
Standard Fortran 95 is a superset of standard Fortran 90 and a standard-conforming Fortran 90 program will compile properly under Fortran 95. There are, however, two situations in which the program's interpretation may differ.
- The behavior of the SIGN intrinsic function is different if the second argument is negative real zero.
- Fortran 95 has more intrinsic procedures than Fortran 90. Therefore, a standard-conforming Fortran 77 or Fortran 90 program may have a different interpretation under Fortran 95 if it invokes a procedure having the same name as one of the new standard intrinsic procedures, unless that procedure is specified in an EXTERNAL statement.
Different Interpretation Under Fortran 90
Standard Fortran 90 is a superset of standard Fortran 77 and a standard-conforming Fortran 77 program will compile properly under Fortran 90. There are, however, some situations in which the program's interpretation may differ.
- Fortran 77 permitted a processor to supply more precision derived from a REAL constant than can be contained in a REAL datum when the constant is used to initialize a DOUBLE PRECISION data object in a DATA statement. Fortran 90 does not permit this option.
- If a named variable that is not in a common block is initialized in a DATA statement and does not have the SAVE attribute specified, Fortran 77 left its SAVE attribute processor-dependent. Fortran 90 specifies that this named variable has the SAVE attribute.
- Fortran 77 required that the number of characters required by the input list must be less than or equal to the number of characters in the record during formatted input. Fortran 90 specifies that the input record is logically padded with blanks if there are not enough characters in the record, unless the PAD="NO" option is specified in an appropriate OPEN statement.
- Fortran 90 has more intrinsic procedures than Fortran 77. Therefore, a standard-conforming Fortran 77 program may have a different interpretation under Fortran 90 if it invokes a procedure having the same name as one of the new standard intrinsic procedures, unless that procedure is specified in an EXTERNAL statement as recommended for non-intrinsic functions in the appendix to the Fortran 77 standard.
Obsolescent Features
The following features are obsolescent or deleted from the Fortran 95 standard. While these features are still supported in LF95, their use in new code is not recommended:
- Arithmetic IF
- REAL and double-precision DO control variables and DO loop control expressions
- shared DO termination and termination on a statement other than END DO or CONTINUE
- Branching to an END IF statement from outside its IF block
- Alternate return
- PAUSE statement
- ASSIGN statement and assigned GOTO statement
- Assigned format specifier
- nH (Hollerith) edit descriptor
- Computed GOTO statement
- Statement functions
- DATA statements amongst executable statements
- Assumed-length CHARACTER functions
- Fixed-source form
- CHARACTER* form of CHARACTER declaration