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 OutputFurther suppose that you use the following statement to read in the list from the input file:READ * I, J, X, Y, Z, A, C, K<strong>The</strong> variables are assigned the following values by the list-directed input/output mechanism:I=10 J=-14 X=25.2 Y=-76.0Z=313.0 A=-1.5 C=29 K=125In the example the value for A does not change because the input record is null.Input isterminated with the / so no input is read for K, so the program assumes null and K retains itsprevious value.5.7.2. List-directed outputList directed input/output is an abbreviated form of formatted input/output that does not requirethe use of a format specification. Depending on the type of the data item or data items in theiolist, data is transferred to or from the file, using a default, and not necessarily accurate formatspecification. <strong>The</strong> data type of each item appearing in the iolist is formatted according to the rulesin the following table:Table 20 Default List Directed Output FormattingData TypeBYTEINTEGER*2INTEGER*4INTEGER*8LOGICAL*1LOGICAL*2LOGICAL*4LOGICAL*8REAL*4REAL*8COMPLEX*8COMPLEX*16CHAR *nDefault FormattingI5I7I12I24I5 (L2)Note that this format is applied when the option –Munixlogical is selected whencompiling.L2L2L2G15.7e2G25.16e3(G15.7e2, G15.7e2)(G25.16e3, G25.16e3)An<strong>The</strong> length of a record is less than 80 characters; if the output of an item would cause the length toexceed 80 characters, a new record is created.<strong>The</strong> following rules and guidelines apply when using list-directed output:‣ New records may begin as necessary.‣ Logical output constants are T for true and F for false.<strong>PGI</strong> <strong>Fortran</strong> <strong>Reference</strong> Guide 85

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

Saved successfully!

Ooh no, something went wrong!