I have found something weird in the memory used when a derived type extends another but I do not know if there is an explanation for this or if it is just a bug.
The simplified program below works as I would expect only when the default initialization of the Parent type (N = 0) is commented.
When I uncomment the initialization the memory reported by the Windows Task Manager is twice the expected one and after the deallocation not all the memory seems to be released (at the pause statement before the program end).
program Test type Parent integer :: N != 0 end type type, extends(Parent) :: Extended real(8) :: M(2000,2000) end type type(Extended), pointer:: Var allocate(Var) Var%M = 0d0 pause deallocate(Var) pause end program Test
Thanks in advance.