matmul and conformable matrix-vector

matmul and conformable matrix-vector

I'm using CVF 6.6B. I expected the following program to give a run-time error, but it runs without complaint. Is this WAD?

program Test
implicit none
real, dimension(3,3):: T
real, dimension(6) :: X
T = 1
X = 1
call Sub( T, X )
contains
subroutine Sub( T, X )
real, dimension(:,:), intent(in):: T
real, dimension(:), intent(in):: X
write( *, * ) matmul( T, X )
end subroutine Sub
end program Test

C:>Test.exe
3.000000 3.000000 3.000000

6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Setting an array name to a fixed number sets each row and column element of the array to the fixed number. I am not sure, but this might be an old Fortran standard that is not well known. It is similar to setting an entire matrix to zero by saying X = 0, where X is defined as X(6)
in your example.

T is 3x3, but X is of size 6. I was expecting an error messages that the matrix and vector are not conformable.

CVF doesn't do run-time shape conformance checking.

Steve

Steve

Is this on the list of things that might be added in a future version?

Yes.

Steve

Steve

Login to leave a comment.