0

I wonder if there is some trick to flush (dump the buffer) all the output files when a runing fortran program end in a unexpected way (an external stop for example). It would be great if there is a way to set this in the language, however if there is an external way (linux) could be also usefull. I think that may be there is a way to write the buffer in this situations... may be capturing a signal? I don't know.

Thanks in advance.

MOTIVATION: When there is some unexpected end in the program, dump the buffer could be very usefull to debug, but if this dump is only in this case, it is posible to avoid the unnecessary "flush" sintax that consume the resources.

4

1 に答える 1

0

使用できます

open(unit = 10, file = "toto")
....
call flush(10)

http://gcc.gnu.org/onlinedocs/gfortran/FLUSH.html

vladimir F のコメントによると、コンパイラが fortran 2003 標準をサポートしている場合はflush、ステートメントとして使用できます。

open(unit = 10, file = "toto")
...
flush(10)
于 2013-11-06T13:45:11.113 に答える