Formatted output problem in Fortran

  • Fortran
  • Thread starter chaimluria
  • Start date
  • #1

Main Question or Discussion Point

Hello,

I have correctly defined my OPEN and CLOSE statements. When all of my WRITE statements with their associated FORMAT statements are at the end of the program I get the formatted output that I need.

If I move one of the WRITE statements to the body of the program (within a particular DO LOOP) I get a binary output file.

What am I doing wrong. How can I have a WRITE statement in the body of a program and still get formatted output.

Regards,

C. Luria
 

Answers and Replies

  • #2
minger
Science Advisor
1,495
2
It would help to see some code, I've never seen something like that. However, rather than having format specifiers, you could try putting the format in the write statement, e.g.
Code:
DO i=1,n
  WRITE(10,(2G15.3,A4)) data
END DO
 
  • #3
The problem seems to have resolved itself. I must have made some sort of syntax error. Thank you minger for your reply and suggestion.
 

Related Threads on Formatted output problem in Fortran

Replies
1
Views
4K
Replies
2
Views
3K
Replies
3
Views
1K
Replies
3
Views
4K
Replies
5
Views
2K
  • Last Post
Replies
5
Views
1K
Replies
2
Views
10K
Replies
1
Views
2K
Replies
1
Views
4K
Replies
3
Views
3K
Top