HP Fortran Programmer's Reference (September 2007)

HP Fortran statements
SEQUENCE
Chapter 10460
SEQUENCE
Imposes storage sequence on components of derived type object.
Syntax
SEQUENCE
Description
The SEQUENCE statement can appear once within any derived type definition; its presence
specifies that a storage sequence on the components that is the same as their definition
order. A derived type that includes the SEQUENCE statement in its definition is known as a
sequence derived type. Sequence derived types are used:
To allow objects of sequence derived type to be storage associated with the COMMON and
EQUIVALENCE statements.
To allow actual and dummy arguments to have the same type without use or host
association. The corresponding actual and dummy arguments of derived types are of the
same derived type if the derived-type objects refer to the same type definition.
Alternatively, they are of the same type if all of the following are true:
They refer to different type definitions with the same name.
They have the SEQUENCE statement in their definitions.
The components have the same names and types and are in the same order.
None of the components is of a private type or of a type that has private access.
The following restrictions apply to the use of the SEQUENCE statement:
No more than one SEQUENCE statement may appear in the definition of a derived type.
If a derived type definition includes the SEQUENCE statement, each component that is of
derived type must also include the SEQUENCE statement.
Examples
TYPE weather
! weather is a sequence derived type with two
! character components and two integer components
SEQUENCE
CHARACTER(LEN=32) place