Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29419 Discussions

Write on same line of display problem

David_Bal
Beginner
1,002 Views

I want to write program progress on the same line of the display (no scrolling). I have a method that works with GNU Fortran and PGI Fortran, but not with Intel Fortran. The example below displays 1, 2, 3...10 on the same line seperated by 1 second delay. With Intel Fortran there is a 10 second delay with nothing on the display and then a 10 at the end.

It seems that the FLUSH statement isn't working. I also tried the CALL FLUSH(6) intrinsic without any improvement.

[fortran]do i=1,10 write (*,"(A1,I2)",advance="no") char(13), i flush(6) call sleep(1) enddo write (*,*) [/fortran]

Can you help me get thisfeature working with Intel Fortran? I am using version12.0.0 build 107.
Thanks.

0 Kudos
4 Replies
Steven_L_Intel1
Employee
1,002 Views
There is no standard-conforming way to do this. I have a feature request in to allow FLUSH to do what you want. There is a way to do it with non-standard edit descriptors and Fortran carriage control.
0 Kudos
David_Bal
Beginner
1,002 Views

Is there an estimated date to have the feature added to FLUSH?

0 Kudos
Steven_L_Intel1
Employee
1,002 Views
No commitment has been made. I will add your interest to the request.
0 Kudos
Steven_L_Intel1
Employee
1,002 Views

This was implemented in a 13.0 update. Sorry for not updating the thread earlier.

0 Kudos
Reply