Data transfer

Formatted I/O

Conversion of numbers from internal to external representation and vice versa.

print fmt, list

I/O lists

Quantities to be read or written: variables for input, expressions for output.

Format definition

List directed I/O

Format is defined by the computer at the moment the statement is executed.

print *, "Fahrenheit temperature", tf, "F"
    print 100, u, p
100 format(f3.1, tr2, f9.4)

Edit descriptors

Data edit descriptors

Iw (width w)

Iw.m (width w, minimum m)

For all numeric edit descriptors, if the output field is too narrow to contain the number to be output, it is filled with asterisks.

Fw.d (total width w, digits after decimal point d)

Values are rounded

Ew.d

Decimal exponent

Ew.dEe (digits of exponent e)

ENw.d

Engineering. Decimal exponent divisible by 3.

ESw.d

Scientific

Two edit descriptors as for real values

Lw (width w)

T or F on output, right-justified.

A or Aw (width w)

Control edit descriptors

Tn, TLn, TRn

Tabulation, absolute, relative left, right

nX

Places n spaces in an output record. Equivalent to TRn.

n/

Starts new records (new lines).

Repeat counts

Data edit descriptors may be preceded by a repeat count.

print "(2f9.4)", u, p

A repeat count may be applied to a group of edit descriptors, enclosed in parentheses.

print "(2(tr2, f9.4))", u, p