Intel® Fortran Compiler 16.0 User and Reference Guide
List-directed, sequential WRITE statements transfer data from binary to character form by using the data types of the corresponding I/O list item to determine the form of the data. The translated data is then written to an external file.
In general, values transferred as output have the same forms as values transferred as input. However, there is no guarantee that a REAL internal value transferred as output and then transferred as input as a REAL value will be the same internal value.
The following table shows the default output formats for each intrinsic data type:
By default, character constants are not delimited by apostrophes or quotation marks, and each internal apostrophe or quotation mark is represented externally by one apostrophe or quotation mark.
This behavior can be changed by the DELIM specifier (in an OPEN statement) as follows:
If the file is opened with the DELIM='QUOTE' specifier, character constants are delimited by quotation marks and each internal quotation mark is represented externally by two consecutive quotation marks.
If the file is opened with the DELIM='APOSTROPHE' specifier, character constants are delimited by apostrophes and each internal apostrophe is represented externally by two consecutive apostrophes.
Each output statement writes one or more complete records.
A literal character constant or complex constant can be longer than an entire record. For complex constants, the end of the record can occur between the comma and the imaginary part, if the imaginary part and closing right parenthesis cannot fit in the current record. For literal constants that are longer than an entire record, the constant is continued onto as many records as necessary.
Each output record begins with a blank character for carriage control.
Slashes, octal values, null values, and repeated forms of values are not output.
If the file is connected for unformatted I/O, list-directed data transfer is prohibited.
Suppose the following statements are specified:
DIMENSION A(4) DATA A/4*3.4/ WRITE (1,*) 'ARRAY VALUES FOLLOW' WRITE (1,*) A,4
The following records are then written to external unit 1:
ARRAY VALUES FOLLOW 3.400000 3.400000 3.400000 3.400000 4
The following shows another example:
INTEGER i, j REAL a, b LOGICAL on, off CHARACTER(20) c DATA i /123456/, j /500/, a /28.22/, b /.0015555/ DATA on /.TRUE./, off/.FALSE./ DATA c /'Here''s a string'/ WRITE (*, *) i, j WRITE (*, *) a, b, on, off WRITE (*, *) c END
The preceding example produces the following output:
123456 500 28.22000 1.555500E-03 T F Here's a string