12.07.2015 Views

PGI Fortran - Servidor WWW del Cluster Ladon-Hidra

PGI Fortran - Servidor WWW del Cluster Ladon-Hidra

PGI Fortran - Servidor WWW del Cluster Ladon-Hidra

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5 Input and Output FormattingInput, output, and format statements provide the means for transferring data to or from files. Datais transferred as records to or from files. A record is a sequence of data which may be values orcharacters and a file is a sequence of such records. A file may be internal, that is, held in memory,or external such as those held on disk. To access an external file a formal connection must bemade between a unit, for example a disk file, and the required file. An external unit must beidentified either by a positive integer expression, the value of which indicates a unit, or by anasterisk (*) which identifies a standard input or output device.This chapter describes the types of input and output available and provides examples of input,output and format statements. There are four types of input/output used to transfer data to or fromfiles: unformatted, formatted, list directed, and namelist.• unformatted data is transferred between the item(s) in the input/output list (iolist) and thecurrent record in the file. Exactly one record may be read or written.• formatted data is edited to conform to a format specification, and the edited data is transferredbetween the item or items in the iolist, and the file. One or more records may be read orwritten. Non-advancing formatted data transfers are a variety of formatted I/O where a portionof a data record is transferred with each input/output statement.• list directed input/output is an abbreviated form of formatted input/output that does not use aformat specification. Depending on the type of the data item or data items in the iolist, data istransferred to or from the file, using a default, and not necessarily accurate formatspecification.• namelist input/output is a special type of formatted data transfer; data is transferred between anamed group (namelist group) of data items and one or more records in a file.5.1 File Access MethodsYou can access files using one of two methods, sequential access, or direct access (randomaccess). The access method is determined by the specifiers supplied when the file is opened usingthe OPEN statement. Sequential access files are accessed one after the other, and are written in theFortran Intrinsics 151

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!