Newline in fortran

  • Fortran
  • Thread starter kth
  • Start date
  • #1
kth
4
0

Main Question or Discussion Point

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??
 

Answers and Replies

  • #2
365
0
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?
 

Related Threads for: Newline in fortran

Replies
8
Views
976
Replies
9
Views
8K
  • Last Post
Replies
5
Views
5K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
2
Views
1K
  • Last Post
Replies
5
Views
2K
  • Last Post
Replies
3
Views
3K
  • Last Post
Replies
2
Views
2K
Top