Compatibility across standards

This information is provided for the benefit of users of earlier language standards, such as FORTRAN 77 , who are unfamiliar with more current language standards like Fortran 90, Fortran 95, Fortran 2003, or Fortran 2008, or with XL Fortran.

Except as noted here, the Fortran 90, Fortran 95, Fortran 2003, and Fortran 2008 standards are upward-compatible extensions to the preceding Fortran International Standard, ISO 1539-1:1980, informally referred to as FORTRAN 77. Any standard-conforming FORTRAN 77 program remains standard-conforming under the Fortran 90 standard, except as noted under item 4 below regarding intrinsic procedures. Any standard-conforming FORTRAN 77 program remains standard-conforming under the Fortran 95, Fortran 2003, or Fortran 2008 standard, as long as none of the deleted features are used in the program, except as noted under item 4 below regarding intrinsic procedures. The Fortran 90, Fortran 95, Fortran 2003, and Fortran 2008 standards restrict the behavior of some features that are processor-dependent in FORTRAN 77. Therefore, a standard-conforming FORTRAN 77 program that uses one of these processor-dependent features may have a different interpretation under the Fortran 90, Fortran 95, Fortran 2003, or Fortran 2008 standard, yet remain a standard-conforming program. The following FORTRAN 77 features have different interpretations in Fortran 90, Fortran 95, Fortran 2003, and Fortran 2008:
  1. 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, Fortran 95, Fortran 2003, and Fortran 2008 do not permit this processor-dependent option.

    Previous releases of XL Fortran have been consistent with the Fortran 90 and Fortran 95 behavior.

  2. 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. The Fortran 90, Fortan 95, Fortran 2003, and Fortran 2008 standards specify that this named variable has the SAVE attribute.

    Previous releases of XL Fortran have been consistent with the Fortran 90 and Fortran 95 behavior.

  3. 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. The Fortran 90, Fortran 95, Fortran 2003, and Fortran 2008 standards specify that the input record is logically padded with blanks if there are not enough characters in the record, unless the PAD='NO' specifier is indicated in an appropriate OPEN statement.

    With XL Fortran, the input record is not padded with blanks if the noblankpad suboption of the -qxlf77 compiler option is specified.

  4. The Fortran 90, Fortan 95, Fortran 2003, and Fortran 2008 standards have more intrinsic functions than FORTRAN 77, in addition to a few intrinsic subroutines. Therefore, a standard-conforming FORTRAN 77 program may have a different interpretation under Fortran 90, Fortran 95, Fortran 2003, or Fortran 2008 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.

    With XL Fortran, the -qextern compiler option also treats specified names as if they appear in an EXTERNAL statement.

  5. In Fortran 95, Fortran 2003, and Fortran 2008, for some edit descriptors, a value of 0 for a list item in a formatted output statement will be formatted differently. In addition, the Fortran 95 standard, unlike the FORTRAN 77 standard, specifies how rounding of values will affect the output field form. Therefore, for certain combinations of values and edit descriptors, FORTRAN 77 processors may produce a different output form than Fortran 95 processors.
  6. Fortran 95, Fortran 2003, and Fortran 2008 allow a processor to distinguish between a positive and a negative real zero, whereas Fortran 90 did not. Fortran 95 changes the behavior of the SIGN intrinsic function when the second argument is negative real zero.
  7. To distinguish between the Fortran 95 and Fortran 2003 interpretations of signed zeros in the ATAN2(Y,X), LOG(X) and SQRT(X) intrinsics, the -qxlf2003=signdzerointr suboption must be used in conjunction with the -qxlf90=signedzero option. For the xlf95 invocation only -qxlf2003=signdzerointr needs to be specified since -qxlf90=signedzero is on by default. For xlf2003 none of the options need to be specified since both are on by default. For the xlf90, f77 and xlf invocations, both options must be specified in order to have Fortran 2003 standard behaviour.


Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us