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

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

Hello all,When using coarrays the write(...., advance='no') executes after the read statement that followsHere is the code:

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 
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

publicaciones de 4 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.
Imagen de Steve Lionel (Intel)

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.

Steve

Many thanks Steve!

Imagen de Steve Lionel (Intel)

This was fixed in the 13.1 compiler.

Steve

Inicie sesión para dejar un comentario.