Purpose
Returns the association status of its pointer argument, or indicates whether the pointer is associated with the target.
Class
Inquiry function
Argument Type and Attributes
Result Type and Attributes
Default logical scalar.
Result Value
If only the POINTER argument is specified, the result is .TRUE. if it is associated with any target and .FALSE. otherwise. If TARGET is also specified, the procedure tests whether POINTER is associated with TARGET, or with the same object that TARGET is associated with (if TARGET is also pointer).
If TARGET is present, then the result is .FALSE. if one of the following occurs:
Objects with different types or shapes cannot be associated with each other.
Arrays with the same type and shape but different bounds can be associated with each other.
Examples
REAL, POINTER, DIMENSION(:,:) :: A REAL, TARGET, DIMENSION(5,10) :: B, C NULLIFY (A) PRINT *, ASSOCIATED (A) ! False, not associated yet A => B PRINT *, ASSOCIATED (A) ! True, because A is ! associated with B PRINT *, ASSOCIATED (A,C) ! False, A is not ! associated with C END