To determine the size of different variables in F90, I typically use
fdpsize=size(transfer(1.0d0, (/'a'/)))
fltsize=size(transfer(1.0, (/'a'/)))
intsize=size(transfer(1, (/'a'/)))
which will give you the number of "characters" or bytes that each
data type consumes.
Stu.
On 07/07/2005, at 21:18, simon harding (RRes-Roth) wrote:
> I am in the process of moving some code onto a 64-bit machine. In
> order to keep the code portable I thought I could use
> SELECTED_INT_KIND, say, to detect whether I was on a 32-bit or 64-
> bit platform. I thought something like SELECTED_INT_KIND(12) should
> return -1 if I was on 32-bit. However, is it safe to assume this is
> going to work in all cases? I think that it is possible that a 32-
> bit compiler could emulate longer integers and thus return a
> positive kind number to the above inquiry. Is this a realistic
> doubt, i.e. are there compilers that actually do emulate longer
> integer types, in the way that some 32-bit compilers have REAL*16.
> And if so, is there another protable way of determining the
> architecture, preferably using elemental intrinsics that are valid
> in initialization expressions, for example to replace:
>
> logical, parameter :: l64 = selected_int_kind(12) > 0
>
> Thanks for any help anyone can give on this one,
> Cheers
> Simon.
>
>
--
Dr Stuart Midgley
[log in to unmask]
|