intro_intrin

Date:

09-12-2012

NAME

INTRO_INTRIN - Introduction to intrinsic procedures

IMPLEMENTATION

Cray Linux Environment (CLE)

DESCRIPTION

Intrinsic procedures are procedures that are defined by the computer programming language.

Fortran

The Cray Fortran Compiler supports intrinsics described in the Fortran 2008 standard, and other intrinsics as extensions to the standards.

There are seven classes of Fortran intrinsic procedures as defined by the Fortran standard: inquiry functions, elemental functions, transformational functions, elemental subroutines, pure subroutines, atomic subroutines, and (impure) subroutines. The standard also describes processor dependent support for IEEE arithmetic intrinsics. For more information about Fortran 2008 intrinsics that support IEEE arithmetic, see the intro_ieee(3i) man page.

Intrinsics that support compiler extensions include atomic memory operations. See amo(3i).

Evaluation of Intrinsics

The Cray Fortran Compiler evaluates intrinsic procedures in line or by calling external code. Most Fortran 2008 intrinsics are evaluated in line. The following intrinsics are not evaluated in line - ACOS, ACOSH, ADJUSTL, ADJUSTR, ALLOCATED, ASINH, ASSOCIATED, ATAN, ATAN2, ATANH, all BESSEL intrinsics, COMMAND_ARGUMENT_COUNT, COS, COSH, CPU_TIME, DATE_AND_TIME, EOSHIFT, ERF, ERFC, ERFC_SCALED, EXECUTE_COMMAND_LINE, EXTENDS_TYPE_OF, FINDLOC, GAMMA, GET_COMMAND, GET_COMMAND_ARGUMENT, GET_ENVIRONMENT_VARIABLE,HYPOT, IACHAR, IALL, IANY, IMAGE_INDEX, INDEX, IPARITY, IS_CONTIGUOUS, IS_IOSTAT_END, IS_IOSTAT_EOR, LEN_TRIM,LOG_GAMMA, LOG10, MOVE_ALLOC, NORM2, NULL, PACK, PARITY, RANDOM_NUMBER,RANDOM_SEED, REPEAT, RESHAPE, SAME_TYPE_AS, SCAN, SIN, SINH, SIZE, SQRT, STORAGE_SIZE, TAN, TANH, TRIM, UNPACK, VERIFY

NOTES

Mathematical Intrinsics

Many mathematical intrinsic procedures have both generic and specific forms. For example, ALOG, DLOG,CLOG, and CDLOG are specific logarithmic functions that indicate a data type. LOG is generic. Generic function names cause the compiler to compile automatically the appropriate data type version of a routine, based on the type of the input data. For example, a call to the generic function LOG with a type of input data of complex compiles as CLOG. Use the generic function name.

The math routines can be divided into the following general categories:

  • General arithmetic functions. Functions have variations for real, double precision, and complex values. Base values raised to a power and 64-bit integer division are called implicitly from Fortran.

  • Exponential and logarithmic functions. Functions have variations for real, double precision, and complex values. Base values raised to a power and 64-bit integer division are called implicitly from Fortran.

  • Trigonometric functions. The trigonometric functions are based on the ANSI standard for Fortran, except for the cotangent functions (COT or COTAN), which are extensions.

  • Type conversion functions. Type conversion functions change the type of an argument.

  • Arguments and results are of the same type, unless indicated otherwise.

  • Special functions. The special functions provide Fortran access to a number of Standard C functions.

  • Extended-precision routines. The extended-precision routines perform 128-bit arithmetic.

  • Boolean functions. The Boolean functions perform logical operations and bit manipulations. All Boolean functions are extensions. These functions cannot be passed as arguments with Cray Fortran on any system.

In the math routine descriptions, complex arguments are represented as follows:

x = xr + ixi

The real part of the complex number is xr.

The imaginary part of the complex number is xi.

Definitions for Precision

The Fortran intrinsic procedure man pages use these terms for the precision of default REAL and COMPLEX data types:

                    REAL and COMPLEX Precision
------------------------------------------------------------------
                                  -sdefault64,     -sdefault64,
                 -sdefault32      -dp              -ep
------------------------------------------------------------------
Real, Int,       32 bits          64 bits          64 bits
Logical          (KIND=4)         (KIND=8)         (KIND=8)
Double           64 bits          64 bits          128 bits
                 (KIND=8)         (KIND=8)         (KIND=16)
Complex          64 bits          128 bits         128 bits
                 (KIND=8)         (KIND=16)        (KIND=16)
Double Complex,  128 bits         128 bits         128 bits
Quad Real        (KIND=16)        (KIND=16)        (KIND=16)
------------------------------------------------------------------

SEE ALSO

intro_ieee(3i)

intro_quad_precision(3i)

Cray C and C++ Reference Manual

Cray Fortran Reference Manual