next up previous

1 Overview of Fortran 90     continued...

Data Structures
Arrays are probably the most important composite data objects for computational science, but more heterogeneous objects are necessary, including dynamically linked structures. In the jargon of Fortran 90, structures are objects of user-defined type, discussed briefly next and in more detail in section 5 on page 50 and section 6 on page 50. Dynamically linked structures are provided by essentially recursive user-defined types:

This is an example of a type that could be used for a doubly-liked list structure. Recursive components (PREVIOUS and NEXT in this example) must be pointers. In general, a defined type may have any number and types of components.

TYPE LIST
   REAL                   :: DATA
   TYPE(LIST),POINTER     :: PREVIOUS, NEXT
END TYPE LIST