Question about KIND



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. Specifically:

TYPE extensible_vector
integer (kind=selected_int_kind(16)) :: lb, allocated_ub,
currently_used_ub
real (kind=selected_real_kind(15), allocatable, dimension (:) ::
vec
end TYPE extensible_vector

may fail to compile if selected_int_kind(16) is not available (e.g.,
lahey fortran 7.1 would return -1, and the compiler stops with an
error). Is there any way to switch between 4-byte and 8-byte pointers
at run-time? Or even just to allocate pointers as 8-byte objects when
available and use 4-byte storage plus an error otherwise?

I have started to look at "run-time polymorphism" and found a paper by
Decyk, Norton and Szymanski on the subject (Computer Physics
Commuications 1998). I can't say I have fully digested it. Does my
problem have anything to do with run-time polymorphism? Is the
mechanism described in that paper still the state of the art?

Any feedback would be greatly appreciated.

gus gassmann

.