James Giles wrote:
> >I want to declare a type like this:
> >
> >type node
> > real,dimension(:),allocatable :: lenght
> >end type node
> >
> >type(node),dimension(:),allocatable :: all
>
> Under F90, it is not permitted for a derived data type to contain an
> allocatable element. This is to be addressed in the F200x revision
> of the standard. In the meantime you can make the field a pointer:
>
> type node
> real, pointer :: length(:)
> end type node
>
> type(node), allocatable :: all(:)
>
> ...
> allocate (all(10))
All correct. For lucid explanations of F90 pointers, their limitations,
and methodologies to work around the limitations, I suggest the
following two references:
1) Fortran 90/95 Explained, by Michael Metcalf and John Reid. (ISBN 0 19
851888 9)
2) Numerical Recipes in Fortran 90 - The Art of Parallel Scientific
Computing, by William Press et. al. (ISBN 0 521 57439 0)
Both of these will help. Note the biggest problem in Fortran 90 is that
pointers are born undefinded, not "unassociated." This introduces some
complexity into the code. I don't know how much you know about pointers
in general, so I'll leave it at that for now.
Good luck!
Alvaro Fernandez
Mechanical Engineering
Rice University
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|