The little-endian-to-big-endian conversion feature is intended for Fortran unformatted input/output operations. It enables the development and processing of the files with big-endian data organization on the IA-32-based processors, which usually process the data in the little endian format.
It also enables processing of the files developed on processors that accept big-endian data format and producing the files for such processors on IA-32-based little-endian systems.
The little-endian-to-big-endian conversion is accomplished by the following operations:
The WRITE operation converts little endian format to big endian format.
The READ operation converts big endian format to little endian format.
The feature enables the conversion of base data types and arrays (or array subscripts) of basic data types. Derived data types are not supported.
In order to use the little-endian-to-big-endian conversion feature, specify the numbers of the units to be used for conversion purposes by setting the F_UFMTENDIAN environment variable. Then, the READ/WRITE statements, which use these unit numbers, will perform relevant conversions. Other READ/WRITE statements will work in the usual way.
The variable has the following syntax:
F_UFMTENDIAN=u[,u] . . .
Command lines for variable setting with different shells:
Sh: export F_UFMTENDIAN=u[,u] . . .
Csh: setenv F_UFMTENDIAN u[,u] . . .
See error messages that may be issued during the little endian – big endian conversion. They are all fatal. You should contact Intel if such errors occur.
Assume you set F_UFMTENDIAN=10,100 and run the following program.
integer*4 cc4 |
Now compare lit.tmp and big.tmp files with the help of od utility.
> od -t x4 lit.tmp
0000000 00000008 00000315 00000000 00000008
0000020 00000004 000001c8 00000004
0000034
> od -t x4 big.tmp
0000000 08000000 00000000 15030000 08000000
0000020 04000000 c8010000 04000000
0000034
You can see that the byte order is different in these files.