- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am converting some code from NAG to ifort 9.0. I am reading a 9022x3086 1 byte data array and i am using -assume byterecl and increasing my ulimit to do this and it all works fine. I then do some processing on the array that turns it into a 2byte int data array. I then open a file sequentially to write a header and then the data array.
OPEN(unit=nimrod_store(id)%ref, file=TRIM(nimrod_store(id)%name), &
status="replace", action="write", &
access="sequential", form="unformatted")
!
! Write the header data
WRITE(unit=nimrod_store(id)%ref,iostat=ierror_code) &
h%iheader, &
h%rheader, &
h%rheader_specific, &
h%cheader, &
h%iheader_specific
!
! Write the image data
WRITE(unit=nimrod_store(id)%ref,iostat=ierror_code)nimrod_store(id)%data
CLOSE(unit=nimrod_store(id)%ref)
Heres where the weird bit happens. I have checked the contents of my array before writing and i still have a 9022x3086 array and all the data looks fine. But when i check what has been written out the data array is still 9022x3086 but the actual data values have been compressed/reduced somehow to a quarter the size and the rest of the array filled with zeros. I have tried only writing some of the array and i still get this same squashing of the data. Any help would be amazing! Thanks.
OPEN(unit=nimrod_store(id)%ref, file=TRIM(nimrod_store(id)%name), &
status="replace", action="write", &
access="sequential", form="unformatted")
!
! Write the header data
WRITE(unit=nimrod_store(id)%ref,iostat=ierror_code) &
h%iheader, &
h%rheader, &
h%rheader_specific, &
h%cheader, &
h%iheader_specific
!
! Write the image data
WRITE(unit=nimrod_store(id)%ref,iostat=ierror_code)nimrod_store(id)%data
CLOSE(unit=nimrod_store(id)%ref)
Heres where the weird bit happens. I have checked the contents of my array before writing and i still have a 9022x3086 array and all the data looks fine. But when i check what has been written out the data array is still 9022x3086 but the actual data values have been compressed/reduced somehow to a quarter the size and the rest of the array filled with zeros. I have tried only writing some of the array and i still get this same squashing of the data. Any help would be amazing! Thanks.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Joanne,
I'll contact you via email to get a complete copy of the code to test.
ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just as a closure report on this:
The input file was a raw datafile, ie one without record or file marks. To open these, the OPEN statement supports a vendor extension, argument FORM='BINARY'. This allows the FRTL to read these raw data files without expecting record and file markers.
ron

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