Hello,
Yes, logical kinds are good clean fun ;-)
Peter Shenkin wrote:
<snip>
(re: logical kinds)
> How can one determine this?
I think RTFM is the only certain way.
> The only way I can think of to determine the list of LOGICAL KINDs
> available on a platform is to try to compile routines with a list of
> LOGIGICAL(KIND=n) statements, one by one, and go by which compilations
> succeed. Is there a better way?
If by "way" you mean "experiment", I think not.
> As far as determining the size of the LOGICAL KINDs one has found,
> the only way I can think of for doing this is to declare an array
> of them, pass the first and last elements to a C function, and
> subtract addresses. Is there a better way?
The heuristic (read: wild guess) that make_pm makes is to
assume that logicals and integers of the same kind value use
the same storage. If you want an all Fortran way, there's
the Method of Olagnon. (Which, perhaps someday, will be
part of the Portability Project... )
> Finally, I can think of no reason a Fortran compiler couldn't
> implement a LOGICAL KIND corresponding to a single bit of
> storage. Are there any that do this? If so, there should
> be provision for it in the namelist syntax as well.
The reason seems to be cost: a bit address is a new _class_ of
address for the compiler to know about. Anyway, type bit_logical
always seems to get shot down. It's been brought up over the
years. I believe it is impossible to do via the type mechanism
(and have something you can use = to assign to or from).
<snip sig>
So, yes, you have made some repeatable observations.
BTW, how would you specify a SELECT_LOG_KIND() ?
--
Cheers!
Dan Nagle
Purple Sage Computing Solutions, Inc.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|