must be associated with a target, and transfer takes place between the file and the targets. An item of derived type is treated as if the components were specified in the same order as in the type declaration, so read "(8f10.5)", p, t ! types point and triangle has the same effect as the statement read "(8f10.5)", p%x, p%y, t%a%x, t%a%y, t%b%x, & t%b%y, t%c%x, t%c%y An object in an I/O list is not permitted to be of a derived type that has a pointer component at any level of component selection. Note that a zero-sized array may occur as an item in an I/O list. Such an item corresponds to no actual data transfer. The format specification may also be given in the form of a character expression: character(len=*), parameter :: form="(f10.3)" : print form, q or as an asterisk this is a type of I/O known as list-directed I/O (see below), in which the format is defined by the computer system: print *, "Square-root of q = ", sqrt(q) Input/output operations are used to transfer data between the storage of an executing program and an external medium, specified by a unit number. However, two I/O statements, print and a variant of read, do not reference any unit number: this is referred to as terminal I/O. Otherwise the form is: read (unit=4, fmt="(f10.3)") q read (unit=nunit, fmt="(f10.3)") q read (unit=4*i+j, fmt="(f10.3)") a where unit= is optional. The value may be any nonnegative integer allowed by the system for this purpose (but 0, 5 and 6 often denote the error, keyboard and terminal, respectively). An asterisk is a variantagain from the keyboard: read (unit=*, fmt="(f10.3)") q A read with a unit specifier allows exception handling: read (unit=nunit, fmt="(3f10.3)", iostat=ios) a,b,c if (ios == 0) then ! Successful read - continue execution. : else ! Error condition - take appropriate action. call error (ios) end if There a second type of formatted output statement, the write statement: write (unit=nout, fmt="(10f10.3)", iostat=ios) a Internal files These allow format conversion between various representations to be carried out by the program in a storage area defined within the program itself. integer, dimension(30) :: ival integer :: key character(len=30) :: buffer character(len=6), dimension(3), parameter :: form=(/ "(30i1)", "(15i2)","(10i3)" /) read (unit=*, fmt="(a30,i1)") buffer, key read (unit=buffer, fmt=form (key)) ival(1:30/key) If an internal file is a scalar, it has a single record whose length is that