- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
in your example.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
T is 3x3, but X is of size 6. I was expecting an error messages that the matrix and vector are not conformable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
CVF doesn't do run-time shape conformance checking.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is this on the list of things that might be added in a future version?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes.
Steve
Steve

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page