How do I flush output to file after each write with a gfortran Fortran 90 program?
You need to make the output unbuffered. Try setting the GFORTRAN_UNBUFFERED_ALL environment variable to 'y', 'Y' or 1.
The other way, if gfortran implements it, is to call the non-standard subroutine flush. Not all compilers do implement this.