program test
type matrix(kind,n)
integer, kind :: kind=kind(0.0d0)! gives a default value
integer, len :: n ! no default value given
real(kind) :: arr(n)
end type
type(matrix(kind=kind(0.0),n=2)) :: a
type(matrix(4,:)),allocatable :: b
a%arr = [1,2]
b=a
print*,b
a%arr = [3,4]
print*,b
pause
end program