- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm trying to get the following to work, using the Intel Fortran Compiler 8.1:
[...]
USE IFPORT
[...]
DO i=1,A
[...]
CALL ABC
END DO
SUBROUTINE ABC
IF (...)
[...]
WRITE (*, '(A)' ADVANCE='NO') "..."
CALL FLUSH(6)
END IF
END SUBROUTINE ABC
[...]
It compiles fine, but then on runtime the flushing doesn't seem to occur: the data is only written to screen when the DO loop is complete. I've compiled the same code using the NAG F95 compiler, except with USE F90_UNIX instead of USE IFPORT, and everything seems to work fine. Am I doing something silly somewhere? I've looked in the documentation, but I can't find anything that seems to help!
Thanks,
Andrew
I'm trying to get the following to work, using the Intel Fortran Compiler 8.1:
[...]
USE IFPORT
[...]
DO i=1,A
[...]
CALL ABC
END DO
SUBROUTINE ABC
IF (...)
[...]
WRITE (*, '(A)' ADVANCE='NO') "..."
CALL FLUSH(6)
END IF
END SUBROUTINE ABC
[...]
It compiles fine, but then on runtime the flushing doesn't seem to occur: the data is only written to screen when the DO loop is complete. I've compiled the same code using the NAG F95 compiler, except with USE F90_UNIX instead of USE IFPORT, and everything seems to work fine. Am I doing something silly somewhere? I've looked in the documentation, but I can't find anything that seems to help!
Thanks,
Andrew
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
CALL FLUSH is used to make sure that the file system writes data back to the file, rather than keeping it in internal buffers. It does not cause partial records to be written, which is what your case has.
The behavior you are looking for is implementation-dependent, and non-advancing I/O was not intended for this purpose. I recommend instead using the $ edit descriptor in an explicit formatted write. This will do what you want.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page