Obsolescent features
As the Fortran language evolves, it is only natural that the functionality of some older features are better handled by newer features geared toward today's programming needs. At the same time, the considerable investment in legacy Fortran code suggests that it would be insensitive to customer needs to decommit any Fortran 90 or FORTRAN 77 features at this time. For this reason, XL Fortran is fully upward compatible with the Fortran 90 and FORTRAN 77 standards. Fortran 95 has removed features that were part of both the Fortran 90 and FORTRAN 77 language standards. However, functionality has not been removed from Fortran 95 as efficient alternatives to the features deleted do exist.
Fortran 95 defines two categories of outmoded features: deleted features and obsolescent features. Deleted features are Fortran 90 or FORTRAN 77 features that are considered to be largely unused and so are not supported in Fortran 95.
Obsolescent features are FORTRAN 77 features that are still frequently used today but whose use can be better delivered by newer features and methods. Although obsolescent features are, by definition, supported in the Fortran 95 standard, some of them may be marked as deleted in the next Fortran standard. Although a processor may still support deleted features as extensions to the language, you may want to take steps now to modify your existing code to use better methods.
- Arithmetic IF
Recommended method: Use the logical IF statement, IF construct, or CASE construct.
- DO control variables and expressions
of type real
Recommended method: Use variables and expression of type integer.
- PAUSE statement
Recommended method: Use the READ statement.
- Alternate return specifiers Recommended method: Evaluate a return code in a CASE construct or a computed GO TO statement on return from the procedure.
! FORTRAN 77 CALL SUB(A,B,C,*10,*20,*30) ! Fortran 90 CALL SUB(A,B,C,RET_CODE) SELECT CASE (RET_CODE) CASE (1) ⋮ CASE (2) ⋮ CASE (3) ⋮ END SELECT
- ASSIGN and assigned GO TO statements
Recommended method: Use internal procedures.
- Branching to an END IF statement from
outside the IF block
Recommended method: Branch to the statement that follows the END IF statement.
- Shared loop termination and termination on a statement other than END
DO or CONTINUE
Recommended method: Use an END DO or CONTINUE statement to terminate each loop.
- H edit descriptor
Recommended method: Use the character constant edit descriptor.
- Arithmetic IF
Recommended method: Use the logical IF statement, IF construct, or CASE construct.
- Alternate return specifiers Recommended method: Evaluate a return code in a CASE construct or a computed GO TO statement on return from the procedure.
! FORTRAN 77 CALL SUB(A,B,C,*10,*20,*30) ! Fortran 90 CALL SUB(A,B,C,RET_CODE) SELECT CASE (RET_CODE) CASE (1) ⋮ CASE (2) ⋮ CASE (3) ⋮ END SELECT
- Shared loop termination and termination on a statement other than END
DO or CONTINUE
Recommended method: Use an END DO or CONTINUE statement to terminate each loop.
- Statement functions
- DATA statements in executables
- Assumed length character functions
- Fixed source form
- CHARACTER* form of declaration