From: rfengineer55 on
To Ken and others,

Thanks for responding to my recent posts. I'm new to this list, and am
running into a lot of frustration with these FCC Fortran source code
listings.

If you know of an FTP drop box someplace, I would be happy to give
you, and others here in the group, access to the source code that I'm
tryin g to compile. The source is not proprietary at all, If you look
at my copies, you will have versions with edits that I've done so
far.

I really don't know the exact place in my program that's generating
the error. It's one of those situations where an earlier bug in the
source code later on drives the compiler nuts resulting in dozens of
error messages. Examples of this are Parameter statemens where the
arguments are missing Parentheses; this will cause the compiler to
complain about many oterwise perfectly fine fortran constructs. Other
problems are when Data statements are in the middle, rather than at
the end of variable declarations. And on goes the list.

I'm just as interested in learning the differences in dialects as I am
in getting s sccessful compile, so I hesitate to simply click a radio
button that puts my compiler into the VMS mode; I won't really learn
anything by doing that. The FCC Fortran is known good, so there is no
debugging to do in the traditional sense. Ultimately, I want to be
able to recognize these dialect problems between VMS and Fortran 77 at
first glance at the source code. I might not get there, but that'sw
the goal.

Thank you all for your help, encouragement so far.

Jeff
RFENGIBEER55
From: Ken Fairfield on
On Jun 9, 9:05 am, rfengineer55 <rfenginee...(a)aol.com> wrote:
> To Ken and others,
>
> Thanks for responding to my recent posts. I'm new to this list, and am
> running into a lot of frustration with these FCC Fortran source code
> listings.

[...]

> I really don't know the exact place in my program that's generating
> the error. It's one of those situations where an earlier bug in the
> source code later on drives the compiler nuts resulting in dozens of
> error messages. Examples of this are Parameter statemens where the
> arguments are missing Parentheses; this will cause the compiler to
> complain about many oterwise perfectly fine fortran constructs. Other
> problems are when Data statements are in the middle, rather than at
> the end of variable declarations. And on goes the list.

Just as an aside, compilers are only just so smart: it is common
for one error to cause the compiler to get lost in subsequent
source code and generate otherwise bogus errors. The usual approach
is to correct the first error (or errors), then recompile, and
iterate until you can compile error-free.

The parentheses-less PARAMETER statement has been much discussed
here in the past. Just correct *all* of them to use parentheses
and recompile.

DATA statements mixed with other declarations shouldn't be a
problem. You may be getting errors on the data statements
simply because of previous PARAMETER errors, or similar.

> I'm just as interested in learning the differences in dialects as I am
> in getting s sccessful compile, so I hesitate to simply click a radio
> button that puts my compiler into the VMS  mode; I won't really learn
> anything by doing that.

Fair enough and a good approach. Stay away from extensions
(what you are referring to as dialects) and make the source
code standard Fortran. But you will need to have a Fortran
standard reference handy in order to recognize what to change
and how to change it to be standard conforming. Depending on
your programming background, there are a number of good references
available. My preference is Metcalf, Reid & Cohen...

The FCC Fortran is known good, so there is no
> debugging to do in the traditional sense.

It may be "known good" in the sense of giving the results you need
when used with a given Fortran compiler, but not so good in the sense
of being standard Fortran and (therefore) portable to other compilers.

Ultimately, I want to be
> able to recognize these dialect problems between VMS and Fortran 77 at
> first glance at the source code. I might not get there, but that'sw
> the goal.

Please also note that the current Fortran standard is Fortran 2003
(F2003), that *most* Fortran compilers these days conform to F90/F95
at least, often with many features from F2003 included, and that
(standard-conforming) Fortran 77 is a proper subset of F90/F95/F2003
(with some very minor caveats). Gfortran, for example, is fully F95
compliant, and includes *most* of F2003. (My recollection is
that MS Fortran didn't even conform to the F77 standard...)

That said, the most significant difference to those new to Fortran
between F77 and earlier, and F90 and later, is the *source form*.
F77 and earlier required statements to be contained within fixed
column ranges, etc., in the source file. This is called "fixed
source form". F90 and later allow "free form source" wherein
statements can begin in any column. There are other differences
(whether blanks are significant or not; how long statements are
continued accross lines, etc.) but the column restrictions are
the big one.

You cannot mix fixed-form and free-form in the same source file.
Also, you typically need to let the compiler know whether the
source is fixed-form or free-form. The way you do that depends
on the specific compiler you're using.

Good luck, Ken

From: glen herrmannsfeldt on
rfengineer55 <rfengineer55(a)aol.com> wrote:

> Thanks for responding to my recent posts. I'm new to this list, and am
> running into a lot of frustration with these FCC Fortran source code
> listings.

(snip)

> I really don't know the exact place in my program that's generating
> the error. It's one of those situations where an earlier bug in the
> source code later on drives the compiler nuts resulting in dozens of
> error messages. Examples of this are Parameter statemens where the
> arguments are missing Parentheses;

I believe that PARAMETER originated from DEC, but with a syntax
different from that added to the standard.

> this will cause the compiler to
> complain about many oterwise perfectly fine fortran constructs. Other
> problems are when Data statements are in the middle, rather than at
> the end of variable declarations. And on goes the list.

You mean like:

integer x/1/,y/2/,z/3/

That is an IBM extension that, I believe, DEC adopted.

OR do you mean actual DATA statements?

> I'm just as interested in learning the differences in dialects as I am
> in getting s sccessful compile, so I hesitate to simply click a radio
> button that puts my compiler into the VMS mode; I won't really learn
> anything by doing that. The FCC Fortran is known good, so there is no
> debugging to do in the traditional sense. Ultimately, I want to be
> able to recognize these dialect problems between VMS and Fortran 77 at
> first glance at the source code. I might not get there, but that'sw
> the goal.

You could read a Fortran 77 reference. If you have the DEC manual,
look carefully for the different ink color.

Many of us have been doing this long enough that, as the saying goes,
we know them when we see them, but have a hard time explaining it
otherwise.

-- glen
From: Tim Prince on
On 6/9/2010 11:08 AM, glen herrmannsfeldt wrote:
> Examples of this are Parameter statemens where the
>> arguments are missing Parentheses;
>
> I believe that PARAMETER originated from DEC, but with a syntax
> different from that added to the standard.
>

ifort supports PARAMETER without parens much the way it was in VAX
fortran. It's more error prone than the standard way (named constants
inherit data type from the expression, but perhaps not reliably). If
you start modifying, you should consider making changes fit the
standard, as compilers which support both standard and pre-standard
forms generally permit them to coexist.

--
Tim Prince
From: Steve Lionel on
On 6/9/2010 2:08 PM, glen herrmannsfeldt wrote:

> I believe that PARAMETER originated from DEC, but with a syntax
> different from that added to the standard.

Sort of. DEC implemented what was in a late draft of the FORTRAN 77
standard, but this syntax got changed before the final standard was
published, so we supported both versions (and still do.)

--
Steve Lionel
Developer Products Division
Intel Corporation
Nashua, NH

For email address, replace "invalid" with "com"

User communities for Intel Software Development Products
http://software.intel.com/en-us/forums/
Intel Software Development Products Support
http://software.intel.com/sites/support/
My Fortran blog
http://www.intel.com/software/drfortran