Richard Maine wrote:
>
> Toon Moene writes:
> > > 1. When you _really_ want a pointer, e.g. for a linked-list.
> >
> > > 2. When you want an allocatable component of a derived type.
>
> > I'm coming a bit late in this conversation (been attending a workshop at
> > the UK Met. Office the last few days) - but isn't (1) just a specific
> > example of (2) ?
>
> Not at all. Indeed almost the opposite. In (1) you really want a
> pointer because it needs to point to something else, as in a linked
> list.
Huh? - Perhaps I do not understand "linked lists" ? :-)
TYPE LINKEDLIST
TYPE (LINKEDLIST), ALLOCATABLE :: NEXT
TYPE CONTENT
blah ... blah ... blah
END TYPE CONTENT
END TYPE LINKEDLIST
....
TYPE(LINKEDLIST) THEHEAD
....
! Start linked list
ALLOCATE(THEHEAD % NEXT, bla-dee-blah, STAT=ILOVEYOU)
I must be missing something ...
--
Toon Moene - mailto:[log in to unmask] - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
GNU Fortran 95: http://g95.sourceforge.net/ (under construction)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|