I have a rather large program that periodically calls a subroutine. Inside the subroutine I write out a variable each time the subroutine is called. If I write it to the screen:
WRITE(*,*) HGT (1)
the correct value appears immediately. However, if I write it to a file
WRITE(4,*) HGT (1), the file remains empty for hundreds of subroutine calls, and then suddenly fills up with hundreds of values.
They are the correct values, but I would rather not wait 5 minutes before I can check whether or not the code is writing out the correct values.
Does anyone have any idea what the issue might be?
WRITE(*,*) HGT (1)
the correct value appears immediately. However, if I write it to a file
WRITE(4,*) HGT (1), the file remains empty for hundreds of subroutine calls, and then suddenly fills up with hundreds of values.
They are the correct values, but I would rather not wait 5 minutes before I can check whether or not the code is writing out the correct values.
Does anyone have any idea what the issue might be?