HP Fortran Programmer's Reference (September 2007)

HP Fortran statements
TARGET (statement and attribute)
Chapter 10 477
TARGET [::]
object-name
[(
array-spec
)]
[,
object-name
[(
array-spec
)]]...
array-spec
That is, an
assumed-size-spec
is an
explicit-shape-spec-list
with the
final upper bound given as *.
Description
The TARGET attribute or statement specifies that
name
is a target that may be pointed at by a
pointer. A target may be either a scalar or an array.
The TARGET attribute allows the compiler to generate efficient code because only those objects
specified with the TARGET or POINTER attribute can be dynamically aliased.
If the target in a pointer assignment is a variable, then one of the following must be true:
It must have the TARGET attribute.
It must be the component of a derived-type, the element of an array variable, or the
substring of a character variable that has the TARGET attribute.
It must have the POINTER attribute.
If the target of a pointer assignment is an array section, the array must have either the
TARGET or the POINTER attribute.
Examples
! p is a pointer array
INTEGER, POINTER, DIMENSION(:,:) :: p
! declare t as an array with the TARGET attribute
INTEGER, TARGET :: t(10, 20, 30)
Table 10-52
explicit-shape-spec
is
[
lower-bound
:]
upper-bound
assumed-shape-spec
is [
lower-bound
] :
deferred-shape-spec
is
:
assumed-size-spec
is [
explicit-shape-spec-l
ist
,] [
lower-bound
:] *