- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello NG,
I have always fought with an error that comes when I try to read unformatted binary files with convert=big_endian. When I try to read more than, say, 1000 values at a time, I always get this error:
input statement requires too much data
Well, that's not true. From the header of the file, I perfectly know how many floating point entries there are in the file. What I basically do is:
open(unit = 1, file = filename, form = 'UNFORMATTED', convert = 'BIG_ENDIAN')
read(1,end=10) MyVector(1:numvalues)
and I get that error. If I use an ugly approach in which I read 1000 values at a time, everything goes smoothly, like:
Code:
iind = int(lastvalue/1000) do while (mycount <= iind) mycount = mycount + 1 if (mycount <= iind) then read(1,end=10) MyVector(1000*(mycount-1)+1:1000*mycount) else read(1,end=10) MyVector(1000*(mycount-1)+1:lastvalue) endif enddo
This piece of code works, but it's ugly and I am sure slower than the one-liner read. Is there something I can do to avoid that error using the one-liner instruction to read all the values in a shot?
This is IVF 9.0, but it happened also with Compaq visual fortran 6.5...
Thank you very much for your suggestions.
Andrea
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Send an example and a description of the problem to Intel Premier Support.
![](/skins/images/7746D4550810124E96DD2FD9957552B1/responsive_peak/images/icon_anonymous_message.png)
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