Intel® Fortran Compiler 16.0 User and Reference Guide

Forms for Data Edit Descriptors

A data edit descriptor takes one of the following forms:

[r]c

[r]cw

[r]cw.m

[r]cw.d

[r]cw.d[Ee]

r

Is a repeat specification. The range of r is 1 through 2147483647 (2**31-1). If r is omitted, it is assumed to be 1.

c

Is one of the following format codes: I, B, O, Z, F, E, EN, ES, D, G, L, or A.

w

Is the total number of digits in the field (the field width). If omitted, the system applies default values (see Default Widths for Data Edit Descriptors). The range of w is 1 through 2147483647 (2**31-1) on Intel® 64 architecture; 1 through 32767 (2**15-1) on IA-32 architecture. For I, B, O, Z, and F, the range can start at zero.

m

Is the minimum number of digits that must be in the field (including leading zeros). The range of m is 0 through 32767 (2**15-1) on Intel® 64 architecture; 0 through 255 (2**8-1) on IA-32 architecture.

d

Is the number of digits to the right of the decimal point (the significant digits). The range of d is 0 through 32767 (2**15-1) on Intel® 64 architecture; 0 through 255 (2**8-1) on IA-32 architecture.

The number of significant digits is affected if a scale factor is specified for the data edit descriptor.

E

Identifies an exponent field.

e

Is the number of digits in the exponent. The range of e is 1 through 32767 (2**15-1) on Intel® 64 architecture; 1 through 255 (2**8-1) on IA-32 architecture.

Description

Standard Fortran allows the field width to be omitted only for the A descriptor. However, Intel® Fortran allows the field width to be omitted for any data edit descriptor.

The r, w, m, d, and e must all be positive, unsigned, integer literal constants; or variable format expressions -- no kind parameter can be specified. They must not be named constants.

Actual useful ranges for r, w, m, d, and e may be constrained by record sizes (RECL) and the file system.

The data edit descriptors have the following specific forms:

Integer:

Iw[.m], Bw[.m], Ow[.m], and Zw[.m]

Real and complex:

Fw.d, Ew.d[Ee], ENw.d[Ee], ESw.d[Ee], Dw.d, and Gw.d[Ee]

Logical:

Lw

Character:

A[w]

The d must be specified with F, E, D, and G field descriptors even if d is zero. The decimal point is also required. You must specify both w and d, or omit them both.

A repeat specification can simplify formatting. For example, the following two statements are equivalent:

20  FORMAT (E12.4,E12.4,E12.4,I5,I5,I5,I5)

20  FORMAT (3E12.4,4I5)

Examples

 !  This WRITE outputs three integers, each in a five-space field
 !  and four reals in pairs of F7.2 and F5.2 values.
       INTEGER(2) int1, int2, int3
       REAL(4) r1, r2, r3, r4
       DATA int1, int2, int3 /143, 62, 999/
       DATA r1, r2, r3, r4 /2458.32, 43.78, 664.55, 73.8/
       WRITE (*,9000) int1, int2, int3, r1, r2, r3, r4
 9000  FORMAT (3I5, 2(1X, F7.2, 1X, F5.2))

The following output is produced from the above code:

  143  62  999 2458.32 43.78  664.55 73.80

See Also