Specifies that an object can become the target of a pointer.
The TARGET attribute can be specified in a type declaration
statement or TARGET statement, and takes one of the following
forms:
Type Declaration Statement:
type, [att-ls,] TARGET [,att-ls] :: obj [spec] [,obj [spec]]...
Statement:
TARGET [::] obj [spec] [,obj [spec]]...
type Is a data type specifier.
att-ls Is an optional list of attribute specifiers.
obj Is the name of an object. The object must
not be declared with the PARAMETER attribute.
spec Is an array specification.
A pointer is associated with a target by pointer assignment or by
an ALLOCATE statement.
If an object does not have the TARGET attribute or has not been
allocated (using an ALLOCATE statement), no part of it can be
accessed by a pointer.
The TARGET attribute is compatible with the ALLOCATABLE, AUTOMATIC,
DIMENSION, INTENT, OPTIONAL, PRIVATE, PUBLIC, SAVE, STATIC, and
VOLATILE attributes.
EXAMPLES:
The following example shows type declaration statements specifying
the TARGET attribute:
TYPE(SYSTEM), TARGET :: FIRST
REAL, DIMENSION(20, 20), TARGET :: C, D
The following is an example of a TARGET statement:
TARGET :: C(50, 50), D