- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
I have a piece of code which works for many years before I updated to ifort 8.0. The code is attached below. It seems that ifort has a bug to read direct access unformatted file. I have tested this code with the following fortran compilers:
o ifc version 5.0, 6.0, 7.1 and get "6";
o pgf90 version 5.1, get "6";
o g95, get "6";
o ifort 8.0, get "3"??
How should I avoid this problem with ifort 8.0?
Thanks.
Fortran 90 code attached:
filename ='test.data'
irow = 357 ! what we want
icol = 1086
WRITE(0,'(a,a)') ' Opening ',TRIM(filename)
OPEN (UNIT=lun, FILE=TRIM(filename), ACCESS='DIRECT', &
FORM='UNFORMATTED', STATUS='OLD', &
RECL=incol)
READ (lun, REC=irow) (inbuf(i), i=1,incol)
outarray = ICHAR(inbuf(icol))
CLOSE (lun)
print *, outarray
Link kopiert
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
-assume byterecland see if that helps. Since you did not supply the data file in question, I can't try it myself.
I will also note that ifort 8.0 is rather old at this point. 8.1.030 is the current version.
Message Edited by sblionel on 05-19-2005 04:46 PM
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Thank you very much. '-assume byterecl' does the trick. I do not know record length is in longwords instead of bytes.
Henry.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden

- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite