Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29298 Discussions

advance='no' prints after the read command that follows when using coarrays

kostas85
Beginner
502 Views

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

0 Kudos
3 Replies
Steven_L_Intel1
Employee
502 Views
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.
0 Kudos
kostas85
Beginner
502 Views
Many thanks Steve!
0 Kudos
Steven_L_Intel1
Employee
502 Views

This was fixed in the 13.1 compiler.

0 Kudos
Reply