- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello all,
My program crashes while reading from a binary file. The open statement looks like this:
open(unit=7,file='itape7',form='unformatted')
and the read statement is as follows:
read (7) (aaa1(n),n=1,ncom1)
where ncom1 = 87,500,005.
I get the following error:
forrtl: severe (22): input record too long, unit 7
The file I'm reading from has records of various lengths that are pre-determined.
Is there a way around it? The compiler version is 8.0.
Thanks in advance,
Sergei
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you use form='unformatted', it is looking for a particular layout of records, with a record length, data, then record length again. If the data in the file is not in this format (see the User's Guide), you may want to use form='binary' instead. Here, the total size of variables in the READ determines how many bytes are transferred.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much, using form='binary' seemed to take care of the problem.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page