Fortran Program Test: How to Change Line in File

  • Fortran
  • Thread starter kth
  • Start date
  • Tags
    Fortran
  • #1

kth

4
0
program test
open(50,file='test.dat')
write(6 ,FMT='(I3,/)') 111
WRITE(6 ,FMT='(I3,/)') 222
write(50,FMT='(I3,/)') 111
WRITE(50,FMT='(I3,/)') 222
close(50)
end

In the above, at the screen i see:
111
222
but in the dat file i see:
111222

How can i change line in the file??
 
  • #2
Kth
When I run the above code compiled with F77 fortran, test.dat contains
111

222

with an extra line between the numbers and after the line 222.
On the other hand, the first character on the screen has been used for printer carriage control, namely the first 1 had been taken as a new page.

Are you running with f77 or f90, and on Linux or Windows XP?
 

Suggested for: Fortran Program Test: How to Change Line in File

2
Replies
60
Views
2K
Replies
8
Views
939
Replies
12
Views
1K
Replies
2
Views
649
Replies
18
Views
1K
Replies
12
Views
743
Replies
8
Views
781
Replies
4
Views
824
Replies
2
Views
612
Back
Top