Go to main content
Oracle® Developer Studio 12.5: Fortran User's Guide

Exit Print View

Updated: June 2016
 
 

4.4 STRUCTURE and UNION (VAX Fortran)

To aid the migration of programs from legacy FORTRAN 77, f95 accepts VAX Fortran STRUCTURE and UNION statements, a precursor to the “derived types” in Fortran 95. For syntax details see the FORTRAN 77 Language Reference manual.

The field declarations within a STRUCTURE can be one of the following:

  • A substructure— either another STRUCTURE declaration, or a record that has been previously defined.

  • A UNION declaration.

  • A TYPE declaration, which can include initial values.

  • A derived type having the SEQUENCE attribute. (This is particular to f95 only.)

As with the legacy f77 compiler, a POINTER statement cannot be used as a field declaration.

f95 also allows:

  • Either ”.” or ”%”T can be used as a structure field dereference symbol:struct.field or struct%field.

  • Structures can appear in a formatted I/O statement.

  • Structures can be initialized in a PARAMETER statement; the format is the same as a derived type initialization.

  • Structures can appear as components in a derived type, but the derived type must be declared with the SEQUENCE attribute.