Re: matmul trouble




"Richard Maine" <nospam@xxxxxxxxxxxxx> wrote in message
news:1i0yctz.i6ab101tvqfpzN%nospam@xxxxxxxxxxxxxxxx
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....

Afraid I don't have any good ideas, anyway not ones I could plausibly
work remotely. If I were sitting in front of the machine with code that
demonstrated the problem, I'd probably fiddle around with lots of things
for clues. But I can't do that remotely. Not even worth trying at that
level. I'm talking about the kind of fiddling where I'd probably go
through several dozen fruitless things before getting much of a hint.
Even if you have the patience for that kind of thing remotely, I don't.

That being said, and on a few more minutes of reflection.... :-)

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.
You hit something.
program maine3
integer :: x(2,2), z(2,2)
OPEN(11, File="output4.txt",STATUS='REPLACE')
write (*,'(a)',advance='no') 'Give me ints: '
read(*,*) x
z =x
!z = matmul(x,x)

write (11,'(i4)') z
close(11)
end program maine3
! output4.txt:
1
2
3
4
I don't want to trim away the rest of the post, because a person isn't
always certain what all still has bearing.
--

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...)

Both along the lines of simpifying as much as possible.

--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain


.



Relevant Pages

  • 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)
  • 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
    ... Probably the first pointless fiddle I'd do would be to take the matmul ... end program maine4 ... If a simple initialization followed by a call to matmul fails, it might be worth checking that you're linking against the correct library. ...
    (comp.lang.fortran)
  • Re: matmul trouble
    ... Hitting CR between them is slightly more complicated; ... in invoking the compiler could also fall under here. ... I thought matmul was the culprit, ... end program maine3 ...
    (comp.lang.fortran)
  • 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)