The following program defines a derived type at3 in terms of another derived type (at2), which in turn is defined as an array of yet another derived type (at1). Subroutine s is called to initialise an instance of at3, and then at3 is printed. However, only at3%c is printed, and at3%at2 appears to be missing.
Module m
!
Type t1
Integer :: i1
Integer :: i2
End Type t1
!
Type t2
Type(t1), Dimension(2) :: at1
End Type t2
!
Type t3
Type(t2) :: at2
Character :: c
End Type t3
!
Type(t3), Dimension(:), Pointer, Public :: at3
!
Contains
!
!
Subroutine s ()
!
Allocate (at3(1))
at3(1)%at2%at1(:)%i1 = 1
at3(1)%at2%at1(:)%i2 = 1
at3(1)%c = 'A'
!
Return
End Subroutine s
End Module m
Program p
Use m
!
Call s ()
Print*, at3
End Program p