Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reading file on intel fortran

Status
Not open for further replies.

TheKKK

Technical User
Mar 21, 2009
10
GR
I have a file that looks like that:

Data from X04 2000
Time: GMT + 0

Date Hour Value
01.01.2003 00:00 60.0
01.01.2003 01:00 63.0

in gfortran on cygwin i use to read the header like that:
CHARACTER(LEN=18)
READ(17,'(A)') header
with no problem

On INTEL Fortran I get an error:

severe (257) formatted I/O to unit open for unformatted transfers ...

or if i read it like that:
READ(17,*) header

severe (24) end-of-file during read ...


What can i try to read this???

Thanx




 
I don't know Intel Compiler, but try to define the format separately with label
e.g.
100 FORMAT(A)
and then try
READ(17, 100) header
 
I didnt work..

Anyway i dont think there is a difference in this.
 
Ok, I think too, that Intel Fortran Compiler supports the format you use in READ(17,'(A)').
There must be other error in your program. But I doubt that without posting here the adequate source somebody could help you.
 
Hi TheKKK

Try to define "header" longer, for instance 32 instead of 18:

character*32 header
open(17,file='???',status='unknown')
read(17,'(a)') header
read(17,'(1x)')
read(17,'(1x)')
read(17,'(1x)')

... and then read the data. You clearly have 4 lines of text (or empty lines) before the data begins.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top