10.07.2015 Views

PGI Fortran Reference manual - The Portland Group

PGI Fortran Reference manual - The Portland Group

PGI Fortran Reference manual - The Portland Group

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.

Input and Outputvalue may correspond to two real list entities or vice versa. If the input list item is of typeCHARACTER, its length must be the same as that of the character value‣ In the event of an error condition, the position of the file is indeterminate.5.5. Formatted Data TransferDuring formatted data transfer, data is edited to conform to a format specification, and the editeddata is transferred between the items specified in the input or output statement’s iolist and thefile; the current record is read or written and, possibly, so are additional records. On input, thefile must be positioned so that the record read is either a formatted record or an endfile record.Formatted data transfer is prohibited if the file is connected for unformatted input/output.For variable length record formatted input, each newline character is interpreted as a recordseparator. On output, the I/O system writes a newline at the end of each record. If a programwrites a newline itself, the single record containing the newline will appear as two records whenread or backspaced over. <strong>The</strong> maximum allowed length of a record in a variable length recordformatted file is 2000 characters.5.5.1. Implied DO List Input Output ListAn implied DO list takes the form(iolist,do-var=var1,var2,var3)where the items in iolist are either items permissible in an input/output list or another impliedDO list. <strong>The</strong> value do-var is an INTEGER, REAL or DOUBLE PRECISION variable and var1,var2 and var3 are arithmetic expressions of type INTEGER, REAL or DOUBLE PRECISION.Generally, do-var, var1, var2 and var3 are of type INTEGER. Should iolist occur in an inputstatement, the do-var cannot be used as an item in iolist. If var3 and the preceding comma areomitted, the increment takes the value 1. <strong>The</strong> list items are specified once for each iteration of theDO loop with the DO-variable being substituted as appropriate.In the following example OXO, C(7), C(8) and C(9) are each set to 0.0. TEMP, D(1) and D(2) areset to 10.0.REAL C(6),D(6)DATA OXO,(C(I),I=7,9),TEMP,(D(J),J=1,2)/4*0.0,3*10.0/<strong>The</strong> following two statements have the same effect.READ *,A,B,(R(I),I=1,4),SREAD *,A,B,R(1),R(2),R(3),R(4),S5.5.2. Format SpecificationsFormat requirements may be given either in an explicit FORMAT statement or alternatively, asfields within an input/output statement (as values in character variables, arrays or other characterexpressions within the input/output statement).When a format identifier in a formatted input/output statement is a character array name or othercharacter expression, the leftmost characters must be defined with character data that constitute aformat specification when the statement is executed. A character format specification is enclosedin parentheses. Blanks may precede the left parenthesis. Character data may follow the right-<strong>PGI</strong> <strong>Fortran</strong> <strong>Reference</strong> Guide 74

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

Saved successfully!

Ooh no, something went wrong!