expanding on my comment, you should also use an implicit loop..try this:
open(unit=2, file='graph1.txt', ACTION="write", STATUS="replace")
do i=1,N
write(2, '(1000F14.7)')( real(Vec(i,j)) ,j=1,M)
end do
or for sufficiently modern compilers (I'm not sure how new.. )
write(2, '(*(F14.7))')( real(Vec(i,j)) ,j=1,M)
Note as has been pointed out, the parenthesis around (F14.7)
are required for the *
unlimited-format-item in the 2008 standard.
may as well pull in the other comments, you can also do this:
write(2, '(*(F14.7))')real(Vec(i,:M))