For example, the declaration
nullify(PtoR)PtoR has now the ``Null'' values, and its status is disassociated.
The association status may be tested using the logical intrinsic function
associated(PtoR)which returns .TRUE. if the pointer is associated, .FALSE. if not associated, or undefined if the pointer itself is undefined (because of this, it is a good idea to NULLIFY all pointers right after the declarations).
We can test the target of the pointer,
associated(PtoR,x)which returns .TRUE. if the pointer is defined and associated to the specific target x, and .FALSE. otherwise.
The function is useful to avoid deallocation errors
if ( associated(PtoA) ) deallocate(PtoA, STAT=ierr)