I want to display the progress of a calculation done with a DO-loop, on the console screen. I can print out the progress variable to the terminal like this:
The following worked perfectly using g95 fortran:
NF = NF + 1 IF(MOD(NF,5).EQ.0) WRITE(6,42,ADVANCE='NO') NF, ' PDFs'//CHAR(13) 42 FORMAT(I6,A)
gave: 5 PDFs
leaving the cursor at the #1 position on the same line. On the next update, the 5 turned into a 10. ASCII 13 (decimal) is a carriage return.