Hello,
I have shied away from using IOLENGTH to determine
sizes of kinds because the method is not required
by the standard to work. It returns a record length,
which may include processor dependent control information.
The standard only requires that the record length be
determined *mainly* by the list items.
For absolute determinations, the Method of Olagnon
is probably best (it's an all memory method). If
somebody can find a flaw with it, I'd like to hear
what the flaw is.
The lack of BIT_SIZE() for anything other than integers
is, of course, why standard_types extends it.
That fact that others have an interest in this issue
is heartening (maybe I'm not crazy ;-).
Peter Shenkin wrote:
>
> Hi,
>
> As a followup to earlier inquiry of mine:
>
> By means of compiling and running the following simple program,
> I've found that the following platforms available to me have
> LOGICAL(KIND=1). In all cases, this is one byte long; that
> is, INTEGER is 4x the length of LOGICAL(KIND=1).
>
> Since I know INTEGER to be 32-bit on the machines in question
> (the way I ran the compiler), the conclusion that LOGICAL(KIND=1)
> is 8 bits long follows.
>
> SGI
> AIX
> TRU64
> Solaris/SPARC
> HP
> LINUX/Intel/Absoft
>
> These are quite recent compilers on all, though not necessarily the
> very latest. I can say that all were the latest sometime over the
> past year.
>
> The program is:
>
> LOGICAL(KIND=1) :: L( 8 )
> INTEGER :: I(8), II, IL
> INQUIRE( IOLENGTH=IL) L
> INQUIRE( IOLENGTH=II) I
> WRITE( 6, * )'II, IL= ', II, IL
> WRITE( 6, * )'II/IL= ', II/REAL( IL )
> END
>
> A typical output is:
>
> II, IL= 32, 8
> II/IL= 4.
>
> That is, the "typical" platform reports lengths in bytes. TRU64,
> however, reports length in INTEGER-size words. Still, of course,
> the ratio II/IL is 4.
>
> I'd be curious to hear results from other platforms....
>
> -P.
>
> --
> ** Whether the playing field is level depends on the coordinate system. ***
> ********* Peter S. Shenkin; Schrodinger, Inc.; (201)433-2014 x111 *********
> *********** [log in to unmask]; http://www.schrodinger.com ***********
--
Cheers!
Dan Nagle
Purple Sage Computing Solutions, Inc.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|