Steve Lionel, DVF Development Team

Dr. Fortran didn’t receive any appropriate questions for his column this time, so he’s going to take on a topic that is sure to raise a ruckus each time it is brought up in the comp.lang.fortran newsgroup: Obsolescent and Deleted Features.

Fortran (or FORTRAN) has had a long history of general upward compatibility – Fortran 77 included almost all of Fortran 66, and Fortran 90 included all of Fortran 77. But Fortran 90 formally introduced the concept of “language
evolution” with the goal of removing from the language certain features that had more modern counterparts in the new language.

The Fortran 90 standard added two lists of features, “Deleted” and “Obsolescent”. The “Deleted” list, features no longer in the language, was empty in Fortran 90. The “Obsolescent” list contained nine features of Fortran 77 which, to quote the standard, “are redundant and for which better methods are available in Fortran 77.” Furthermore, the F90 standard said:

If the use of these features has become insignificant in Fortran programs, it is recommended that future Fortran standards committees consider deleting them from the next revision.

It is recommended that the next Fortran standards committee consider for deletion only those language features that appear in the list of obsolescent features.

It is recommended that processors supporting the Fortran language continue to support these features as long as they continue to be widely used in Fortran programs.

Proponents of “cleaning up” the language argued that it would make compiler implementors’ jobs easier. The compiler vendors disagreed; most said that they would not remove support for any features since they knew that users continue to compile old programs. Furthermore, deleting a feature from the language means that there is no official description of how that feature, if still supported, interacts with other language features. (The Fortran 77 standard included an appendix describing how Hollerith constants, a FORTRAN IV feature not included in Fortran 77, should work if a compiler chose to support them.) For the record, DIGITAL will not remove support for any “deleted” language features from its Fortran compilers.

In Fortran 90, the list of “obsolescent” features was as follows:

  1. Arithmetic IF
  2. Real and double precision DO control variables and DO loop control expressions
  3. Shared DO termination and termination on a statement other than END DO or CONTINUE statement.
  4. Branching to an END IF statement from outside its IF block
  5. Alternate return
  6. PAUSE statement
  7. ASSIGN statement and assigned GO TO statements
  8. Assigned FORMAT specifiers
  9. cH edit descriptor

Descriptions of obsolescent features in the standard appeared in a small font and compilers were to provide the ability to issue diagnostics for the use of obsolete features.

Now we come to Fortran 95. Keep in mind that the Fortran 90 standard did not say that the next standard HAD to delete any of the previously-designated “obsolescent” features, but that’s exactly what the standards committee did. Six of the nine “obsolescent” features (numbers 2, 4, 6, 7, 8 and 9) above were “deleted”. Poof! Gone! And guess what – that meant that a valid Fortran 77 program was no longer a valid Fortran 95 program! But never fear: DVF (and indeed most vendors’ compilers) will continue to support the deleted features (with optional diagnostics informing you of the fact, of course.)

The Fortran 95 list of obsolescent features includes the remaining items of the above list from Fortran 90 (1, 3 and 5), as well as several new additions. Are you sitting down? Here’s the new list:

  1. Arithmetic IF
  2. Shared DO termination and termination on a statement other than END DO or CONTINUE
  3. Alternate return
  4. Computed GO TO statement (use CASE)
  5. Statement functions (use CONTAINed procedures)
  6. DATA statements amongst executable statements (betcha didn’t know they could go there!)
  7. Assumed length character functions (this means CHARACTER*(*) FUNCTIONs)
  8. Fixed form source (!!!!)
  9. CHARACTER* form of CHARACTER declaration (use CHARACTER([LEN=]))

Needless to say, the inclusion of fixed-form source on this list has raised a LOT of eyebrows… Assumed-length CHARACTER functions (and the CHARACTER* form of declaration) are deemed to be an “irregularity” in the language,
which they are, and there are alternatives available, but Dr. Fortran doesn’t see these disappearing from users’ code anytime soon.

So does this mean that some of these features will be deleted in the next standard, currently called “Fortran 2000”? [Fortran 2003 – ed.] At present, the answer is “no”. The standards committee has agreed to NOT move any features from the
“obsolescent” list to the “deleted” list for F2K, and furthermore, is not proposing any additions to the “obsolescent” list. So it would appear that, for now, anyway, the “concept of language evolution” excludes extinction, and that should make Fortran programmers around the world breathe easier.

(FromĀ Intel Developer Zone, copied with permission)

Write Your Comments

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Subscribe to Doctor Fortran

Subscribe to Doctor Fortran