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.5.2.1 A Format Control – Character DataThe A specifier transfers characters. The A can optionally be followed by a field width w. When wis not specified, the width is determined by the size of the data item.On output, if l is the length of the character item and w is the field width, then the following rulesapply:• If w > l, w – l blanks before the character.• If w < l, leftmost w characters.On input, if l is the length of the character I/O item and w is the field width, then the followingrules apply:Appendix AAppendix BIf w > l, rightmost l characters from the input filed.If w < l, leftmost w characters from the input filed and followed by l – w blanks.You can also use the A format specifier to process data types other than CHARACTER. For typesother than CHARACTER, the number of characters supplied for input/output will equal the size inbytes of the data allocated to the data type. For example, an INTEGER*4 value is represented with4 characters and a LOGICAL*2 is represented with 2 characters.The following shows a simple example that reads two CHARACTER arrays from the file data.src:CHARACTER STR1*8, STR2*12OPEN(2, FILE='data.src')READ(2, 10) STR1, STR210 FORMAT ( A8, A12 )5.5.2.2 B Format Control – Binary DataThe B field descriptor transfers binary values and can be used with any integer data type. The editdescriptor has the form:Bw[.m]where w specifies the field width and m indicates minimum field width on output.On input, the external field to be input must contain (unsigned) binary characters only (0 or 1). Anall blank field is treated as a value of zero. If the value of the external field exceeds the range ofthe corresponding list element, an error occurs.Fortran Intrinsics 159

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

Saved successfully!

Ooh no, something went wrong!