The TARGET attribute specifies that an object can become the target of a pointer (it can be pointed to).
The TARGET attribute can be specified in a type declaration statement or a TARGET statement, and takes one of the following forms:
Type Declaration Statement:
Rules and Behavior
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 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
For More Information: