- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello all,When using coarrays the write(...., advance='no') executes after the read statement that followsHere is the code:[fortran]program coarrays_advno implicit none character(10) :: filename if (this_image()==1) then write(*,'(a)',advance='no'), "- Filename = " !write(*,*), "- Filename = " read(*,*) filename print *, filename end if end program coarrays_advno [/fortran] This gives the following output :hello- Filename = helloI am not sure what's wrong.Could you please let me know if you experience the sameproblem ?Many thanks,KostasNOTE: ifort version 12.1.5
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your guess as to how it is executing is not correct. The write does execute, but the contents of the record are not displayed until an advancing write is performed. You are assuming that the partial record is written to the console immediately. I find it interesting, though, that introducing coarrays into the program changes the behavior. Since we apparently do flush the partial record in the non-coarray case (I was rather astonished at this as I thought we didn't), we should do it for the coarray case too. I will let the developers know. Issue ID is DPD200234586.
In any event, the standard does not specify the behavior you want. It would be standard-conforming to not write anything to the console until an advancing write was done.
In any event, the standard does not specify the behavior you want. It would be standard-conforming to not write anything to the console until an advancing write was done.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Many thanks Steve!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This was fixed in the 13.1 compiler.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page