matmul trouble



I'm trying to decide from first principles how to represent the input when
you read in a square matrix with a read (*,*).
program maine2
integer :: x(3,3), z(3,3)
write (*,'(a)',advance='no') 'Give me 9 ints: '
read(*,*) x

z=matmul(x,x)
write (*,*) x, z
end program maine2
I'm puzzled that this should turn into a runtime error with 123456789 as an
input. You'd think the usual culprit would be inappropriately-sized arrays,
but it's hard to go wrong on that count with square matrices. Ideas?
--
Wade Ward


.