Dear list,
I would be most grateful for your advice on the following:
Suppose a derived type is declared as:
TYPE MYTYPE
INTEGER, ALLOCATABLE, DIMENSION(:) :: A
END TYPE
Consider the following subroutine that declares a local variable of
TYPE(MYTYPE)
SUBROUTINE MYSUB(ARG,OTHERARGS)
INTEGER, INTENT(OUT) :: ARG
! ... DECLARE OTHERARGS
! Local variables
TYPE(MYTYPE) :: XX
INTEGER, ALLOCATABLE, DIMENSION(:) :: YY
! ... Do stuff
ALLOCATE(YY(100))
ALLOCATE(XX%A(100))
! ... Do more stuff
RETURN
END SUBROUTINE MYSUB
QUESTION:
Is the allocatable component XX%A in MYSUB automatically deallocated
upon return from this subroutine?
(I understand that YY in the above subroutine is automatically deallocated.)
Many thanks,
David.
|