Intel® Fortran Compiler 18.0 Developer Guide and Reference
The CONVERT specifier indicates a nonnative numeric format for unformatted data. It takes the following form:
CONVERT = fm
fm |
Is a scalar default character expression that evaluates to one of the following values:
|
You can use CONVERT to specify multiple formats in a single program, usually one format for each specified unit number.
When reading a nonnative format, the nonnative format on disk is converted to native format in memory. If a converted nonnative value is outside the range of the native data type, a run-time message appears.
There are other ways to specify numeric format for unformatted files: you can specify an environment variable, compiler option convert, or OPTIONS/CONVERT. The following shows the order of precedence:
Method Used |
Precedence |
---|---|
An environment variable |
Highest |
OPEN (CONVERT=) |
. |
OPTIONS/CONVERT |
. |
The convert compiler option |
Lowest |
Compiler option convert and OPTIONS/CONVERT affect all unit numbers used by the program, while environment variables and OPEN (CONVERT=) affect specific unit numbers.
The following example shows how to code the OPEN statement to read unformatted CRAY* numeric data from unit 15, which might be processed and possibly written in native little endian format to unit 20:
OPEN (CONVERT='CRAY', FILE='graph3.dat', FORM='UNFORMATTED', 1 UNIT=15) ... OPEN (FILE='graph3_native.dat', FORM='UNFORMATTED', UNIT=20)