be repeated: print "(10i8)", (/ (i(j), j=1,200) /) writes 10 integers, each occupying 8 character positions, on each of 20 lines (repeating the format specification advances to the next line). Data edit descriptors Control edit descriptors Control edit descriptors setting conditions: Control edit descriptors for immediate processing: Unformatted I/O This type of I/O should be used only in cases where the records are generated by a program on one computer, to be read back on the same computer or another computer using the same internal number representations: open(unit=4, file='test', form='unformatted') read(unit=4) q write(unit=nout, iostat=ios) a ! no fmt= Direct-access files This form of I/O is also known as random access or indexed I/O. Here, all the records have the same length, and each record is identified by an index number. It is possible to write, read, or re-write any specified record without regard to position. integer, parameter :: nunit=2, length=100 real, dimension(length) :: a real, dimension(length+1:2*length) :: b integer :: i, rec_length : inquire (iolength=rec_length) a open (unit=nunit, access="direct", recl=rec_length, status="scratch", action="readwrite") : ! Write array b to direct-access file in record 14 write (unit=nunit, rec=14) b : ! ! Read the array back into array a read (unit=nunit, rec=14) a : do i = 1, length/2 a(i) = i end do ! ! Replace modified record write (unit=nunit, rec=14) a The file must be an external file and list-directed formatting and non-advancing I/O are unavailable. Operations on external files Once again, this is an overview only. File positioning statements The open statement The statement is used to connect an external file to a unit, create a file that is preconnected, or create a file and connect it to a unit. The syntax is open (unit=u, status=st, action=act [,olist]) where olist is a list of optional specifiers. The specifiers may appear in any order. open (unit=2, iostat=ios, file="cities", status="new", access="direct", & action="readwrite", recl=100) Other specifiers are form and position. The close statement This is used to disconnect a file from a unit. close (unit=u [,iostat=ios] [,status=st]) as in close (unit=2, iostat=ios, status="delete") The inquire statement At any time during the execution of a program it is possible to inquire about the status and attributes of a file using this statement. Using a variant of this statement, it is similarly possible to determine the status of a unit, for instance whether the unit number exists for that system. Another variant permits