Re: Declaration order



David Flower wrote:
On May 9, 12:15�pm, ma...@xxxxxxxxxxxxxxxx wrote:
The following part of Fortran code compiles with Intel v10.x and g95
but not with Compaq v6.6:

real*8 �myVal(myn)
integer �myn
common /myCommon/ myn

The declaration of the array comes before the declaration of its
dimension which comes through a common block. Any takes?

This is illegal code unless you also have a PARAMETER statement
supplying the value of myn

Dave Flower
No, that's not it. "myn" is in common. It would help if you'd
give the error message. But, I believe it's an ordering
problem. You're using "myn" before you've completely
declared it. Compaq v6.6 is a relatively old compiler and
the rules for how things must be ordered in the declarations
have changed over the years. I don't remember for sure what
is what here, and a quick look at the standard didn't help.
It will surely work if you move the real statement to be after the
common statement.

You might also try turning on standards conformance for both
g95 and v10.x and see if they are letting you get away with
something.

*** Hendrickson
.