Basic HTML version of Foils prepared 17 Sept 1996

Foil 12 Examples of POINTER's in Fortran90

From New CPS615HPF and Fortran90 Discussion Sept 17 96 Basic Simulation Track for Computational Science CPS615 -- Fall Semester 96. by Geoffrey C. Fox, Tom Haupt


1 One can define a linked list as:
2 TYPE ENTRY
  • REAL VALUE
  • INTEGER INDEX
  • TYPE(ENTRY), POINTER :: NEXT
3 END TYPE ENTRY
4 ALLOCATE Creates dynamically elements in a linked list
5 CURRENT = ENTRY( NEW_VALUE, NEW_INDEX, FIRST)
6 FIRST => CURRENT
7 adds a new entry at start of linked list and renames it with POINTER FIRST

in Table To:


© on Tue Oct 7 1997