- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When i compile my code with -c -u -O -auto -convert big_endian -assume byterecl -align none and use the open statement OPEN(unit=23, file=testfile, status="replace", action="write", access="sequential", form="unformatted") to write out 16bit data, this writes out a data file that is big_endian. When i use the same compile options and the open statement OPEN(unit=23, FILE=Filename, FORM='UNFORMATTED', ACTION='WRITE', STATUS='UNKNOWN', RECL=RecordLength, ACCESS='DIRECT') to write an 8 bit data array as big_endian it doesn't work. The file is as it should be except that it is little_endian. Doesn't anyone have any similar experience of this?
Thanks,
Jo
Thanks,
Jo
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jo,
What are you expecting to happen with 8-bit data? Big-endian does byte swapping of a multi-byte value, but a single byte value has nothing to swap with.
What are you expecting to happen with 8-bit data? Big-endian does byte swapping of a multi-byte value, but a single byte value has nothing to swap with.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Sorry i got confused with this. I thought that was the case with 8bit data but then the man pages for ifort says that -convert big_endian swaps INTEGER*1 so i thought maybe my understanding was wrong. I think i have now found the problem else where. Sorry to waste your time!
Thanks,
Jo
Sorry i got confused with this. I thought that was the case with 8bit data but then the man pages for ifort says that -convert big_endian swaps INTEGER*1 so i thought maybe my understanding was wrong. I think i have now found the problem else where. Sorry to waste your time!
Thanks,
Jo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'll check the man page to see if it needs correction. The Building Applications manual says " INTEGER(KIND=1) data is the same for little endian and big endian."

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