Roland Schilling wrote:
>
> On Thu, 9 Mar 2000, I posted the following problem:
>
> > I have the following problem: I want to set-up a large PARAMETER
> > array of derived type, and I need a separate line for each element.
> > The problem now is that Fortran 90/95 only allows 39 continuation
> > lines, but I need something like 120. Any ideas how to solve this?
>
> I got two replies, by Dan Nagle and by Thorsten Ohl, both boiling
> down essentially to the same procedure: splitting up the array to
> be constructed into several smaller (<= 40 elements) subarrays and
> then concatinate them into one large array. I like this idea, but
> doesn't it mean to store the data twice in memory, once as the
> subarrays and once as the final array?
Hard to say, it's a quality of implementation issue. Parameters
don't have to have any memory allocated. They are just named
constants and the compiler can use them as it sees fit. An
implementation could notice that one parameter is only used in
another and not allocate any run-time memory for the first
constant. Does it matter? Computers now have tens of megabytes of
memory and constants take bytes. You could probably save more
memory by eliminating useless error checking (grin).
> If this is true, and if
> there is no other solution avoiding this, I would consider this
> as a severe weakness of the present F90/95 standard. Is this
> going to change with F2K?
F2K allows statements to have 100 lines, up from the current 40.
There are some special cases (common, namelist, and soon enums)
that allow several statements to be concatenated. There's no
obvious (to me anyhow) syntax to allow parameter statements to
be extended beyond the 100 line limit.
Dick Hendrickson
>
> Thanks for the replies,
> Roland
>
> +----------------------------------------------------------------------+
> | Roland Schilling Home-Office: +49(89)32929-670 |
> | Max-Planck-Institut fuer Quantenoptik Phone: +49(89)32905-265 |
> | Hans-Kopfermann-Str. 1 Fax: +49(89)32905-200 |
> | D-85748 Garching E-mail: [log in to unmask] |
> | Germany http://www.geo600.uni-hannover.de |
> +----------------------------------------------------------------------+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|