HP Fortran Programmer's Reference (September 2007)

I/O and file handling
Binary I/O Conversions (for Itanium‚—based systems)
Chapter 8 225
Binary I/O Conversions (for Itanium—based systems)
This feature enables the specification of a binary conversion to happen to all unformatted
sequential data on reads and writes to various units. Both the OPEN and INQUIRE
commands accept the CONVERT argument.
Allowable conversions
There are two types of allowable conversions:
Native—the default, and no conversions will occur. The user may also specify
“Big_Endian”.
Little_Endian—will convert data from Little_Endian format to the Native format while
reading it in and back to Little_Endian format when writing it out to disk.
When the CONVERT argument is specified to the OPEN statement, all I/O to that I/O unit
will undergo the specified conversions.
When the CONVERT argument is specified to the INQUIRE statement, a string is returned
that describes the conversions being done at runtime for a given I/O unit.
In addition to specifying the CONVERT parameter to the OPEN statement, there are two
other methods for specifying the type of conversion to take place:
If the environment variable FORT_CONVERT<unit> (where <unit> is the I/O unit
number to convert) is specified to either of the accepted conversion types (Native or Little
Endian), that I/O unit will undergo conversion as if the CONVERT parameter was passed
to each OPEN statement referring to that I/O unit. Many different environment variables
may be required to convert every different I/O unit in a program.
There is a global FORT_CONVERT environment variable without an I/O unit number,
which may be used to refer to all of the I/O units in a program.
Specifying a binary conversion
There are three ways to specify what file/unit should be converted, and which conversion to
apply (in priority, with highest priority listed first):
Environment variable: “FORT_CONVERT<unit_num>”
Environment variable: “FORT_CONVERT”—all I/O units
Argument to OPEN: “CONVERT=”