John Venier writes:
> In translating some code we came across a presumably unusual
> situation....
> DOUBLE PRECISION, PARAMETER :: a(1024) = (/6.33795775455379D0, [...]
[and bazillions of continuation lines needed]
Not too incredibly unusual. I've seen the same thing asked several
times before.
Sounds like you've found the "usual" solutions. Either hope that the
compiler will support enough continuation lines as an extension, break
the array into a bunch of sub-arrays, which you then concatenate,
or make the array into a variable instead of a parameter. If you
make it a variable, you can then either use DATA statements or read
it from a file. I think the option of reading from a file was the
only one you didn't cover.
Do note that for an array of that size, it is unlikely that the
compiler is going to be particularly "smart" about optimizing
a parameter array as opposed to a variable one. There may not
be much difference in practice. I'd tend to go with just making
it a variable, but I accept that the parameter option is also
viable, if, as you have noted, a bit "less than elegant" in the
hoops you have to jump through.
--
Richard Maine | Good judgment comes from experience;
[log in to unmask] | experience comes from bad judgment.
| -- Mark Twain
|