Can byteswapio be enabled for only certain file descriptors?

For example.

fort.10 would be read as little endian, but fort.20 would be read as big endian…

To use byteswapio for a particular file descriptor, add the OPEN specifier “CONVERT=”, where “” is either ‘BIG_ENDIAN’, ‘LITTLE_ENDIAN’, or ‘NATIVE’. ‘LITTLE_ENDIAN’ and ‘NATIVE’ do not do byte-swaping on x86 systems.

  • Mat

I’ve used CONVERT=BIG_ENDIAN successfully in the past. However, it’s been a while and I was trying to find some pgi documentation on this modifer of the OPEN statement before using it again. I could find none. Perhaps I’m missing some docs or is this maybe deprecated? (I did a case-insensitive grep for “big_endian” on the entire pgi install tree.) FWIW, I tested using -byteswapio instead and it had the same effect on my test data. I will use that from now on unless I need to specify endianness per descriptor as the OP. (Please let me know if you think that is a mistake.)

Hi Erik,

We’re in the process of updating our rather old Fortran reference manual. I’m glad you asked because it looks like they forgot to add the CONVERT specifier to the OPEN statement documentation. I sent a note off so hopefully we can get this feature included.

Using “-byteswapio” is fine to use and actually recommended over CONVERT if all IO is in BIG_ENDIAN.