I want to display the progress of a calculation done using DO-loop on the console screen. I can print the progress variable on the terminal as follows:
PROGRAM TextOverWrite_WithLoop
IMPLICIT NONE
INTEGER :: Number, Maximum = 10
DO Number = 1, MAXIMUM
WRITE(*, 100, ADVANCE='NO') REAL(Number)/REAL(Maximum)*100
100 FORMAT(TL10, F10.2)
! Calcultations on Number
END DO
END PROGRAM TextOverWrite_WithLoop
The output of the above code on the console screen:
10.00 20.00 30.00 40.00 50.00 60.00 70.00 80.00 90.00 100.00
All in one line, wrapped only in the console window.
The argument ADVANCE = 'No' , and TL10 (the tab left so many spaces), the edit descriptor works well to overwrite text on the same line, for example. output of the following code:
WRITE(*, 100, ADVANCE='NO') 100, 500
100 FORMAT(I3, 1X, TL4, I3)
There is:
500
Instead:
100 500
Due to TL4 edit descriptor.
, WRITE , WRITE, WRITE ( DO-loop).
- ?
FTN95 Windows 7 RC1. ( G95 bluescreens Windows 7 RC1, , Vista.)
Fortran 95, , , ; , .
.