02.07.2014 Views

Intel(R) Fortran Language Reference (online version)

Intel(R) Fortran Language Reference (online version)

Intel(R) Fortran Language Reference (online version)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Data Transfer I/O Statements 10<br />

See Also<br />

• “I/O Control List” for details on I/O control-list specifiers<br />

• “I/O Lists” for the general rules for I/O lists<br />

• “Advance Specifier” for details on advancing I/O<br />

Rules for Formatted Sequential WRITE Statements<br />

Formatted, sequential WRITE statements translate data from binary to character form by using<br />

format specifications for editing (if any). The translated data is written to an external file that is<br />

connected for sequential access.<br />

Values can be transferred from objects of intrinsic or derived types. For derived types, values of<br />

intrinsic types are transferred from the components of intrinsic types that ultimately make up these<br />

structured objects.<br />

The output list and format specification must not specify more characters for a record than the<br />

record size. (Record size is specified by RECL in an OPEN statement.)<br />

If the file is connected for unformatted I/O, formatted data transfer is prohibited.<br />

Example<br />

The following example shows formatted, sequential WRITE statements:<br />

WRITE (UNIT=8, FMT='(B)', ADVANCE='NO') C<br />

WRITE (*, &quot;(F6.5)&quot;, ERR=25, IOSTAT=IO_STATUS) A, B, C<br />

Rules for List-Directed Sequential WRITE Statements<br />

List-directed, sequential WRITE statements transfer data from binary to character form by using<br />

the data types of the corresponding I/O list item to determine the form of the data. The translated<br />

data is then written to an external file.<br />

In general, values transferred as output have the same forms as values transferred as input.<br />

Table 10-1 shows the default output formats for each intrinsic data type.<br />

Table 10-1 Default Formats for List-Directed Output<br />

Data Type<br />

Output Format<br />

BYTE<br />

I5<br />

LOGICAL(1)<br />

L2<br />

LOGICAL(2)<br />

L2<br />

LOGICAL(4)<br />

L2<br />

LOGICAL(8)<br />

L2<br />

10-31

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!