Re: Question about KIND



On Apr 30, 9:50 am, Mark Morss <mfmo...@xxxxxxx> wrote:
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. 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

Could SELECTED_INT_KIND() be a solution to your problem?

Oh sorry, I see that you're already using that.

.



Relevant Pages

  • 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)
  • Re: Question about KIND
    ... Gus Gassmann wrote: ... allocate if necessary). ... The current array bounds are stored with the ... Is there any way to switch between 4-byte and 8-byte pointers ...
    (comp.lang.fortran)
  • Re: Question about KIND
    ... allocate if necessary). ... lahey fortran 7.1 would return -1, and the compiler stops with an ... Is there any way to switch between 4-byte and 8-byte pointers ... I have started to look at "run-time polymorphism" and found a paper by ...
    (comp.lang.fortran)
  • Question about KIND
    ... I am writing a program with potentially very large arrays and I am ... allocate if necessary). ... Is there any way to switch between 4-byte and 8-byte pointers ... I have started to look at "run-time polymorphism" and found a paper by ...
    (comp.lang.fortran)
  • Re: Question about KIND
    ... On Apr 30, 12:20 pm, Dick Hendrickson ... allocate if necessary). ... The current array bounds are stored with the ... Is there any way to switch between 4-byte and 8-byte pointers ...
    (comp.lang.fortran)