Re: matmul trouble



Wade Ward wrote:
"Louis Krupp" <lkrupp@xxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:1393jba9n530lfd@xxxxxxxxxxxxxxxxxxxxx
Richard Maine wrote:
Richard Maine <nospam@xxxxxxxxxxxxx> wrote:

Wade Ward <invalid@xxxxxxxxxxxx> wrote:

I thought matmul was the culprit, but it's the write statement.
Well. That's where you see the error. That doesn't necessarily mean that
is actually where the problem is....
Probably the first pointless fiddle I'd do would be to take the matmul
out of the picture by doing something trivial like z = x instead of the
matmul.

And another might be to take the advance='no' off of the prior write.
(No, I don't have any good reason for that. It is probably completely
pointless. But well... maybe if the advance='no' doesn't leave the I/O
system in a good state for some reason...)
I took that off and uncommented the matmul. Same runtime error.

Along those lines, I would try initializing x within the program and then calling matmul and printing the result; it gets the read statement out of the picture.
I find no example of this in MR&C. This initialization fails:
program maine4
integer :: x(2,2), z(2,2)
OPEN(11, File="output4.txt",STATUS='REPLACE')
write (*,'(a)') 'Give me ints: '
x = (/1,2,3,4/)
z =x
!z = matmul(x,x)
write (11,'(i4)') z
close(11)
end program maine4
--

You said you "uncommented the matmul," but your example shows it commented out.

When you say the example fails, what message do you get?

I would also stick with "write(*, ...)" instead of opening a disk file. It eliminates some variables.

If a simple initialization followed by a call to matmul fails, it might be worth checking that you're linking against the correct library. Do other intrinsics work?

Louis
.



Relevant Pages

  • Re: matmul trouble
    ... Probably the first pointless fiddle I'd do would be to take the matmul ... out of the picture by doing something trivial like z = x instead of the ... end program maine4 ...
    (comp.lang.fortran)
  • Re: matmul trouble
    ... If I were sitting in front of the machine with code that ... Probably the first pointless fiddle I'd do would be to take the matmul ... end program maine3 ...
    (comp.lang.fortran)
  • Re: matmul trouble
    ... Richard Maine wrote: ... through several dozen fruitless things before getting much of a hint. ... Probably the first pointless fiddle I'd do would be to take the matmul ...
    (comp.lang.fortran)
  • Re: matmul trouble
    ... end program maine4 ... You said you "uncommented the matmul," but your example shows it commented ... intrinsics work? ...
    (comp.lang.fortran)
  • Re: matmul trouble
    ... If I were sitting in front of the machine with code that ... Probably the first pointless fiddle I'd do would be to take the matmul ... I would try initializing x within the program and then calling matmul and printing the result; it gets the read statement out of the picture. ...
    (comp.lang.fortran)