Lahey/Fujitsu Fortran

Derived Type Component References

Components of a structure are referenced using the percent sign `%' operator. For example, latitude in the structure my_coordinates, above, is referenced as my_coordinates%latitude. latitude in type coordinates in structure my_town is referenced as my_town%coordinates%latitude. If the variable is an array of structures, as in cities, above, array sections can be referenced, such as


which references the component name for all elements of cities, and


which references element latitude of type coordinates for elements (1,1) and (1,2) only of cities. Note that in the first example, the syntax


is equivalent and is an array section.