FORTRAN 77 Language Reference

Output Format

List-directed output provides a quick and easy way to print output without fussing with format details. If you need exact formats, use formatted I/O. A suitable format is chosen for each item, and where a conflict exists between complete accuracy and simple output form, the simple form is chosen.

Note these rules for list-directed output:

Also note:

Example: List-directed I/O and backslash-n, with and without -xl:


demo% cat f77 bslash.f
	CHARACTER S*8 / '12\n3' / 
	PRINT *, S 
	END
demo%

Without -xl, \n prints as a carriage return:


demo% f77 -silent bslash.f 
demo% a.out 
12 
3 
demo%

With -xl, \n prints as a character string:


demo% f77 -xl -silent bslash.f 
demo% a.out 
12\n3
demo%

Table 5-8 Default Formats for List-Directed Output

Type  

Format  

BYTE

CHARACTER*n

COMPLEX

COMPLEX*16

COMPLEX*32

INTEGER*2

INTEGER*4

INTEGER*8

LOGICAL*1

LOGICAL*2

LOGICAL*4

LOGICAL*8

REAL

REAL*8

REAL*16

Two blanks followed by the number

An {n = length of character expression}

'¤¤(', 1PE14.5E2, ',', 1PE14.5E2, ')'

'¤¤(', 1PE22.13.E2, ',', 1PE22.13.E2, ')'

'¤¤(', 1PE44.34E3, ',', 1PE44.34E3, ')'

Two blanks followed by the number

Two blanks followed by the number

Two blanks followed by the number

Two blanks followed by the number

L3

L3

L3

1PE14.5E2

1PE22.13.E2

1PE44.34E4

COMPLEX*32 and REAL*16 are SPARC only.