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


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



© on Tue Oct 7 1997