Print

Print


Russell, Richard writes:

 > I am curious as to why you included conversion of case to lower in
 > statement lines. I would think that use of case would be a matter
 > of personal style.

Indeed.  But so was almost everything else on the list.  As Ian
commented, it tends to be hard to guess what people actually mean when
they ask about "converting from f77 to f90".  I tend to categorize the
meanings as

1. They actually have no idea what is involved and didn't know that
   valid f77 code is already valid f90 code.

2. Their code isn't actually valid portable f77 code either, and the
   real question is how do they port the nonstandard features to a
   compiler that doesn't support them.  The user might or might not
   be aware that the code in question is nonstandard.

3. Style changes.

4. Various confusions, such as questions about how to invoke compilers
   or how to acquire a compiler (or even being unaware that one would
   need a compiler).

Of course you get various combinations, such as people who have code
that would at least approximately work, but they are mislead because
they didn't understand how to invoke the compiler (a common case being
how to tell the compiler about fixed source form.)

An awful lot of very different things fall in the category of style
changes.  In addition to the ones Ian listed, it at least used to
be pretty common for people to mean turning DO loops into array
expressions.

Sometimes the people asking the questions don't actually understand
what is and is not different between f77 and f90.  Other times, it is
frustrating having to deal first with matters of English communication
bewfore being able to get to the Fortran part.

> In my own code, I prefer to keep most executable code in upper case,
> with comments in normal text style (mostly lower).

I find stuff in all caps harder to read, whether it be English or
Fortran, but yes, it is a question of style.  I don't recall people
any particular cases of people meaning case conversion when they
asked about f77 to f90, but it isn't fundamentally much different
from asking about source form conversion, which is definitely what
some people have meant by the question.

By the way, neither f90 nor f95 mandate that compilers accept lower
case (even in comments).  They just acknowledge the possibility and
specify how it will be handled if the processor does support it.  It
just so happens that all f90/f95 compilers that I know of support both
cases, and I don't really expect this to change.  I'm not sure that I
even know of any "current" f77 compilers that don't also support lower
case, though there have certainly been plenty such in the past.

The draft f2003 standard finally mandates that compilers support both
upper and lower case.  As far as I'm aware, this is just a
formalization of the existing facts of life.  But one could
theoretically argue that f90/f95 code that relies on mixed case isn't
guaranteed by the standard to be portable.  In practice, I don't let
this influence me; the odds of it becoming a real problem seem too
low.  I choose case based on my style preferences instead of
portability concerns.

--
Richard Maine                |  Good judgment comes from experience;
[log in to unmask]       |  experience comes from bad judgment.
                             |        -- Mark Twain