Software Archive
Read-only legacy content
17060 Discussions

Problem with record length when reading unformatted binary file

Intel_C_Intel
Employee
286 Views
Hi!

I try to read a binary file which was created on a Sun. I read the file into several scalar variables and vectors. This works fine, but when I increase the code parameter which determines the length of the arrays, things are only fine up to a length around 1200000. Above 1300000 or so, I get an error:
forrtl: severe (22): input record too long, unit 11, file ...
This happens also when I try to read one (the first) scalar value rather then the entire file. I open the file with:
open(idsk,file=dumpfile,status='unknown',form='unformatted') and I checked with inquire that none of the opening parameters, such as record length, type, etc. change when I increase the length of my arrays. The default record type the compiler chooses is variable-length, the default record length is 510.
Any one any idea??? Thanks.

Markus1
0 Kudos
3 Replies
Steven_L_Intel1
Employee
286 Views
Are you using CONVERT='BIG_ENDIAN'? You'd need that to read a Sun file correctly.

Steve
0 Kudos
Intel_C_Intel
Employee
286 Views
I'm using -convert big_endian as compiler option and verified with inquire that the file then actually gets opened with convert=big_endian. So this should not be the casue of the problem.

Ciao, Markus1
0 Kudos
Steven_L_Intel1
Employee
286 Views
Hmm - I see you are using an old version, though. Try installing the latest (5.4A from the CD-ROM, then the 5.4B update from our web site.) I have a vague recollection that we fixed a problem relating to long records and CONVERT sometime in the past year or two.

Steve
0 Kudos
Reply