To aid the migration of programs from f77, 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 f77, a POINTER statement cannot be used as a field declaration.
f95 also allows:
Either ”.’ or ”%’ 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.