I get the error message "FLUSH--FAILED:: Bad address" when flush() is called for stdout under certain circumstances.
The following small code reproduces the problem:
write(*,*) "now flushing"
write(*,*) "after flush"
Executing this code ("flushtest") produces the standard output
as expected. You can also redirect this output and append it to an existing text file "abc":
flushtest >> abc
This works as expected as long as "abc" does not contain more than 1023 characters! If "abc" contains 1024 or more characters, a series of the special character "^@" is flushed and the abovementioned error message is issued.
Does somebody know the reason for this strange behaviour? Any workarounds for this problem?
(I'm using ifc 7.0 built in October 2002, Kernel 2.4.)