Re: Question about KIND
- From: Steve Lionel <steve.lionel@xxxxxxxxx>
- Date: 30 Apr 2007 08:19:53 -0700
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
.
- Follow-Ups:
- Re: Question about KIND
- From: Ron Shepard
- Re: Question about KIND
- References:
- Question about KIND
- From: Gus Gassmann
- Question about KIND
- Prev by Date: Help with Developing a GUI for Fortran program
- Next by Date: Re: Question about KIND
- Previous by thread: Re: Question about KIND
- Next by thread: Re: Question about KIND
- Index(es):
Relevant Pages
|
|