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...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Input and Output5.7. List-directed formattingList-directed formatting is an abbreviated form of input/output that does not require the use of aformat specification. <strong>The</strong> type of the data determines how a value is read/written. On output, it isnot always accurate enough for certain ranges of values. <strong>The</strong> characters in a list-directed recordconstitute a sequence of values which cannot contain embedded blanks except those permittedwithin a character string.To use list-directed input/output formatting, specify a * for the list of format requirements, asillustrated in the following example that uses list-directed output:READ( 1, * ) VAL1, VAL25.7.1. List-directed input<strong>The</strong> form of the value being input must be acceptable for the type of item in the iolist. Blanksmust not be used as zeros nor be embedded in constants except in a character constant or within atype complex form contained in parentheses.Table 19 List Directed Input ValuesInput List TypeIntegerRealDouble precisionComplexLogicalCharacterFormA numeric input field.A numeric input field suitable for F editing with no fractional part unless a decimal point is used.Same as for real.An ordered pair of numbers contained within parentheses as shown: (real part, imaginary part).A logical field without any slashes or commas.A non-empty character string within apostrophes. A character constant can be continued on asmany records as required. Blanks, slashes and commas can be used.A null value has no effect on the definition status of the corresponding iolist item. A null valuecannot represent just one part of a complex constant but may represent the entire complexconstant. A slash encountered as a value separator stops the execution of that input statement afterthe assignment of the previous value. If there are further items in the list, they are treated as ifthey are null values.Commas may be used to separate the input values. If there are consecutive commas, or if the firstnon-blank character of a record is a comma, the input value is a null value. Input values may alsobe repeated.In the following example of list-directed formatting, assume that A and K are defined as followsand all other variables are undefined.A= -1.5K= 125Suppose that you have an input file the contains the following record, where the / terminates theinput and consecutive commas indicate a null:10,-14,25.2,-76,313,,29/<strong>PGI</strong> <strong>Fortran</strong> <strong>Reference</strong> Guide 84

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

Saved successfully!

Ooh no, something went wrong!