- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying Fortran to output to screen without making paragraphs - i.e. output several times but in a row. The code below outputs correctly to screen if I compile the program and run it from the command line. However, it does not output to screen if I am using the debug feature of Visual Studio. Is there any work around or a better solution to this?
program test
implicit none
integer :: ind
do ind = 1,20
write(*,'(1x,i0)',advance='no') ind
!Some other stuff here
end do
end program
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's very interesting, and I can reproduce the behavior. While if one runs the program not under the debugger, you see the output, if you step through the program with the debugger output never appears, even at the end of the program.
I did find a workaround. Change the WRITE(*) to WRITE(6) and add, after the WRITE:
flush(6)
If you change the project property Fortran > Language > Enable F2003 Semantics to Yes, you don't have to change the WRITE, though to be formally correct you should change the program to:
program test use, intrinsic :: ISO_FORTRAN_ENV implicit none integer :: ind do ind = 1,20 write(*,'(1x,i0)',advance='no') ind flush(OUTPUT_UNIT) !Some other stuff here end do end program
I recommend that you report this problem to Intel using https://supporttickets.intel.com/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steve,
That worked perfectly. I will report the problem to Intel in any case.
Thanks,
Peter
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page