The compiler should generate an ERROR for the following code.
Since type foo_t contains some default initialization (a=1) it is not legal for an array of these to be associated with a dummy argument which is of assumed size and has intent out (assumed shape and intent out would be ok, as would assumed size when there is no default initialization).
Since the size of the dummy array is not known, the compiler cannot therefore carry out the required initialization when proc is called.
Regards David.
program anon
implicit none
type foo_t
integer :: a = 1
integer :: b
end type foo_t
type (foo_t), dimension(4) :: foo
integer :: i
foo%a = 0
call proc(foo, 4)
do i=1, 4
print *, foo(i)%a, foo(i)%b, ' <-- should print 1, 2'
end do
contains
subroutine proc(foo, m)
integer, intent(in) :: m
type (foo_t), intent(out) :: foo(*)
integer i
do i=1, m
foo(i)%b = 2
end do
end subroutine proc
end program anon