For Programmers: Free Programming Magazines  


Home > Archive > Fortran > October 2006 > Re: Why these original FORTRAN quirks?; Now : Programming practices









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Why these original FORTRAN quirks?; Now : Programming practices
Richard E Maine

2006-10-30, 7:15 pm

Rostyslaw J. Lewyckyj <urjlew@bellsouth.net> wrote:

> It has been my definite understanding that each later Fortran standard
> was supposed to grandfather in the earlier version as a strict subset,
> until most lately. It is only with the latest versions that features
> were depreciated and supposedly actively removed.


That's true of f90/f95/f2003. It is most definitely *NOT* true of f77.
If you understood that, your understanding was flawed. (Not that this is
rare). I'm sometimes amused by the people who bemoan how horrible it was
that f90 labelled some things as obsolescent, and f95 deleted a small
handful, while those same people claim that f77 was 100% compatible with
f66. I've seen quite a few such people. Apparently they never actually
read the f77 standard. F77 was orders of magnitude more draconian in its
deletions. Several significant features were just deleted with none of
this transitional "warning period". See below.

> Although I admit that 0 trip vs at least 1 trip DO
> loop behaviour might be raised as another such case.


Nope. This ought to be on the list of frequently erroneous statements
about Fortran. Lots of people cite that as "the one" incompatibility
between f66 and f77. There are even compiler switches labelled as
providing f66 compatibility, which do nothing but change this DO loop
trip count behavior. As noted, this is not actually an incompatibility.

The f77 standard does list 24 ways in which f77 was incompatible with
f66. That's Appendix A, section A2. Admitedly, a lot of them are sort of
picky, but a few are not at all picky. The do loop trip count is not one
of those 24 ways. The thing about input into an H edit descriptor is; it
is item 14 in the list.

Item 3 is by far the biggest - so big that the f77 standard has a
separate Appendix on it. That's the deletion of Hollerith data in favor
of character data type. (Not the same thing as the Hollerith edit
descriptor, by the way). The Appendix on that is nor a normative part of
the f77 standard, though. It is just a suggestion for compilers that
choose to implement Hollerith as an f66 compatibility feature (which was
all or almost all f77 compilers, and even most later ones, although
there have been some compilers that dropped it).

Item 7 is the (in)famous extended range of DO.

I won't copy the whole list. See the standard.

--
Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain| experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com