Next: ATAN, Previous: ASINH, Up: Intrinsic Procedures
ASSOCIATED — Status of a pointer or pointer/target pairASSOCIATED(PTR [, TGT]) determines the status of the pointer PTR
or if PTR is associated with the target TGT.
RESULT = ASSOCIATED(PTR [, TGT])
| PTR | PTR shall have the POINTER attribute and
it can be of any type.
|
| TGT | (Optional) TGT shall be a POINTER or
a TARGET. It must have the same type, kind type parameter, and
array rank as PTR.
|
ASSOCIATED(PTR) returns a scalar value of type LOGICAL(4).
There are several cases:
ASSOCIATED(PTR) program test_associated
implicit none
real, target :: tgt(2) = (/1., 2./)
real, pointer :: ptr(:)
ptr => tgt
if (associated(ptr) .eqv. .false.) call abort
if (associated(ptr,tgt) .eqv. .false.) call abort
end program test_associated