Re: Help requested troubleshooting code




"Richard Maine" <nospam@xxxxxxxxxxxxx> wrote in message
news:1icesed.1dsmzj41j8g3e6N%nospam@xxxxxxxxxxxxxxxx
Zachary Davis <zdavis@xxxxxxx> wrote:

Could you explain or point to some reference that might explain the
difference between fixed source form and this other form you prefer?
It is a notion that is unfamiliar to me as obviously I'm somewhat of a
programming novice. I'd appreciate it.

Any Fortran text (provided it isn't an old F77 one) should cover the
details of this. But the basics are pretty simple. Presumably you know
about fixed source form, as that's what this is. The big differences

Free source form has no special columns. Fixed source form has special
rules for column 1 (comment characters), 1-5 (statement numbers), 6
(continuation), and anything past 72 (often ignored, but implementations
vary). The simillar thing in free source form is that you can't go past
column 132, which is like the role of column 72 in fixed source.

So what do you do instead of the special columns of fixed source form?

For comments, use the !, which I see your code does anyway. That one is
valid in both forms. There is no special meaning for a C or * in col 1.

For statement numbers, no column restrictions are needed. The compiler
can recognize them syntactically (because there is no statement that can
start with a digit).

For continuation, well the exact rules for oddball cases have some
complications, but the basic rule is to put an & at the end of the line
to be continued sort of like

x = some_long_expression + &
some_more

And then the one last rule, which is the difference that came up here...

Blanks are significant in free source form. You can't just add them
randomly in the middle of identifiers. The precise rules on blanks take
longer to state, but the simple version is that you can put them between
"things", but you can't put them in the middle of a single "thing".
Fixed source form, in contrast, completely ignore blanks that are not
part of character literals (or comparable things like Hollerith).

Thus, in fixed source form, your "prantl meyer" was the same thing as
just prantlmeyer with the blank ignored. In free source form, you can't
have a blank there. Individual styles vary on what to do with multi-word
identifiers like that. People have occasionally discussed such style
preferences here. I personally favor using underscores as in
prandtl_meyer. Others like to use capitilaization as in prandtlMeyer or
PrandtlMyer.

Most compilers will assume a source form based on the file name. For
example, a common convention is that a file name ending in .f is fixed
source form, while one ending in .f90 is free source form. (The f90 bit
is unfortunately misleading in that both forms are valid Fortran 90.
Thus .f90 doesn't really mean Fortran 90; it is just a funny way of
spelling free source form.)
Is fixed-form valid fortran 2003?


--
Gerry Ford

"Er hat sich georgiert." Der Spiegel, 2008, sich auf Chimpy Eins komma null
beziehend.


.



Relevant Pages

  • Re: Help requested troubleshooting code
    ... I suppose the reason why my program identifier contained a space as in prandtl meyer was because I had originally used prandtl_meyer and my compiler gfortran complained about the underscore, and I figured that it might have been an invalid character to use in the program statement. ... difference between fixed source form and this other form you prefer? ... about fixed source form, ... The simillar thing in free source form is that you can't go past ...
    (comp.lang.fortran)
  • Re: Converting fixed-to-free format
    ... *Crap* past column 72 had also long gone. ... Lines longer than 72 in fixed source form are common. ... You are promoting a form that is error prone. ...
    (comp.lang.fortran)
  • Re: Help requested troubleshooting code
    ... difference between fixed source form and this other form you prefer? ... about fixed source form, ... The simillar thing in free source form is that you can't go past ... So what do you do instead of the special columns of fixed source form? ...
    (comp.lang.fortran)
  • Re: Converting fixed-to-free format
    ... CONVERTING FIXED-TO-FREE FORMAT. ... "Anyone who wants to take the advantages of free source form ... Fixed source form is inherently an error-prone form ...
    (comp.lang.fortran)
  • Re: Format question
    ... If anyone ever decides to not support ... there are source form converters. ... the feature on the obsolescent list. ... fixed source form anyway, so we don't need extra push for that. ...
    (comp.lang.fortran)