Re: Question about KIND



On Apr 30, 9:39 am, Gus Gassmann <Horand.Gassm...@xxxxxx> wrote:
I am writing a program with potentially very large arrays and I am
currently developing extensible vectors as objects (so I can re-
allocate if necessary). The current array bounds are stored with the
object (as integers). However, I am not clear as to what I should do
about the KIND of these pointers.

Are these really "pointers"? It seems to me that you want pointer-
sized integers for storing lengths. There isn't an F95-conformant way
to do this but I have a couple of suggestions.

1) If all you want is to use a 64-bit integer type if available, then
do this:

integer, parameter :: k_bigint = max(selected_int_kind(15), kind(0))

Note that this will give you a 64-bit integer kind if the compiler
supports it regardless of the size of an address.

2) If you want to know the kind of an address-sized integer, using a
common extension, this may work:

pointer (pdummy, dummy) ! Extension
integer, parameter :: k_bigint = kind(pdummy)

If your compiler supports the F2003 ISO_C_BINDING intrinsic module,
you can use the constant C_SIZE_T.

Steve

.



Relevant Pages

  • Re: Can drivers lie?
    ... The extension string and version number are the only reliable means of querying extension support. ... the NVIDIA driver supports all cards with a single binary. ... so it appears I am running OpenGL 1.3. ... function pointers that are associated with OpenGL 2.0. ...
    (comp.graphics.api.opengl)
  • Re: 64 bit file support
    ... the implementation supports long long as an extension). ... Because C90 didn't have long long. ... Are you saying that it is forbidden for a C90 implementation to have ... impossible to manage pointers with standard C90 long (and this fact created ...
    (comp.std.c)
  • Re: 16-bitness
    ... granularity than a word. ... That's what the extension bit did (the one between the ring bits and the ... mode, which only had 32-bit pointers, but was byte addressable. ... halfword designate a bit position within the target halfword specified ...
    (comp.sys.prime)
  • Re: manipulatind file names.
    ... > Any pointers would be appreciated ... > HP-UX 11i ... > filename and the extension that is the problem, the date string will ...
    (comp.unix.shell)
  • Re: Question about KIND
    ... allocate if necessary). ... The current array bounds are stored with the ... Is there any way to switch between 4-byte and 8-byte pointers ... My compiler sees the same lack of distinction: ...
    (comp.lang.fortran)