At 02:50 PM 10/30/97 +0000, Swietanowski Artur wrote:
>Lawrie Schonfelder wrote:
>> <SNIP>
>> An extremely good question! The argument was something like this.
>> Initialisation is done at compile time. Some vendors are loath to have
>> the intrinsic library available at compile time, at least the floating
>> point part of it. Therefore, we must ban floating point intrinsics
>> from initialisation expressions.
[snip]
>
>Frankly speaking, both those arguments are easily made irrelevant.
>Any run time overhead caused by initialization of static (esp.
>constant) data has to be considered trivial when compared with
>the task that the program performs. Therefore I wouldn't mind
>if the actual implementation of such initializations by
>a processor would just generate run time code to calculate
>the constants before it runs the program
[snip]
The problem is that some constants need to be available at compile time.
For example:
integer, parameter :: I = sqrt(64.0)
real (kind=I), dimension(I) :: a
equivalence ( a(I/2), b)
There is no reasonable compilation scheme that allows the computation
of "I" to be delayed until run-time or allows it to be different on
the compiling machine from what it would be on the executing machine.
If we allow a run-time evaluation model then we'd have to come up
with a set of rules that prohibit using some parameters in some
places, depending on how the parameters were originally defined.
The regularity police would be all over J3 if they tried that!
The only solution is to bite the bullet and allow all intrinsics in
initialization expressions and that requires the run-time library to
be available for the evaluation.
There is a current work item to
"Permit all elemental intrinsic functions in an initialization expression
except the math functions ABS(z), ACOS, ASIN, ATAN, ATAN2, CABS, COS,
COSH, EXP, LOG, LOG10, SIN, SINH, SQRT, TAN, and TANH. " in F2000 and this
will be discussed/voted on at the November J3 meeting.
As an aside, the J3 web page at
http://www.ionet.net/~jwagener/j3/
gives status on most of the F2000 work.
Dick Hendrickson
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|