FORTRAN 77 Language Reference

Defaults for w, d, and e

You can write field descriptors A, D, E, F, G, I, L, O, or Z without the w, d, or e field indicators. @ If these are left unspecified, the appropriate defaults are used based on the data type of the I/O list element. See Table 5-3.

Typical format field descriptor forms that use w, d, or e include:

Aw, Iw, Lw, Ow, Zw, Dw.d, Ew.d, Gw.d, Ew.dEe, Gw.dEe

Example: With the default w=7 for INTEGER*2, and since 161 decimal = A1 hex:


	INTEGER*2 M 
	M = 161 
	WRITE ( *, 8 ) M 
8	FORMAT ( Z ) 
	END

This example produces the following output:


demo% f77 def1.f 
def1.f: 
 MAIN: 
demo% a.out
¤¤¤¤¤a1
demo%

The defaults for w, d, and e are summarized in the following table.

Table 5-3 Default w, d, e Values in Format Field Descriptors

Field Descriptor 

List Element 

w

d

e

I,O,Z

BYTE

7

-

-

I,O,Z

INTEGER*2, LOGICAL*2

7

-

-

I,O,Z

INTEGER*4, LOGICAL*4

12

-

-

O,Z

REAL*4

12

-

-

O,Z

REAL*8

23

-

-

O,Z

REAL*16, COMPLEX*32

44

-

-

L

LOGICAL

2

-

-

F,E,D,G

REAL, COMPLEX*8

15

7

2

F,E,D,G

REAL*8, COMPLEX*16

25

16

2

F,E,D,G

REAL*16, COMPLEX*32

42

33

3

A

LOGICAL*1

1

-

-

A

LOGICAL*2, INTEGER*2

2

-

-

A

LOGICAL*4, INTEGER*4

4

-

-

A

REAL*4, COMPLEX*8

4

-

-

A

REAL*8, COMPLEX*16

8

-

-

A

REAL*16, COMPLEX*32

16

-

-

A

CHARACTER*n

n

-

-

For complex items, the value for w is for each real component. The default for the A descriptor with character data is the declared length of the corresponding I/O list element. REAL*16 and COMPLEX*32 are SPARC only.