Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29010 Discussions

Intel 13 compiler - problem with READ statement

hjelme__lane
Beginner
558 Views

Hello Steve,

I have recently upgraded my Intel compiler from DVF 6.6a to Intel Compiler 13 (Visual Fortran Compiler XE 13.1.3.198 [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.

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

 

0 Kudos
5 Replies
Steven_L_Intel1
Employee
558 Views

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

0 Kudos
hjelme__lane
Beginner
558 Views

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

 

 

 

 

0 Kudos
Anthony_Richards
New Contributor I
558 Views

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.

0 Kudos
andrew_4619
Honored Contributor III
558 Views

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

0 Kudos
hjelme__lane
Beginner
558 Views

Thanks for all your answers.

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

 

0 Kudos
Reply