- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
-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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much. '-assume byterecl' does the trick. I do not know record length is in longwords instead of bytes.
Henry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page