Intel 13 compiler - problem with READ statement

Intel 13 compiler - problem with READ statement

Hello Steve,

I have recently upgraded my Intel compiler from DVF 6.6a to Intel Compiler 13 (Visual Fortran Compiler XE [IA-32].

And I now have following problem:

This simple read statement keeps returning an IOSTAT = -1. Telling me that I am at the end of the file.

When I run the debugger I don’t have any problems and the IOSTAT returns correct 0.

open(handle,file=outfile,status='OLD', iostat = ios)
rewind(handle, iostat = ios1)
write(66,*) 'rewind status: ',ios1

read(handle,'(a256)', iostat = ios, err=920) XML_line

write(66,*) 'After read: ',ios
write(66,*) 'xml_line: ', xml_line

Is this a problem you have heard about before?

Thanks a lot for your help.

Best regards
Lane Hjelme
Johnson Controls Denmark


6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I would check to make sure you are opening the correct file. My guess is that you're opening an empty file.

Retired 12/31/2016

Hello Steve,

Thanks for your answer.

I am quite sure the file is not empty. I have a poller program that is polling a folder - I check if the files exist

and have a size. Then I move on with the READ Statement.

I am asking you because it is not the first time I have problems with READ after installing new compiler.

From my program I am calling an external program. I/O is done by writing/reading XML files.

I think it could be a timing problem since it works fine in the debugger.

I have tried several different compiler options but haven't been able to solve the problem.

Best regards Lane





Are the files you are opening on a network drive, or are they on the machine that is running the program?

I suggest trying your READ on a file that is located in the same folder as the executable and see if
even that results in the problem you see.

Try a CALL SLEEPQQ(500) before the first read (requires USE IFPORT) if it is a timing problem.

Thanks for all your answers.

app4619: And especially to you - a call to SLEEPQQ solved my problem.


Leave a Comment

Please sign in to add a comment. Not a member? Join today