9.2.1 Categories of Intrinsic Functions

Generic intrinsic functions can be divided into categories, as shown in Table 9-2.

Table 9-2 Categories of Intrinsic Functions

Category  Subcategory  Description 
Numeric  Computation  Elemental functions that perform type conversions or simple numeric operations: ABS, AIMAG, AINT, AMAX0, AMIN0, ANINT, CEILING, CMPLX, CONJG, DBLE, DCMPLX, DFLOAT, DIM, DPROD, DREAL, FLOAT, FLOOR, IFIX, IMAG, INT, MAX, MAX1, MIN, MIN1, MOD, MODULO, NINT, QCMPLX, QEXT, QFLOAT, QREAL, RAN, REAL, SIGN, SNGL, ZEXT 
  Manipulation 1  Elemental functions that return values related to the components of the model values associated with the actual value of the argument: EXPONENT, FRACTION, NEAREST, RRSPACING, SCALE, SET_EXPONENT, SPACING 
  Inquiry 1  Functions that return scalar values from the models associated with the type and kind parameters of their arguments 2: DIGITS, EPSILON, HUGE, ILEN, MAXEXPONENT, MINEXPONENT, PRECISION, RADIX, RANGE, SIZEOF, TINY 
  Transformational  Functions that perform vector and matrix multiplication: DOT_PRODUCT, MATMUL 
  System  Functions that return information about a process or processor: PROCESSORS_SHAPE, NWORKERS, NUMBER_OF_PROCESSORS, SECNDS 
Kind type    Functions that return kind type parameters: KIND, SELECTED_INT_KIND, SELECTED_REAL_KIND 
Mathematical    Functions that perform mathematical operations: ACOS, ACOSD, ASIN, ASIND, ATAN, ATAND, ATAN2, ATAN2D, COS, COSD, COSH, COTAN, COTAND, EXP, LOG, LOG10, SIN, SIND, SINH, SQRT, TAN, TAND, TANH 
Bit  Manipulation  Elemental functions that perform single-bit processing, and logical and shift operations; and allow bit subfields to be referenced: AND, BTEST, IAND, IBCHNG, IBCLR, IBITS, IBSET, IEOR, IOR, ISHA, ISHC, ISHFT, ISHFTC, ISHL, LSHIFT, NOT, OR, RSHIFT, XOR 
  Inquiry  Function that lets you determine parameter s (the bit size) in the bit model 3: BIT_SIZE 
  Representation  Functions that return information on bit representation of integers: LEADZ, POPCNT, POPPAR, TRAILZ 
Character  Comparison  Elemental functions that make a lexical comparison of the character-string arguments and return a default logical result: LGE, LGT, LLE, LLT 
  Conversion  Elemental functions that take character arguments and return integer, ASCII, or character values 4: ACHAR, CHAR, IACHAR, ICHAR 
  String handling  Functions that perform operations on character strings, return lengths of arguments, and search for certain arguments: ADJUSTL, ADJUSTR, INDEX, LEN_TRIM, REPEAT, SCAN, TRIM, VERIFY 
  Inquiry  Function that returns length of argument: LEN 
Array  Construction  Functions that construct new arrays from the elements of existing array: MERGE, PACK, SPREAD, UNPACK 
  Inquiry  Functions that let you determine if an array argument is allocated, and return the size or shape of an array, and the lower and upper bounds of subscripts along each dimension: ALLOCATED, LBOUND, SHAPE, SIZE, UBOUND 
  Location  Transformational functions that find the geometric locations of the maximum and minimum values of an array: MAXLOC, MINLOC 
  Manipulation  Transformational functions that shift an array, transpose an array, or change the shape of an array: CSHIFT, EOSHIFT, RESHAPE, TRANSPOSE 
  Reduction  Transformational functions that perform operations on arrays. The functions "reduce" elements of a whole array to produce a scalar result, or they can be applied to a specific dimension of an array to produce a result array with a rank reduced by one: ALL, ANY, COUNT, MAXVAL, MINVAL, PRODUCT 
Miscellaneous    Functions that do the following:

  • Let you use assembler instructions in an executable program (ASM)

  • Check for pointer association (ASSOCIATED)

  • Check for end-of-file (EOF)

  • Return the class of a floating-point argument (FP_CLASS)

  • Test for Not-a-Number values (ISNAN)

  • Count actual arguments passed to a routine (IARGCOUNT)

  • Return a pointer to an actual argument list for a routine (IARGPTR)

  • Return the INTEGER KIND that will hold an address (INT_PTR_KIND)

  • Return the internal address of a storage item (LOC)

  • Return a logical value of an argument (LOGICAL)

  • Allocate memory (MALLOC)

  • Return the upper 64 bits of a 128-bit unsigned result (MULT_HIGH)

  • Return a disassociated pointer (NULL)

  • Check for argument presence (PRESENT)

  • Convert a bit pattern (TRANSFER)
 
1 All of the numeric manipulation, and many of the numeric inquiry functions are defined by the model sets for integers (Section D.1) and reals (Section D.2).
2 The value of the argument does not have to be defined.
3 For more information on bit functions, see Section 9.2.3.
4 The Compaq Fortran processor character set is ASCII, so ACHAR = CHAR and IACHAR = ICHAR.

Table 9-3 summarizes the generic intrinsic functions and indicates whether they are elemental, inquiry, or transformational functions, if applicable. Optional arguments are shown within square brackets.

Table 9-3 Summary of Generic Intrinsic Functions

Generic Function  Class [Key] Value Returned 
ABS (A)  The absolute value of an argument 
ACHAR (I)  The character in the specified position of the ASCII character set 
ACOS (X)  The arc cosine (in radians) of the argument 
ACOSD (X)  The arc cosine (in degrees) of the argument 
ADJUSTL (STRING)  The specified string with leading blanks removed and placed at the end of the string 
ADJUSTR (STRING)  The specified string with trailing blanks removed and placed at the beginning of the string 
AIMAG (Z)  The imaginary part of a complex argument 
AINT (A [, KIND])  A real value truncated to a whole number 
ALL (MASK [, DIM])  .TRUE. if all elements of the masked array are true 
ALLOCATED (ARRAY)  The allocation status of the argument array 
AMAX0 (A1, A2 [, A3,...])  The maximum value in a list of integers (returned as a real value) 
AMIN0 (A1, A2 [, A3,...])  The minimum value in a list of integers (returned as a real value) 
AND (I, J)  See IAND 
ANINT (A [, KIND])  A real value rounded to a whole number 
ANY (MASK [, DIM])  .TRUE. if any elements of the masked array are true 
ASIN (X)  The arc sine (in radians) of the argument 
ASIND (X)  The arc sine (in degrees) of the argument 
ASM (STRING [, A,...) 1  A value stored in the appropriate register by the user 
ASSOCIATED (POINTER [, TARGET])  .TRUE. if the pointer argument is associated or the pointer is associated with the specified target 
ATAN (X)  The arc tangent (in radians) of the argument 
ATAND (X)  The arc tangent (in degrees) of the argument 
ATAN2 (Y, X)  The inverse arc tangent (in radians) of the arguments 
ATAN2D (Y, X)  The inverse arc tangent (in degrees) of the arguments 
BIT_SIZE (I)  Returns the number of bits (s) in the bit model 
BTEST (I, POS)  .TRUE. if the specified position of argument I is one 
CEILING (A [, KIND])  The smallest integer greater than or equal to the argument value 
CHAR (I [, KIND])  The character in the specified position of the processor character set 
CMPLX (X [,Y] [,KIND])  The corresponding complex value of the argument 
CONJG (Z)  The conjugate of a complex number 
COS (X)  The cosine of the argument, which is in radians 
COSD (X)  The cosine of the argument, which is in degrees 
COSH (X)  The hyperbolic cosine of the argument 
COTAN (X)  The cotangent of the argument, which is in radians 
COTAND (X)  The cotangent of the argument, which is in degrees 
COUNT (MASK [, DIM] [, KIND] The number of .TRUE. elements in the argument array 
CSHIFT (ARRAY, SHIFT [, DIM])  An array that has the elements of the argument array circularly shifted 
DBLE (A)  The corresponding double precision value of the argument 
DCMPLX (X, Y)  The corresponding double complex value of the argument 
DFLOAT (A)  The corresponding double precision value of the integer argument 
DIGITS (X)  The number of significant digits in the model for the argument 
DIM (X, Y)  The positive difference between the two arguments  
DOT_PRODUCT (VECTOR_A, VECTOR_B)  The dot product of two rank-one arrays (also called a vector multiply function) 
EOF (A)  .TRUE. or .FALSE. depending on whether a file is beyond the end-of-file record 
EOSHIFT (ARRAY, SHIFT [,BOUNDARY] [,DIM])  An array that has the elements of the argument array end-off shifted 
EPSILON (X)  The number that is almost negligible when compared to one 
EXP (X)  The exponential value for the argument 
EXPONENT (X)  The value of the exponent part of a real argument 
FLOAT (X)  The corresponding real value of the integer argument 
FLOOR (A [, KIND])  The largest integer less than or equal to the argument value 
FP_CLASS (X)  The class of the IEEE floating-point argument 
FRACTION (X)  The fractional part of a real argument 
HUGE (X)  The largest number in the model for the argument 
IACHAR (C)  The position of the specified character in the ASCII character set 
IAND (I, J)  The logical AND of the two arguments 
IBCLR (I, POS)  The specified position of argument I cleared (set to zero) 
IBCHNG (I, POS)  The reversed value of a specified bit 
IBITS (I, POS, LEN)  The specified substring of bits of argument I 
IBSET (I, POS)  The specified bit in argument I set to one 
ICHAR (C)  The position of the specified character in the processor character set 
IEOR (I, J)  The logical exclusive OR of the corresponding bit arguments 
IFIX (X)  The corresponding integer value of the real argument rounded as if it were an implied conversion in an assignment 
ILEN (I)  The length (in bits) in the two's complement representation of an integer 
IMAG (Z)  See AIMAG 
INDEX (STRING, SUBSTRING [, BACK] [, KIND] The position of the specified substring in a character expression 
INT (A [, KIND])  The corresponding integer value (truncated) of the argument 
IOR (I, J)  The logical inclusive OR of the corresponding bit arguments 
ISHA (I, SHIFT)  Argument I shifted left or right by a specified number of bits 
ISHC (I, SHIFT)  Argument I rotated left or right by a specified number of bits 
ISHFT (I, SHIFT)  The logical end-off shift of the bits in argument I 
ISHFTC (I, SHIFT [,SIZE])  The logical circular shift of the bits in argument I 
ISHL (I, SHIFT)  Argument I logically shifted left or right by a specified number of bits 
ISNAN (X)  Tests for Not-a-Number (NaN) values 
KIND (X)   The kind type parameter of the argument 
LBOUND (ARRAY [, DIM] [, KIND] The lower bounds of an array (or one of its dimensions) 
LEADZ (I)  The number of leading zero bits in an integer 
LEN (STRING [, KIND] The length (number of characters) of the argument character string 
LEN_TRIM (STRING [, KIND] The length of the specified string without trailing blanks 
LGE (STRING_A, STRING_B)  A logical value determined by a > or = comparison of the arguments 
LGT (STRING_A, STRING_B)  A logical value determined by a > comparison of the arguments 
LLE (STRING_A, STRING_B)  A logical value determined by a < or = comparison of the arguments 
LLT (STRING_A, STRING_B)  A logical value determined by a < comparison of the arguments 
LOC (A)  The internal address of the argument. 
LOG (X)  The natural logarithm of the argument 
LOG10 (X)  The common logarithm (base 10) of the argument 
LOGICAL (L [, KIND])   The logical value of the argument converted to a logical of type KIND 
LSHIFT (I, POSITIVE_SHIFT)  See ISHFT 
MATMUL (MATRIX_A, MATRIX_B)  The result of matrix multiplication (also called a matrix multiply function) 
MAX (A1, A2 [, A3,...])  The maximum value in the set of arguments 
MAX1 (A1, A2 [, A3,...])  The maximum value in the set of real arguments (returned as an integer) 
MAXEXPONENT (X)  The maximum exponent in the model for the argument 
MAXLOC (ARRAY [, DIM] [, MASK] [, KIND] The rank-one array that has the location of the maximum element in the argument array 
MAXVAL (ARRAY [, DIM] [, MASK])  The maximum value of the elements in the argument array 
MERGE (TSOURCE, FSOURCE, MASK)   An array that is the combination of two conformable arrays (under a mask) 
MIN (A1, A2 [, A3,...])  The minimum value in the set of arguments 
MIN1 (A1, A2 [, A3,...])  The minimum value in the set of real arguments (returned as an integer) 
MINEXPONENT (X)  The minimum exponent in the model for the argument 
MINLOC (ARRAY [, DIM] [, MASK] [, KIND] The rank-one array that has the location of the minimum element in the argument array 
MINVAL (ARRAY [, DIM] [, MASK])  The minimum value of the elements in the argument array 
MOD (A, P)  The remainder of the arguments (has the sign of the first argument) 
MODULO (A, P)  The modulo of the arguments (has the sign of the second argument) 
NEAREST (X, S)  The nearest different machine-representable number in a given direction 
NINT (A [, KIND])  A real value rounded to the nearest integer 
NOT (I)  The logical complement of the argument 
NULL ([MOLD])  A disassociated pointer 
OR (I, J)  See IOR 
PACK (ARRAY, MASK [, VECTOR])  A packed array of rank one (under a mask) 
POPCNT (I)  The number of 1 bits in an integer 
POPPAR (I)  The parity of an integer 
PRECISION (X)  The decimal precision (real or complex) of the argument 
PRESENT (A)   .TRUE. if an actual argument has been provided for an optional dummy argument 
PRODUCT (ARRAY [, DIM] [, MASK])  The product of the elements of the argument array 
QCMPLX (X, Y) 2  The corresponding COMPLEX(16) value of the argument  
QEXT (A) 2  The corresponding REAL(16) precision value of the argument  
QFLOAT (A) 2  The corresponding REAL(16) precision value of the integer argument.  
QREAL (A) 2  The corresponding REAL(16) value of the real part of a COMPLEX(16) argument  
RADIX (X)  The base of the model for the argument 
RANGE (X)  The decimal exponent range of the model for the argument 
REAL (A [, KIND])  The corresponding real value of the argument 
REPEAT (STRING, NCOPIES)   The concatenation of zero or more copies of the specified string 
RESHAPE (SOURCE, SHAPE [, PAD] [, ORDER])  An array that has a different shape than the argument array, but the same elements 
RRSPACING (X)  The reciprocal of the relative spacing near the argument 
RSHIFT (I, NEGATIVE_SHIFT)  See ISHFT 
SCALE (X, I)  The value of the exponent part (of the model for the argument) changed by a specified value 
SCAN (STRING, SET [, BACK] [, KIND] The position of the specified character (or set of characters) within a string 
SELECTED_INT_KIND (R)  The integer kind parameter of the argument 
SELECTED_REAL_KIND ([P] [, R])  The real kind parameter of the argument; one of the optional arguments must be specified 
SET_EXPONENT (X, I)  The value of the exponent part (of the model for the argument) set to a specified value 
SHAPE (SOURCE [,KIND] The shape (rank and extents) of an array or scalar 
SIGN (A, B)  A value with the sign transferred from its second argument 
SIN (X)  The sine of the argument, which is in radians 
SIND (X)  The sine of the argument, which is in degrees 
SINH (X)  The hyperbolic sine of the argument 
SIZE (ARRAY [, DIM] [, KIND] The size (total number of elements) of the argument array (or one of its dimensions) 
SNGL (X)  The corresponding real value of the argument 
SPACING (X)  The value of the absolute spacing of model numbers near the argument 
SPREAD (SOURCE, DIM, NCOPIES)   A replicated array that has an added dimension 
SQRT (X)  The square root of the argument 
SUM (ARRAY [, DIM] [, MASK])  The sum of the elements of the argument array 
TAN (X)  The tangent of the argument, which is in radians 
TAND (X)  The tangent of the argument, which is in degrees 
TANH (X)  The hyperbolic tangent of the argument 
TINY (X)  The smallest positive number in the model for the argument 
TRAILZ (I)  The number of trailing zero bits in an integer 
TRANSFER (SOURCE, MOLD [, SIZE])   The bit pattern of SOURCE converted to the type and kind parameters of MOLD 
TRANSPOSE (MATRIX)  The matrix transpose for the rank-two argument array 
TRIM (STRING)   The argument with trailing blanks removed 
UBOUND (ARRAY [, DIM] [, KIND] The upper bounds of an array (or one of its dimensions) 
UNPACK (VECTOR, MASK, FIELD)   An array (under a mask) unpacked from a rank-one array 
VERIFY (STRING, SET [, BACK] [, KIND] The position of the first character in a string that does not appear in the given set of characters 
XOR (I, J)  See IEOR 
ZEXT (X [, KIND])  A zero-extended value of the argument 
1 Alpha only
2 VMS, U*X
Key to Classes
E-Elemental
I-Inquiry
T-Transformational
N-Nonelemental

Table 9-4 lists specific functions that have no generic function associated with them.

Table 9-4 Specific Functions with No Generic Association

Generic Function  Class Value Returned 
DPROD (X, Y)  The double-precision product of two real arguments 
DREAL (A)  The corresponding double-precision value of the double-complex argument
MALLOC (I)  The starting address for the block of memory allocated 
MULT_HIGH (I, J) 1  The upper (leftmost) 64 bits of the 128-bit unsigned result 
NUMBER_OF_PROCESSORS ( )  The total number of processors (peers) available to the program 
NWORKERS ( ) 2  The number of executing processes 
PROCESSORS_SHAPE ( )  The shape of an implementation-dependent hardware processor array 
RAN (I)  The next number from a sequence of pseudorandom numbers (uniformly distributed in the range 0 to 1) 
SECNDS (X)  The system time of day (or elapsed time) as a floating-point value in seconds 
SIZEOF (X)  The bytes of storage used by the argument 
1 Alpha only
2 Included for compatibility with older versions of Compaq Fortran 77.
Key to Classes
E-Elemental
I-Inquiry
N-Nonelemental


Previous Page Next Page Table of Contents