- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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 kopiert
1 Antworten
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Send an example and a description of the problem to Intel Premier Support.
Antworten
Themen-Optionen
- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite