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.

<strong>Fortran</strong> Data Typesto this rule is that an operation involving a COMPLEX*8 element and a REAL*8 elementproduces a COMPLEX*16 result. In this operation, the COMPLEX*8 element is converted toa COMPLEX*16 element, which consists of two REAL*8 elements, before the operation isperformed.In most cases, a logical expression will have a LOGICAL*4 result. In cases where the hardwaresupports LOGICAL*8 and if the expression is LOGICAL*8, the result may be LOGICAL*8.2.2. ConstantsA constant is an unchanging value that can be determined at compile time. It takes a formcorresponding to one of the data types. <strong>The</strong> <strong>PGI</strong> <strong>Fortran</strong> compilers support decimal (INTEGERand REAL), unsigned binary, octal, hexadecimal, character and Hollerith constants.<strong>The</strong> use of character constants in a numeric context, for example, in the right-hand side of anarithmetic assignment statement, is supported. <strong>The</strong>se constants assume a data type that conformsto the context in which they appear.2.2.1. Integer Constants<strong>The</strong> form of a decimal integer constant is:[s]d1d2...dn [ _ kind-parameter ]where s is an optional sign and di is a digit in the range 0 to 9. <strong>The</strong> optional _kind@parameteris a <strong>Fortran</strong> 90/95/2003 feature supported by PGFORTRAN, and specifies a supported kind. <strong>The</strong>value of an integer constant must be within the range for the specified kind.<strong>The</strong> value of an integer constant must be within the range -2147483648 (-2 31 ) to 2147483647(2 31 - 1) inclusive. Integer constants assume a data type of INTEGER*4 and have a 32-bit storagerequirement.<strong>The</strong> –i8 compilation option causes all data of type INTEGER to be promoted to an 8 byteINTEGER. <strong>The</strong> –i8 option does not override an explicit data type extension size specifier, suchas INTEGER*4. <strong>The</strong> range, data type and storage requirement change if the –i8 flag is specified,although this flag is not supported on all x86 targets. With the –i8 flag, the range for integerconstants is -2 63 to (2 63 - 1)), and in this case the value of an integer constant must be withinthe range -9223372036854775808 to 9223372036854775807. If the constant does not fit in anINTEGER*4 range, the data type is INTEGER*8 and the storage requirement is 64 bits.Here are several examples of integer constants:+2-36437-36_SHORT369_I22.2.2. Binary, Octal and Hexadecimal Constants<strong>The</strong> <strong>PGI</strong> compilers and <strong>Fortran</strong> 90/95/2003 support various types of constants in addition todecimal constants. <strong>Fortran</strong> allows unsigned binary, octal, or hexadecimal constants in DATAstatements. <strong>PGI</strong> compilers support these constants in DATA statements, and additionally, support<strong>PGI</strong> <strong>Fortran</strong> <strong>Reference</strong> Guide 19

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

Saved successfully!

Ooh no, something went wrong!