Program rtc_pdt_len_params2 Implicit None Type t(k) Integer,Len :: k Real c(k) End Type Type(t(7)) x x%c = [ 1,2,3,4,5,6,7 ] Call test(x,7) ! Okay Call test(x,3) ! Bad Call zap(123) Call test(x,123) ! Also bad Contains Subroutine zap(n) Integer,Intent(In) :: n Real r(n) Real,Allocatable :: a(:) Call Random_Number(r) a = r*100 If (Sum(a)==100*n) Stop 'Unbelievable' End Subroutine Subroutine test(y,n) Type(t(*)),Intent(InOut) :: y Integer,Intent(In) :: n Type(t(n)) :: z Integer i Real s Print *,'Assignment of K',y%k,'expression to K',z%k,'variable' z = y s = 0.0 Do i=1,n s = s + z%c(i) z%c(i) = -z%c(i) End Do Print *,'Sum =',s End Subroutine End Program