Fortran Fortran Program Test: How to Change Line in File

  • Thread starter Thread starter kth
  • Start date Start date
  • Tags Tags
    Fortran
AI Thread Summary
The discussion revolves around a Fortran program that writes integers to both the screen and a data file. The output on the screen displays the numbers 111 and 222 on separate lines, while the data file, test.dat, contains the numbers 111222 without line breaks. Users are seeking solutions to modify the file output to include line breaks between the numbers. One user notes that when compiling with F77, the data file correctly shows 111 and 222 on separate lines, but an extra line appears after 222. The conversation also touches on the differences in behavior when using F77 versus F90 compilers and the operating systems being used, specifically Linux and Windows XP.
kth
Messages
3
Reaction score
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??
 
Technology news on Phys.org
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?
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
Thread 'Project Documentation'
Trying to package up a small bank account manager project that I have been tempering on for a while. One that is certainly worth something to me. Although I have created methods to whip up quick documents with all fields and properties. I would like something better to reference in order to express the mechanical functions. It is unclear to me about any standardized format for code documentation that exists. I have tried object orientated diagrams with shapes to try and express the...

Similar threads

Replies
3
Views
7K
Replies
4
Views
11K
Replies
3
Views
3K
Replies
5
Views
5K
Replies
20
Views
36K
Replies
6
Views
2K
Replies
3
Views
3K
Replies
8
Views
2K
Replies
4
Views
2K
Back
Top