I have the following short fortran code.
!==============================================
MODULE PREC
INTEGER, PARAMETER :: q=8
END MODULE PREC
!=====
No, the status of your pointer is undefined. You are not allowed to inquire it using associated()
because it can result in anything.
What you should always do is to use default initialization of all pointer components and initialize them to null()
.
TYPE spec
COMPLEX(q), POINTER :: HMAT(:,:) => null()
END TYPE
After that you are guaranteed to get the expected result false.