original (Aug2006):   http://people.scs.fsu.edu/~burkardt/html/f90_intrinsics.html
by John Burkardt

F90_INTRINSICS
FORTRAN90 Intrinsic Functions


FORTRAN90 includes about 100 intrinsic functions (and a few intrinsic subroutines). This document gives a short list of the definitions of these intrinsic functions.

Most users are familiar with the simpler arithmetic functions, such as abs, max and sqrt. However, a great many new routines have been added, and in some cases the definitions of the older functions have been extended so that they can accept vectors and arrays as arguments.

The FORTRAN90 intrinsic functions may be broadly divided into groups of

Reference:

  1. Jeanne Adams, Walter Brainerd, Jeanne Martin, Brian Smith, Jerrold Wagener,
    Fortran90 Handbook,
    Complete ANSI/ISO Reference,
    McGraw Hill, 1992,
    ISBN: 0-07-000406-4.
  2. Miles Ellis, Ivor Philips, Thomas Lahey,
    Fortran90 Programming,
    Addison-Wesley, 1994,
    ISBN: 0-201-54446-6,
    LC: QA76.73.F25E435
  3. The F90_INTRINSICS directory contains a sample program for carrying out some simple tests of FORTRAN90 intrinsic functions.

FORTRAN90 Intrinsic Functions List:

result = abs ( a )
returns the absolute value of A.
result = achar ( i )
Returns the character whose ASCII index is I.
result = acos ( x )
returns the arc-cosine or inverse cosine of X.
result = adjustl ( string )
returns a copy of the input string that has been "left justified".
result = adjustr ( string )
returns a copy of the input string that has been "right justified".
result = aimag ( z )
returns the imaginary part of Z.
result = aint ( a, kind )
rounds a real number down (towards zero);
result = all ( mask, dim )
returns TRUE if ALL the conditions are true.
result = allocated ( array )
returns TRUE if an allocatable array is, in fact, currently allocated. You declare an array to be ALLOCATABLE. You then request storage for it with the ALLOCATE command. You free that storage with the DEALLOCATE command. In between the ALLOCATE and DEALLOCATE commands, the array is said to be allocated.
result = anint ( a, kind )
rounds a real number to the nearest integer value;
result = any ( mask, dim )
returns TRUE if ANY of the conditions are true.
result = asin ( x )
returns the arc-sine or inverse sine of X.
result = associated ( pointer, target )
returns the association status of the pointer argument, or indicates that the pointer is associated with the target.
result = atan ( x )
returns the arc-tangent or inverse tangent of X.
result = atan2 ( y, x )
returns the arc-tangent or inverse tangent of Y/X.
result = bit_size ( i )
returns the number of bits associated with the storage of an integer of the kind of the input argument I.
result = btest ( i, pos )
returns the value (0 or 1) of a given bit.
result = ceiling ( a )
Returns the smallest integer greater than or equal to A.
result = char ( i, kind )
Returns the character whose index is I.
result = cmplx ( x, y, kind )
returns a complex value with real part X and imaginary part Y, with the specified KIND.
result = conjg ( z )
returns the conjugate of Z.
result = cos ( x )
returns the cosine of X.
result = cosh ( x )
returns the hyperbolic cosine of X.
result = count ( mask, dim )
counts the number of TRUE elements of MASK in dimension DIM.
result = cshift ( array, shift, dim )
performs a circular shift on an array.
call date_and_time ( date, time zone, values )
returns date and time information.
result = dble ( a )
converts the value to the equivalent double precision value.
result = digits ( x )
returns the number of significant digits in numbers of the type and kind of X.
result = dim ( x, y )
returns max ( x - y, 0 );
result = dot_product ( a, b )
returns the dot product of vectors A and B.
result = dprod ( x, y )
returns the double precision product of two real values;
result = eoshift ( array, shift, boundary, dim )
performs an "end off" shift on an array.
result = epsilon ( x )
returns the "machine precision" for numbers of the same type as X.
result = exp ( x )
returns the exponential function of X, that is, exp ( X ).
result = exponent ( x )
returns the exponent part of the number.
result = floor ( a )
Returns the largest integer less than or equal to A.
result = fraction ( x )
returns the fractional part of the model representation of X.
result = huge ( x )
returns the largest number in the model.
result = iachar ( c )
returns an integer representing the ASCII index of character C.
result = iand ( i, j )
returns the "and" of I and J.
result = ibclr ( i, pos )
sets one bit to zero.
result = ibits ( i, pos, len )
extracts a sequence of bits.
result = ibset ( i, pos )
sets one bit to one.
result = ichar ( c )
returns an integer representing the index of character C.
result = ieor ( i, j )
returns the "exclusive or" of I and J.
result = index ( S1, S2, BACK )
returns the index of the beginning of a substring in a string.
result = int ( a, kind )
converts to an integer value.
result = ior ( i, j )
returns the "inclusive or" of I and J.
result = ishft ( i, shift )
performs a logical shift.
result = ishftc ( i, shift, size )
performs a circular shift.
result = kind ( x )
returns the value of the KIND argument of X.
result = lbound ( a, dim )
returns the lower bounds of an array.
result = len ( string )
returns the "declared" length of STRING.
result = len_trim ( string )
returns the "used" length of STRING, up to the last nonblank character.
result = lge ( string_a, string_b )
returns TRUE if STRING_A is lexically greater than or equal to STRING_B. If the strings are of unequal length, the comparison is made as though the shorter string was padded with blanks at the end.
result = lgt ( string_a, string_b )
returns TRUE if STRING_A is lexically greater than STRING_B. If the strings are of unequal length, the comparison is made as though the shorter string was padded with blanks at the end.
result = lle ( string_a, string_b )
returns TRUE if STRING_A is lexically less than or equal to STRING_B. If the strings are of unequal length, the comparison is made as though the shorter string was padded with blanks at the end.
result = llt ( string_a, string_b )
returns TRUE if STRING_A is lexically less than STRING_B. If the strings are of unequal length, the comparison is made as though the shorter string was padded with blanks at the end.
result = log ( x )
returns the (natural) logarithm of X.
result = log10 ( x )
returns the base 10 logarithm of X.
result = logical ( l, kind )
converts a logical value to a particular logical kind.
result = matmul ( a, b )
returns the product of matrix a and matrix b.
result = max ( a1, a2, a3, ... )
returns the maximum of A1, A2, A3...
result = maxexponent ( X )
returns the maximum exponent in the model for numbers of the same type and kind as X;
result = maxloc ( array, mask )
returns the index of the maximum entry in the array.
result = maxval ( array, dim, mask )
returns the maximum entry in the array.
result = merge ( tsource, fsource, mask )
chooses one value or the other depending on a mask.
result = min ( a1, a2, a3, ... )
returns the minimum of A1, A2, A3, ...
result = minexponent ( x )
returns the minimum exponent in the model for numbers of the same type and kind as X;
result = minloc ( array, mask )
returns the index of the minimum entry in the array.
result = minval ( array, dim, mask )
returns the minimum entry in the array.
result = mod ( a, p )
returns the remainder after division.
result = modulo ( a, p )
returns the remainder after division.
call mvbits ( from, frompos, len, to, topos )
copies a sequence of bits from one location to another.
result = nearest ( x, s )
returns the nearest distinct machine representable number in the given direction.
result = nint ( a, kind )
returns the integer value nearest to A.
result = not ( i )
returns the logical complement of the input argument.
result = pack ( array, mask, vector )
packs an array into a vector under control of a mask.
result = precision ( x )
returns the decimal precision of real numbers of the same kind as X.
result = present ( a )
is TRUE if an optional argument is present.
result = product ( array, dim, mask )
computes the product of the elements of ARRAY along dimension DIM, for true elements of MASK.
result = radix ( x )
returns the base of the model representing numbers of the type and kind of X.
call random_number ( harvest )
returns uniformly distributed pseudorandom numbers.
call random_seed ( size, put, get )
can get the size of the random seed, get its value, or reset its value.
result = range ( x )
returns the decimal exponent range for model numbers of the same kind and type as X.
result = real ( a, kind )
converts a value to a real value of the given kind.
result = repeat ( string, ncopy )
concatenates several copies of a string.
result = reshape ( source, shape, pad, order )
rearranges a vector or array to form an array of the given shape.
result = rrspacing ( x )
returns the reciprocal of the relative spacing of model numbers near the argument value X.
result = scale ( x, i )
returns X*RADIX**I, where RADIX is the base of real arithmetic.
result = scan ( string, set, back )
scans a string for the occurrence of one of the characters in a set.
  • STRING is the character string to be searched.
  • SET is a character string, each of whose characters is assumed to be one of the set to be searched for.
  • BACK is an optional argument; if it is present, then the search is carried out starting with the last character of STRING and decreasing, rather than with the first.
  • RESULT is the index in STRING of the first (or last) occurrence of an element of SET, or 0 if no element was found.
  • result = selected_int_kind ( r )
    returns a value for the KIND parameter of the integer type that represents all integers from -10**R to 10**R.
    result = selected_real_kind ( p, r )
    returns a value for the KIND parameger for the real type that represents reals with at least P digits of precision and a decimal exponent range of R.
    result = set_exponent ( x, i )
    constructs a number with the fractional part of X and the exponent I.
    result = shape ( source )
    returns the shape of an array.
    result = sign ( a, b )
    transfers the sign of B to the magnitude of A.
    result = sin ( x )
    returns the sine of X.
    result = sinh ( x )
    returns the hyperbolic sine of X.
    result = size ( array, dim )
    returns the number of elements in an array.
    result = spacing ( x )
    returns the absolute spacing of model numbers near the argument value X.
    result = spread ( source, dim, copies )
    replicates an array by adding a dimension.
    result = sqrt ( x )
    returns the square root of X.
    result = sum ( array, dim, mask )
    computes the sum of the elements of ARRAY along dimension DIM, for true elements of MASK.
    call system_clock ( count, count_rate, count_max )
    returns a reading from the system clock.
    result = tan ( x )
    returns the tangent of X.
    result = tanh ( x )
    returns the hyperbolic tangent of X.
    result = tiny ( x )
    returns the smallest number in the model.
    result = transfer ( source, mold, size )
    returns a result that has the same physical representation of source but interpreted with the type of MOLD.
    result = transpose ( matrix )
    returns the transpose of MATRIX.
    result = trim ( string )
    returns a copy of STRING up to the last nonblank character.
    result = ubound ( a, dim )
    returns the upper bounds of an array.
    result = unpack ( vector, mask, field )
    unpacks a vector into an array.
    result = verify ( string, set, back )
    verifies that a string contains only characters from a given set, or else returns the location of the first character of string that is not in the set.

    You can return to the HTML web page.


    Last revised on 02 August 2006.