Skip to content. Skip to navigation

ICTP Portal

Sections
You are here: Home Manuals on-line PGI Compiler pghpf_ref PGHPF Workstation Reference Manual - A Fortran 90 Intrinsics
Personal tools
Document Actions

PGHPF Workstation Reference Manual - A Fortran 90 Intrinsics

<< << " border=0> >> > " border=0> Title Contents Index Home Help

A Fortran 90 Intrinsics


This appendix lists the Fortran 90 intrinsics and subroutines. Table A.1 lists all the Fortran 90 intrinsics. A more complete description of each supported intrinsic follows Table A.1. Refer to Appendix B for details on the intrinsics defined in the HPF Language Specification.

Table A.1 Supported Fortran 90 Intrinsics

Intrinsic

Class
Type



ABS
Elemental
Numeric
ACHAR
Elemental
Transfer
ACOS
Elemental
Numeric
ADJUSTL
Elemental
Character
ADJUSTR
Elemental
Character
AIMAG
Elemental
Transfer
AINT
Elemental
Transfer
ALL
Transformational
Array Reduction
ALLOCATED
Inquiry
Array Inquiry
ANINT
Elemental
Transfer
ANY
Transformational
Array Reduction
ASIN
Elemental
Numeric
ASSOCIATED
Inquiry
Pointer Association
ATAN
Elemental
Numeric
ATAN2
Elemental
Numeric
BIT_SIZE
Inquiry
Bit Inquiry
BTEST
Elemental
Bit Computation
CEILING
Elemental
Numeric
CHAR
Elemental
Transfer
CMPLX
Elemental
Transfer
CONJG
Elemental
Transfer
COS
Elemental
Numeric
COSH
Elemental
Numeric
COUNT
Transformational
Array Reduction
CSHIFT
Transformational
Array Manipulation
DATE_AND_TIME
Subroutine
Subroutine
DBLE
Elemental
Transfer
DIGITS
Inquiry
Numeric Inquiry
DIM
Elemental
Numeric
DOT_PRODUCT
Elemental
Numeric
DPROD
Elemental
Numeric
EOSHIFT
Transformational
Array Manipulation
EPSILON
Inquiry
Numeric Inquiry
EXP
Elemental
Numeric
EXPONENT
Elemental
Numeric Inquiry
FLOOR
Elemental
Numeric
FRACTION
Elemental
Numeric Inquiry
HUGE
Inquiry
Numeric Inquiry
IACHAR
Elemental
Transfer
IAND
Elemental
Bit Computation
IBCLR
Elemental
Bit Computation
IBITS
Elemental
Transfer
IBSET
Elemental
Bit Computation
ICHAR
Elemental
Transfer
IEOR
Elemental
Bit Computation
INDEX
Elemental
Character
INT
Elemental
Transfer
IOR
Elemental
Bit Computation
ISHFT
Elemental
Bit Computation
ISHFTC
Elemental
Bit Computation
KIND
Inquiry
Kind
LBOUND
Inquiry
Array inquiry
LEN
Inquiry
Char inquiry
LEN_TRIM
Elemental
Character
LGE
Elemental
Character
LGT
Elemental
Character
LLE
Elemental
Character
LLT
Elemental
Character
LOG
Elemental
Numeric
LOG10
Elemental
Numeric
LOGICAL
Elemental
Transfer
MATMUL
Transformational
Array
MAX
Elemental
Numeric
MAXEXPONENT
Inquiry
Inquiry
MAXLOC
Transformational
Array Location
MAXVAL
Transformational
Reduction
MERGE
Elemental
Construction
MIN
Elemental
Numeric
MINEXPONENT
Inquiry
Inquiry
MINLOC
Transformational
Array Location
MINVAL
Transformational
Reduction
MOD
Elemental
Numeric
MODULO
Elemental
Numeric
MVBITS
Subroutine
Subroutine
NEAREST
Elemental
Inquiry
NINT
Elemental
Transfer
NOT
Elemental
Bit Computation
PACK
Transformational
Construction
PRECISION
Inquiry
Inquiry
PRESENT
Inquiry
Argument
PRODUCT
Transformational
Array Reduction
RADIX
Inquiry
Inquiry
RANDOM_NUMBER
Subroutine
Subroutine
RANDOM_SEED
Subroutine
Subroutine
RANGE
Inquiry
Inquiry
REAL
Elemental
Transfer
REPEAT
Transformational
Character
RESHAPE
Transformational
Array Reshape
RRSPACING
Elemental
Inquiry
SCALE
Elemental
Inquiry
SCAN
Elemental
Character
SELECTED_INT_KIND
Transformational
Kind
SELECTED_REAL_KIND
Transformational
Kind
SET_EXPONENT
Elemental
Inquiry
SHAPE
Inquiry
Array inquiry
SIGN
Elemental
Numeric
SIN
Elemental
Numeric
SINH
Elemental
Numeric
SIZE
Inquiry
Array inquiry
SPACING
Elemental
Inquiry
SPREAD
Transformational
Array construction
SQRT
Elemental
Numeric
SUM
Transformational
Array Reduction
SYSTEM_CLOCK
Subroutine
Subroutine
TAN
Elemental
Numeric
TANH
Elemental
Numeric
TINY
Inquiry
Inquiry
TRANSFER
Transformational
Transfer
TRANSPOSE
Transformational
Array manipulation
TRIM
Transformational
Character
UBOUND
Inquiry
Array inquiry
UNPACK
Transformational
Array construction
VERIFY
Elemental
Character

Fortran 90 Intrinsics


ABS

Determine the absolute value of the supplied argument.

Synopsis

ABS(A)

Argument

The argument A must be of type integer, real, or complex.

Return Value

The return type for integer is integer, for real is real, and for complex is real.


ACHAR

Return the character in the specified ASCII collating position.

Synopsis

ACHAR(I)

Argument

The argument I must be of type integer.

Return Value

A single character.


ACOS

Return the arccosine.

Synopsis

ACOS(X)

Arguments

The argument X must be a real value.

Return Value

The real value representing the arccosine in radians.


ADJUSTL

Adjust string to the left, removing all leading blanks and inserting trailing blanks.

Synopsis

ADJUSTL(STR)

Arguments

The argument STR is the string to be adjusted.

Return Value

String of same length and kind as the argument, but with leading blanks at end.


ADJUSTR

Adjust string to the right, removing all trailing blanks and inserting leading blanks.

Synopsis

ADJUSTR(STR)

Arguments

The argument STR is the string to be adjusted.

Return Value

String of same length and kind as the argument, but with trailing blanks at head.


AIMAG

Determine the value of the imaginary part of a complex number.

Synopsis

AIMAG(Z)

Arguments

The argument Z must be complex.

Return Value

A real value representing the imaginary part of the supplied argument.


AINT

Truncate the supplied value to a whole number.

Synopsis

AINT(A, KIND)

Arguments

The argument A is of type real. The optional KIND argument is an integer kind.

Return Value

A real value that is equal to the largest integer that is not greater than the supplied argument. If the KIND argument is present, the result is of that kind.


ALL

Determine if all the values in the supplied argument are logical true.

Synopsis

ALL(MASK, DIM)

Arguments

The argument MASK is an array of type LOGICAL. The optional argument DIM specifies the dimension of the array MASK to check.

Return Value

If no DIM argument is present, the return value is a logical scalar that is true only if all values of MASK are true.

If the DIM argument is present and if MASK has rank one, then the return value is the same as ALL(MASK).

If the DIM argument is present and MASK has rank greater than one, then the return value is an array that has rank n-1, where n is the rank of MASK. The return value is defined recursively as the value of ALL for each extent of the dimension DIM (refer to The Fortran 90 Handbook for a more detailed explanation).


ALLOCATED

Determine if the supplied allocatable array is currently allocated.

Synopsis

ALLOCATED(ARRAY)

Argument

The argument ARRAY is an allocatable array.

Return Value

Returns a logical scalar indicating whether the array is allocatable.


ANINT

Return the nearest whole number to the supplied argument.

Synopsis

ANINT(A, KIND)

Arguments

The argument A is a real number. The optional argument KIND is an kind parameter.

Return Value

The result is a real. The value is AINT(A+0.5) if A is > 0 and AINT(A-0.5) if A is < 0. If KIND is present, the result is of type KIND.


ANY

Determine if any value in the supplied argument MASK is true.

Synopsis

ANY(MASK, DIM)

Arguments

The argument MASK is an array of type LOGICAL. The optional argument DIM specifies the dimension of the array MASK to check.

Return Value

If no DIM argument is present, the return value is a logical scalar that is true if any value MASK is true.

If the DIM argument is present and if MASK has rank one, then the return value is the same as ANY(MASK).

If the DIM argument is present and MASK has rank greater than one, then the return value is an array that has rank n-1, where n is the rank of MASK. The return value is defined recursively as the value of ANY for each extent of the dimension DIM (refer to The Fortran 90 Handbook for a more detailed explanation)


ASIN

Return the arcsine of the specified value.

Synopsis

ASIN(X)

Argument

The argument X must be of type real and have absolute value <= 1.

Return Value

A real value in radians of the same KIND as the argument.


ASSOCIATED

Determines the association status of the supplied argument or determines if the supplied pointer is associated with the supplied target.

Synopsis

ASSOCIATED(POINTER, TARGET)

Arguments

The POINTER argument is a pointer of any type. The optional argument TARGET is a pointer or a target. If it is a pointer it must not be undefined.

Return Value

If TARGET is not supplied the function returns logical true if POINTER is associated with a target and false otherwise.

If TARGET is present and is a target, then the function returns true if POINTER is associated with TARGET and false otherwise.

If TARGET is present and is a pointer, then the function returns true if POINTER and TARGET are associated with the same target and false otherwise.


ATAN

Return the arctangent of the specified value.

Synopsis

ATAN(X)

Argument

The argument X must be of type real.

Return Value

A real value in radians of the same KIND as the argument.


ATAN2

Return the arctangent of the specified value.

Synopsis

ATAN2(Y, X)

Arguments

The arguments X and Y must be of type real.

Return Value

A real number representing radians that is the principal value of the nonzero complex number (X,Y).


BIT_SIZE

Return the number of bits, the precision, of the integer argument. This function uses the standard Fortran 90 bit model defined in, The Fortran 90 Handbook.

Synopsis

BIT_SIZE(I)

Argument

The argument I must be of type integer.

Return Value

Returns an integer.


BTEST

Tests the binary value of a bit in a specified position of an integer argument. This function uses the standard Fortran 90 bit model defined in The Fortran 90 Handbook.

Synopsis

BTEST(I, POS)

Arguments

The argument I must be of type integer. The argument POS must be an integer with a value less than or equal to the value BIT_SIZE(I).

Return Value

Returns a logical value representing whether the bit in position POS is true or false (0 or 1).


CEILING

Return the least integer greater than or equal to the supplied real argument.

Synopsis

CEILING(A)

Argument

The argument A is a real value.

Return Value

The return value is an integer.


CHAR

Returns the character in the specified collating sequence.

Synopsis

CHAR(I, KIND)

Arguments

The argument I is of type integer, specifying the character position to return. The argument KIND is optional.

Return Value

A character.


CMPLX

Convert the supplied argument to a complex.

Synopsis

CMPLX(X, Y, KIND)

Arguments

The argument X is of type integer, real, or complex. The optional argument Y is of type integer, real, or complex. If X is complex, Y must not be present. The optional argument KIND is the kind for the return value (an integer).

Return Value

Returns a complex number with the value specified by the arguments, converted to a real part and a complex part. If the KIND parameter is not supplied, the KIND is the same as the KIND for the default real.


CONJG

Return the conjugate of the supplied complex number.

Synopsis

CONJG(Z)

Argument

The argument Z is a complex number.

Return Value

The return value is the same type and kind as Z.


COS

Return the cosine of the specified value.

Synopsis

COS(X)

Argument

The argument X must be of type real or complex.

Return Value

A real value of the same kind as the argument. The return value for a real argument is in radians, or if complex, the real part is a value in radians.


COSH

Return the hyperbolic cosine of the specified value.

Synopsis

COSH(X)

Argument

The argument X must be of type real.

Return Value

A real value.


COUNT

Return the number of true elements in the supplied logical argument (array), along the specified dimension if the optional argument is present.

Synopsis

COUNT(MASK, DIM)

Arguments

The argument MASK is an array of type LOGICAL. The optional argument DIM specifies the dimension of the array MASK to count.

Return Value

If no DIM argument is present, the return value is an integer that is the count of true values in MASK.

If the DIM argument is present and if MASK has rank one, then the return value is the same as COUNT(MASK).

If the DIM argument is present and MASK has rank greater than one, then the return value is an array that has rank n-1, where n is the rank of MASK. The return value is defined recursively as the value of COUNT for each extent of the dimension DIM (refer to The Fortran 90 Handbook for a more detailed explanation).


CSHIFT

Perform a circular shift on the specified array.

Synopsis

CSHIFT(ARRAY, SHIFT, DIM)

Arguments

The argument ARRAY is the array to shift. It may be an array of any type. The argument SHIFT is an integer or an array of integers with rank n-1 where n is the rank of ARRAY. The optional argument DIM is an integer representing the dimension to shift.

Return Value

The shifted array with the same size and shape as the argument ARRAY.


DATE_AND_TIME

This is a subroutine that returns the date and time.

Synopsis

DATE_AND_TIME(DATE, TIME, ZONE, VALUES)

Arguments

All of the arguments are optional. The DATE argument is of type default character. It must be at least 8 characters long. The argument returns the value CCYYMMDD where CC is the century, YY is the year, MM is the month, and DD is the day.

The argument TIME is of type default character. It must be at least 10 characters long. It has the form hhmmss.sss, where hh is the hour, mm is the minute, and ss.sss is the seconds and milliseconds.

The argument ZONE is of type default character. It must be at least 5 characters long. It has the form +- hhmm where hh and mm are the hours and minutes that the local time zone differs from universal time (UTC).

The argument VALUES must be an array of type default integer. It has the following 8 values:

VALUES(1)
holds the year.
VALUES(2)
holds the month
VALUES(3)
holds the day of the month
VALUES(4)
holds the time difference with respect to UTC
VALUES(5)
holds the hour of the day
VALUES(6)
holds the minutes of the hour
VALUES(7)
holds the seconds in the minute
VALUES(8)
holds the milliseconds of the second, in the range 0 to 999

Return Value

This is a subroutine - the values are returned in the arguments.


DBLE

Convert to double precision real.

Synopsis

DBLE(A)

Argument

The argument A must be of type integer, real, or complex.

Return Value

If A is double precision real then the return value equals A. If A is of type integer or real, the return value is the value converted to a double precision real. If A is of type complex, the return value is the double precision value, which is the double precision value of the real part of the complex argument.


DIGITS

Returns the number of significant digits in the model representing the argument.

Synopsis

DIGITS(X)

Argument

The argument X is of type integer or real.

Return Value

An integer value representing the number of digits in the model representing the specified kind.


DIM

This intrinsic returns the difference X-Y if the value is positive, otherwise it returns 0.

Synopsis

DIM(X, Y)

Arguments

X must be of type integer or real. Y must be of the same type and kind as X.

Return Value

The result is the same type and kind as X with the value X-Y if X >Y, otherwise zero.


DOT_PRODUCT

Perform a dot product on two vectors (arrays).

Synopsis

DOT_PRODUCT(VECTOR_A, VECTOR_B)

Arguments

VECTOR_A must be an array of rank one of type numeric (integer, real, complex) or logical. VECTOR_B must be numeric if VECTOR_A is numeric, or logical if VECTOR_A is logical. It must have the same rank and size as ARRAY_A.

Return Value

The dot product. For VECTOR_A of integer or real, value is
SUM(VECTOR_A * VECTOR_B). For complex, the value is
SUM( CONJG(VECTOR_A) * VECTOR_B). For logical, the value is
ANY( VECTOR_A .AND. VECTOR_B).


DPROD

Double precision real product.

Synopsis

DPROD(X,Y)

Arguments

Both arguments X and Y must be of type default real.

Return Value

The return value is a double precision real that is the product of X and Y.


EOSHIFT

Perform an end-off shift on the specified array.

Synopsis

EOSHIFT(ARRAY, SHIFT, BOUNDARY, DIM)

Arguments

The argument ARRAY is the array to shift. It may be an array of any type. The argument SHIFT is an integer or an array of integers with rank n-1 where n is the rank of ARRAY. The optional argument BOUNDARY is of the same type as the array, it may be scalar or of rank n-1 where n is the rank of ARRAY. BOUNDARY is the value to fill in the shifted out positions. By default it has the following values for integer, 0, for real, 0.0, for complex, (0.0,0.0), for logical false, for character, the default is blank characters.

The optional argument DIM represents the dimension of ARRAY to shift.

Return Value

The shifted array with the same size and shape as the argument ARRAY.


EPSILON

Return the smallest number representable in the kind of the supplied argument.

Synopsis

EPSILON(X)

Argument

The argument X must be of type real.

Return Value

A very small number in the specified real kind.


EXP

Exponential function.

Synopsis

EXP(X)

Argument

The argument X must be of type real or complex.

Return Value

The value returned is of the same type as the argument. It has the value ex .


EXPONENT

Return the exponent part of a real number.

Synopsis

EXPONENT(X)

Argument

The argument X is a real number.

Return Value

The return value is an integer which has the value of the exponent part of the value of X. If the exponent is zero, the function returns zero. If the exponent is too large to be defined as an integer, the result is undefined.


FLOOR

Return the greatest integer less than or equal to the supplied real argument.

Synopsis

FLOOR(A)

Argument

The argument A is a real value.

Return Value

The return value is an integer.


FRACTION

Return the fractional part of a real number.

Synopsis

FRACTION(X)

Argument

The argument X is a real number.

Return Value

The return value is an integer which has the value of the fractional part of the value of X. If the fraction value is zero, the function returns zero.


HUGE

Return the largest number representable in the kind of the supplied argument.

Synopsis

HUGE(X)

Argument

The argument X must be of type integer or real.

Return Value

A value of the same type as the argument with the maximum value possible.


IACHAR

Returns the position of the character in the ASCII collating sequence.

Synopsis

IACHAR(C)

Argument

The argument C must be of type character.

Return Value

An integer representing the character position.


IAND

Perform a bit-by-bit logical AND on the arguments.

Synopsis

IAND(I,J)

Arguments

The arguments I and J must be of type integer of the same kind.

Return Value

The return value is an integer value representing a bit-by-bit logical AND of the bits in the two integer arguments.


IBCLR

Clears one bit to zero.

Synopsis

IBCLR(I,POS)

Arguments

I is an integer. POS is a nonnegative integer less than BIT_SIZE(I).

Return Value

The return value is of the same type as I with a value that is the same as I except the bit in position POS is set to 0.


IBITS

Extracts a sequence of bits.

Synopsis

IBITS(I, POS, LEN)

Arguments

I is an integer. POS is a nonnegative integer and POS + LEN must be less than or equal to BIT_SIZE(I). LEN is of type integer and is nonnegative.

Return Value

The return value is of the same type as I with value that is the sequence of LEN bits in I beginning at position POS, right-adjusted and with all other bits set to zero.


IBSET

Set one bit to one

Synopsis

IBSET(I, POS)

Arguments

I is an integer. POS is a nonnegative integer less than BIT_SIZE(I).

Return Value

The return value is of the same type as I with a value that is the same as I except the bit in position POS is set to 1.


ICHAR

Returns the position of a character in the character set's collating sequence.

Synopsis

ICHAR(C)

Argument

The argument C must be of type character and length one.

Return Value

An integer representing the character position.


IEOR

Perform a bit-by-bit logical exclusive OR on the arguments.

Synopsis

IEOR(I,J)

Argument

The arguments I and J must be of type integer of the same kind.

Return Value

The return value is an integer value representing a bit-by-bit logical exclusive OR of the bits in the two integer values.


INDEX

Returns the starting position of a substring within a string.

Synopsis

INDEX(STRING, SUBSTRING, BACK)

Arguments

The argument STRING must be of type character string. The argument SUBSTRING must be of type character string with the same kind as STRING. The optional argument BACK must be of type logical.

Return Value

The function returns an integer. If BACK is absent or false, the result is the starting point of the first matching SUBSTRING within STRING. Zero is returned if no match is found. 1 is returned if the SUBSTRING has zero length.

If BACK is present with the value true, the result is the last matching substring in string, or zero if no match is found.


INT

Converts a value to integer type.

Synopsis

INT(A, KIND)

Arguments

The argument A is of type integer, real, or complex. The optional argument KIND must be a scalar integer that is a valid kind for the specified type.

Return Value

The return value is the integer value of the supplied argument. For a real number, if the absolute value of the real is less than 1, the return value is 0. If the absolute value is greater than 1, the result is the largest integer that does not exceed the real value. If argument is a complex number, the return value is the result of applying the real conversion to the real part of the complex number.


IOR

Perform a bit-by-bit logical OR on the arguments.

Synopsis

IOR(I,J)

Argument

The arguments I and J must be of type integer of the same kind.

Return Value

The return value is an integer value representing a bit-by-bit logical OR of the bits in the two integer values.


ISHFT

Perform a logical shift.

Synopsis

ISHFT(I, SHIFT)

Arguments

I is an integer value. SHIFT is an integer. The absolute value of SHIFT must be less than or equal to BIT_SIZE(I).

Return Value

The return value is of the same type and kind as the argument I. It is the value of the argument I logically shifted by SHIFT bits. If the shift is positive, the shift is to the left. If the shift is negative, the shift is to the right. Zeroes are shifted in at the ends and bits shifted out are lost.


ISHFTC

Perform a circular shift of the rightmost bits.

Synopsis

ISHIFTC(I, SHIFT, SIZE)

Arguments

I is an integer value. SHIFT is an integer. The absolute value of SHIFT must be less than or equal to SIZE. SIZE is an optional argument that must not exceed the value BIT_SIZE(I) if it is not present, the function acts as if it were present with the value BIT_SIZE(I).

Return Value

The return value is of the same type and kind as the argument I. It is the value of the argument I logically shifted by SHIFT bits. If the shift is positive, the shift is to the left. If the shift is negative, the shift is to the right. Zeroes are shifted in at the ends and bits shifted out are lost.

The result is the value of the sub-group of SIZE bits shifted by SHIFT positions within the sub-group, all other bits remain the same, and remain in the same position. If the SIZE argument is not present, the circular shift is over the complete group of bits, and all of the bits are shifted by SHIFT positions. If the shift is positive, the shift is to the left. If the shift is negative, the shift is to the right.


KIND

Returns the kind of the supplied argument.

Synopsis

KIND(X)

Argument

The argument X is of any intrinsic type.

Return Value

The result is a scalar integer, representing the kind of X.


LBOUND

Returns the lower bounds of an array, or the lower bound for the specified dimension.

Synopsis

LBOUND(ARRAY, DIM)

Arguments

The argument ARRAY is an array of any type. The optional argument DIM is a scalar that has the value of valid dimension of the array (valid dimensions are between the values 1 and n where n is the rank of the array).

Return Value

The return value is an integer, or an array of rank one and size n, where n is the rank of the argument ARRAY. For the function with a DIM argument, the value is the value of the lower bound in the specified dimension. For the function with no DIM supplied, the return value is an array with all the lower bounds for ARRAY.


LEN

Returns the length of the supplied string.

Synopsis

LEN(STRING)

Argument

The argument STRING is a character string or an array.

Return Value

The return value is an integer that represents the length of the scalar string supplied, or the length of an element of the string supplied as an argument.


LEN_TRIM

Returns the length of the supplied string, minus any trailing blanks.

Synopsis

LEN_TRIM(STRING)

Arguments

The argument STRING is a character string.

Return Value

The return value is an integer that represents the length of the scalar string minus any trailing blanks.


LGE

Test the supplied strings to see if the first string STRING_A is lexically greater than or equal to the second string STRING_B (greater than is follows alphabetically).

Synopsis

LGE(STRING_A, STRING_B)

Argument

The argument STRING_A is of type character (default). The argument STRING_B is of type character (default).

Return Value

The function returns a logical value. If the strings are not of the same length, the shorter string is padded with blanks on the right.


LGT

Test the supplied strings to see if the first string, STRING_A is lexically greater than the second string, STRING_B (greater than is follows alphabetically).

Synopsis

LGT(STRING_A, STRING_B)

Argument

The argument STRING_A is of type character (default). The argument STRING_B is of type character (default).

Return Value

The function returns a logical value. If the strings are not of the same length, the shorter string is padded with blanks on the right.


LLE

Test the supplied strings to see if the first string, STRING_A is lexically less than or equal to the second string, STRING_B (greater than is follows alphabetically).

Synopsis

LLE(STRING_A, STRING_B)

Argument

The argument STRING_A is of type character (default). The argument STRING_B is of type character (default).

Return Value

The function returns a logical value. If the strings are not of the same length, the shorter string is padded with blanks on the right.


LLT

Test the supplied strings to see if the first string, STRING_A is lexically less than the second string, STRING_B (greater than is follows alphabetically).

Synopsis

LLT(STRING_A, STRING_B)

Argument

The argument STRING_A is of type character (default). The argument STRING_B is of type character (default).

Return Value

The function returns a logical value. If the strings are not of the same length, the shorter string is padded with blanks on the right.


LOG

Function returns the natural logarithm.

Synopsis

LOG(X)

Argument

The argument X is of type real or complex. If X is real, it must be greater than 0. If X is complex, it must not be equal to zero.

Return Value

The return value is the natural log (base e) of X.


LOG10

Function returns the common logarithm.

Synopsis

LOG10(X)

Argument

The argument X is of type real and must be greater than 0.

Return Value

The return value is the common log (base 10) of X.


LOGICAL

Convert a value to the specified logical kind.

Synopsis

LOGICAL(L, KIND)

Arguments

The argument L is the logical value to convert. The optional argument KIND specifies the kind to covert to.

Return Value

The return value is a logical. By default, the default logical kind, otherwise the kind specified by the KIND parameter.


MATMUL

Perform a matrix multiply of numeric or logical matrices.

Synopsis

MATMUL(MATRIX_A, MATRIX_B)

Arguments

The argument MATRIX_A must be numeric (integer, real, or complex) or logical, and have a rank of one or two. The argument MATRIX_B must be numeric (integer, real, or complex) or logical, and have a rank of one or two. If MATRIX_A has rank one, then MATRIX_B must have rank 2. If MATRIX_B has rank one, then MATRIX_A must have rank 2. The size of the first dimension of MATRIX_B must equal the size of the last dimension of MATRIX_A.

Return Value

A matrix representing the value of the matrix multiplied arguments. There are three possible result shapes: MATRIX_A(n,m) and MATRIX_B(m,k) gives a result (n,k) matrix. MATRIX_A(m) and MATRIX_B(m,k) gives a result (k), MATRIX_A(n,m) and MATRIX_B(m) gives a result(n).


MAX

Return the maximum value of the supplied arguments.

Synopsis

MAX( A1, A2, A3.....)

Arguments

The arguments A3, A4, .. are optional. The arguments must all have the same kind and they must be integer or real.

Return Value

The return value is the same as the type and kind of the arguments. It has the value of the largest argument.


MAXEXPONENT

Returns the value of the maximum exponent for the type and the kind supplied.

Synopsis

MAXEXPONENT(X)

Argument

The argument X is of type real, it may be a scalar or an array.

Return Value

The return value is an integer. It contains the value of the largest exponent in the specified kind.


MAXLOC

Determine the first position in the array that has the maximum value of the valid (true) values specified by the mask, or for all values.

Synopsis

MAXLOC(ARRAY, MASK)

Arguments

The argument ARRAY must be of type integer or real. It must be an array. The optional argument MASK must be of type logical and must have the same shape as ARRAY.

Return Value

The return value is an integer array of rank 1 and has a size equal to the number of dimensions in ARRAY. The return value is the position of the first element that is the maximum value of the array. If the MASK parameter is present, the return value is the position of the first value that has the maximum value of values in ARRAY, and that also has a true value in the corresponding MASK array.


MAXVAL

Return the maximum value of the elements of the argument array. The test elements may be limited by a dimension argument or by a logical mask argument.

Synopsis

MAXVAL(ARRAY, DIM, MASK)

Arguments

The argument ARRAY must be of type integer or real. It must be an array. The optional argument DIM is a scalar that has the value of valid dimension of the array (valid dimensions are between the values 1 and n where n is the rank of the array). The optional argument MASK must be of type logical and must have the same shape as ARRAY.

Return Value

The return value is a scalar if no DIM argument is present, or has a rank of n-1 and has a shape specified by all of the dimensions except the DIM argument dimension.

The return value is the value of the largest element of the array if no optional parameters are supplied. If only the MASK parameter is supplied with the array, then the return value is the value that is the maximum of the true elements of MASK.

When the DIM argument is supplied, the return value is an array that has a value of MAXVAL applied recursively along the DIM dimensions of the array.


MERGE

This function merges two arguments based on the value of a logical mask.

Synopsis

MERGE(TSOURCE, FSOURCE, MASK)

Arguments

TSOURCE is the source that is merged if the mask is true. FSOURCE is the source that is merged if the mask is false. TSOURCE and FSOURCE must be of the same type and must have the same type parameters (if they are arrays they must be conformable). MASK must be of type logical.

Return Value

The result has the same type and type parameters as the source arrays.


MIN

Return the minimum value of the supplied arguments.

Synopsis

MIN( A1, A2, A3.....)

Arguments

The arguments A3, A4, .. are optional. The arguments must all have the same kind and they must be integer or real.

Return Value

The return value is the same as the type and kind of the arguments. It has the value of the smallest argument.


MINEXPONENT

Returns the value of the minimum exponent for the type and the kind supplied.

Synopsis

MINEXPONENT(X)

Argument

The argument X is of type real, it may be a scalar or an array.

Return Value

The return value is an integer. It contains the value of the smallest exponent in the specified kind.


MINLOC

Determine the first position in the array that has the minimum value of the valid (true) values specified by the mask, or for all values.

Synopsis

MINLOC(ARRAY, MASK)

Arguments

The argument ARRAY must be of type integer or real. It must be an array. The optional argument MASK must be of type logical and must have the same shape as ARRAY.

Return Value

The return value is an integer array of rank 1 and has a size equal to the number of dimensions in ARRAY. The return value is the position of the first element that is the minimum value of the array. If the MASK parameter is present, the return value is the position of the first value that has the minimum value of values in ARRAY, and that also has a true value in the corresponding MASK array.


MINVAL

Return the minimum value of the elements of the argument array. The test elements may be limited by a dimension argument or by a logical mask argument.

Synopsis

MINVAL(ARRAY, DIM, MASK)

Arguments

The argument ARRAY must be of type integer or real. It must be an array. The optional argument DIM is a scalar that has the value of valid dimension of the array (valid dimensions are between the values 1 and n where n is the rank of the array). The optional argument MASK must be of type logical and must have the same shape as ARRAY.

Return Value

The return value is a scalar if no DIM argument is present, or has a rank of n-1 and has a shape specified by all of the dimensions except the DIM argument dimension.

The return value is the value of the largest element of the array if no optional parameters are supplied. If only the MASK parameter is supplied with the array, then the return value is the value that is the minimum of the true elements of MASK.

When the DIM argument is supplied, the return value is an array that has a value of MAXVAL applied recursively along the DIM dimensions of the array.


MOD

Find the remainder.

Synopsis

MOD(A, P)

Arguments

The argument A must be an integer or a real. The argument P must be of the same type and kind as A.

Return Value

The same type as the argument A.


MODULO

Return the modulo value of the arguments.

Synopsis

MODULO(A,P)

Arguments

The argument A must be an integer or a real. The argument P must be of the same type and kind as A.

Return Value

The same type as the argument A.


MVBITS

Copies a bit sequence from a source data object to a destination data object.

Synopsis

MVBITS(FROM, FROMPOS, LEN, TO, TOPOS)

Arguments

The FROM argument is of type integer. The FROMPOS argument is of type integer and nonnegative. The LEN argument is of type integer and nonnegative. The TO argument must be a variable of type integer and may be the same as the FROM argument. The TOPOS argument must be of type integer and nonnegative.

The return value is found in TO starting at TOPOS, LEN bits starting at FROMPOS in FROM are copied to TO. All other bits remain unchanged.

Return Value

This is a subroutine. No value is returned.


NEAREST

Returns the nearest different machine representable number in a given direction.

Synopsis

NEAREST(X, S)

Arguments

The argument X is a real number. The argument S is a real number and not equal to zero.

Return Value

The return value is of the same type as X. It contains the value that is the closest possible representation to X , and not X, in the direction of S (a positive or negative real number).


NINT

Returns the nearest integer to the real argument.

Synopsis

NINT(A, KIND)

Arguments

The argument A must be a real. The optional argument KIND specifies the kind of the result integer.

Return Value

The result is an integer. If A > 0, NINT(A) has the value is INT(A+0.5) if A is less than or equal to 0 NINT(A) has the value INT(A-0.5).


NOT

Perform a bit-by-bit logical complement on the argument.

Synopsis

NOT(I)

Argument

The argument I must be of type integer.

Return Value

The return value is an integer value representing a bit-by-bit logical complement of the bits in the argument.


PACK

Pack an array of any number of dimensions into an array of rank one.

Synopsis

PACK(ARRAY, MASK, VECTOR)

Arguments

The ARRAY argument is an array of any type, to be packed. The MASK argument is of type logical and must be conformable with ARRAY. The optional argument VECTOR argument is of the same type as ARRAY, and must have rank one.

Return Value

The return value is the packed array, limited by the logical values in the array MASK. If VECTOR is present its values are part of the result array only for those elements that have an element order greater than the number of true elements in MASK. For further details, refer to The Fortran 90 Handbook.


PRECISION

Return the precision of the real or complex number of the kind of the argument.

Synopsis

PRECISION(X)

Argument

The argument must be a real or complex number.

Return Value

The return value is an integer representing the precision of the argument.


PRESENT

Determine if an optional argument is present.

Synopsis

PRESENT(A)

Argument

The argument A must be an optional argument in the procedure in which the intrinsic is called.

Return Value

A logical scalar. True if A is present and false otherwise.


PRODUCT

Returns the product of the elements of the supplied array.

Synopsis

PRODUCT(ARRAY, DIM, MASK)

Arguments

The ARRAY argument is an array integer, real or complex type. The optional DIM argument is a valid dimension (valid dimensions are between the values 1 and n where n is the rank of the array). The optional MASK argument is of type logical and conformable with the supplied array.

Return Value

The return value is the product of the elements of the argument array. If the optional DIM argument is present, the product is for the specified dimension. If the optional MASK argument is present, the result is subject to the logical mask supplied.


RADIX

Return the base of the model representing numbers of the type and kind of the argument.

Synopsis

RADIX(X)

Argument

The argument X is of type integer or real.

Return Value

The return value is an integer with the value of the radix (base) of the number system model of the argument.


RANDOM_NUMBER

Returns one pseudorandom number or an array of pseudo-random numbers from the uniform distribution over the range 0 <= x < 1.

Synopsis

RANDOM_NUMBER(HARVEST)

Argument

The argument HARVEST must of type real. It is set to contain the resulting pseudorandom number or array of pseudorandom numbers from the uniform distribution.

Return Value

RANDOM_NUMBER is a subroutine.

Description

The random number used in the 2.0 and newer releases of pghpf generates a 46 bit lagged fibonacci pseudo-random sequence with a short lag of 5 and a long lag of 17. For a given seed, including the default seed, the sequence generated is independent of the platform and number of processors. Due to limitations of some platforms' default integer type, the seed vector is of size 34. Only the least significant 23 bits of each element of the seed array are used, thus a seed array returned or used is portable between platforms. For non-degenerate seed arrays, the period of this generator is (217 - 1) * 245. If all the odd elements of the seed array are even, the period will be shorter.

The best performance on distributed arrays is for block distributions. The higher the order of the first distributed dimension, the better the performance will be.


RANDOM_SEED

Restarts or queries the pseudorandom number generator for RANDOM_NUMBER.

Synopsis

RANDOM_SEED(SIZE, PUT, GET)

Arguments

The arguments SIZE, PUT and GET are optional. There must be one or no arguments. Multiple arguments are not allowed. SIZE is an integer value representing the number of integers that the processor uses to hold the value of the seed. PUT is an integer array of rank one and is used to set the seed. GET is an integer array of rank one and is used to get the value of the seed.

Return Value

RANDOM_SEED is a subroutine.


RANGE

Return the decimal exponent range for the type of number supplied as an argument.

Synopsis

RANGE(X)

Argument

The argument X must be of type integer, real, or complex.

Return Value

The result is an integer.


REAL

Convert the argument to real.

Synopsis

REAL(A, KIND)

Arguments

The argument A must be of type integer, real, or complex. The optional argument KIND specifies the kind of integer to convert to.

Return Value

For an integer or real number, returns a real number. For a complex, returns a real number for the real part of the complex number.


REPEAT

Concatenate copies of a string.

Synopsis

REPEAT(STRING, NCOPIES)

Arguments

The argument STRING must be a scalar of type character. The argument NCOPIES is an integer.

Return Value

The return value is a character string that is NCOPIES times as long as STRING. It is the concatenation of STRING NCOPIES times.


RESHAPE

Reconstructs an array with the specified shape using the elements of the source array.

Synopsis

RESHAPE(SOURCE, SHAPE, PAD, ORDER)

Arguments

The argument SOURCE is an array of any type. The argument shape is of type integer, rank one. It must not have more than 7 elements and no values can be negative. The optional argument PAD must be the same size and type as SOURCE. The optional argument ORDER must be of type integer and must have the same shape as SHAPE.

Return Value

The return value is an array of shape SHAPE, with the same type as SOURCE. Array elements are filled into the new array in array element order.


RRSPACING

Return the reciprocal of the relative spacing of model numbers near the argument value.

Synopsis

RRSPACING(X)

Argument

The argument X is of type real.

Return Value

Returns a value of the same type as X.


SCALE

Return the value X x bi where b is the base of the number system in use for X.

Synopsis

SCALE(X, I)

Arguments

The argument X is of type real. The argument I is an integer.

Return Value

The result is a real value of the same type as the argument X.


SCAN

Search the supplied string for a characters in a set of characters.

Synopsis

SCAN(STRING, SET, BACK)

Arguments

The argument STRING is of type character and is the string to search. The argument SET is of type character and of the same type as STRING. The optional argument BACK is of type logical.

Return Value

The result value is an integer specifying the position of the character from SET, found in STRING. If the optional parameter BACK is present and false, or not present, the value is the position of the first character found. If BACK is present and true, the return value is that of the last character in STRING matching one in SET.


SELECTED_INT_KIND

Returns a value that is a kind parameter that will represent a number in the specified range, where the range is determined by the formula: -10R < n < 10R, where n is an integer.

Synopsis

SELECTED_INT_KIND(R)

Argument

The argument R must be of type integer.

Return Value

The return value is an integer. If the value R is invalid, the return value is -1.


SELECTED_REAL_KIND

Returns a value that is a kind parameter that will represent a number in the specified range, where the range is determined with decimal precision P and a decimal exponent range of at least R.

Synopsis

SELECTED_REAL_KIND(P, R)

Arguments

The arguments are both optional, but at least one of the optional arguments must be present. The argument P must be of type integer and specifies a precision. The argument R must be of type integer and specifies a range.

Return Value

The return value is an integer.


SET_EXPONENT

Returns the model number whose fractional part is the fractional part of the model representation of X and whose exponent part is I.

Synopsis

SET_EXPONENT(X, I)

Arguments

The argument X is of type real. The argument I is of type integer.

Return Value

The result has the type of the argument X.


SHAPE

Returns the shape of the supplied argument.

Synopsis

SHAPE(SOURCE)

Arguments

The argument SOURCE is a scalar or an array of any type.

Return Value

The result is an array whose size is equal to the rank of SOURCE. The values are number representing the shape of the SOURCE.


SIGN

Return the absolute value of A, times the sign of B.

Synopsis

SIGN(A, B)

Arguments

The argument A is an integer or real number. The argument B must be of the same type as A.

Return Value

The result has the same type as A, with the value of the absolute value of A times the sign of B.


SIN

Return the value of the sin of the argument.

Synopsis

SIN(X)

Argument

The argument X must be of type real or complex.

Return Value

The return value has the same type as X. The return value is in radians.


SINH

Return the hyperbolic sine of the argument.

Synopsis

SINH(X)

Argument

The argument X must be of type real.

Return Value

The return value has the same type as X.


SIZE

Returns either the total number of elements in the array, or the number of elements along a specified dimension.

Synopsis

SIZE(ARRAY, DIM)

Arguments

The argument ARRAY is an array of any type. The optional DIM argument is a valid dimension (valid dimensions are between the values 1 and n where n is the rank of the array).

Return Value

The result value is an integer. The function returns the total number of elements in the array if DIM is absent, or if DIM is present, the extent of the array in the specified dimension.


SPACING

Returns the spacing of model numbers near the argument.

Synopsis

SPACING(X)

Arguments

The argument X is of type real.

Return Value

The return value has the same type and kind as X.


SPREAD

Replicates an array by adding a new dimension.

Synopsis

SPREAD(SOURCE, DIM, NCOPIES)

Arguments

The argument SOURCE may be of any type with rank less than 7. The DIM argument is a scalar integer representing valid dimension (valid dimensions are between the values 1 and n where n is the rank of the array). The argument NCOPIES must be scalar and of type integer.

Return Value

The return value is an array of the same type as the SOURCE, with rank n+1 where n is the rank of SOURCE.


SQRT

Return the square root of the argument.

Synopsis

SQRT(X)

Arguments

The argument X must be a real or complex number.

Return Value

The result is of the same type as the argument.


SUM

Returns the sum of the elements of the supplied array.

Synopsis

SUM(ARRAY, DIM, MASK)

Arguments

The ARRAY argument is an array integer, real or complex type. The optional DIM argument is a valid dimension (valid dimensions are between the values 1 and n where n is the rank of the array). The optional MASK argument is of type logical and conformable with the supplied array.

Return Value

The return value is the sum of the elements of the argument array. If the optional DIM argument is present, the sum is for the specified dimension. If the optional MASK argument is present, the result is subject to the logical mask supplied.


SYSTEM_CLOCK

Returns information about the real time clock.

Synopsis

SYSTEM_CLOCK(COUNT, COUNT_RATE, COUNT_MAX)

Arguments

The optional argument COUNT is a scalar integer that provides the current count of the system clock when the subroutine is called. The optional argument COUNT_RATE is a scalar integer that provides the number of clock ticks per second. The optional argument COUNT_MAX is a scalar integer that provides the value of the maximum count possible.

The number of tics per second is always 1000. This routine is implemented on most systems using gettimeofday(2) (some implementations use dclock(3)).

Return Value

This is a subroutine. No value is returned.


TAN

Return the tangent of the specified value.

Synopsis

TAN(X)

Argument

The argument X must be of type real and have absolute value <= 1.

Return Value

A real value of the same KIND and the argument.


TANH

Return the hyperbolic tangent of the specified value.

Synopsis

TANH(X)

Argument

The argument X must be of type real and have absolute value <= 1.

Return Value

A real value of the same KIND and the argument.


TINY

Return the smallest number representable in the kind of the supplied argument.

Synopsis

TINY(X)

Argument

The argument X must be of type integer or real.

Return Value

A value of the same type as the argument with the minimum value possible in the number system.


TRANSFER

Return a value that has the same bit representation as the source, but with a different type.

Synopsis

TRANSFER(SOURCE, MOLD, SIZE)

Arguments

The argument SOURCE may be of any type and may be a scalar or an array. The argument MOLD may be of any type and may be a scalar or an array. The optional argument SIZE must be a scalar and of type integer.

Return Value

The return value has the type of the MOLD argument. Refer to The Fortran 90 Handbook for more details on the TRANSFER intrinsic.


TRANSPOSE

Transpose an array of rank two.

Synopsis

TRANSPOSE(MATRIX)

Arguments

The argument MATRIX is a two dimensional array of any type.

Return Value

The result is a transformed matrix with the same type as MATRIX and dimensions (m,n) where matrix MATRIX has dimensions (n,m)


TRIM

Adjust string to the left, removing all leading blanks and inserting trailing blanks.

Synopsis

TRIM(STRING)

Arguments

The argument STR is the string to be adjusted.

Return Value

String of same length and kind as the argument, but with leading blanks at end.


UBOUND

Returns the upper bounds of an array, or the upper bound for the specified dimension.

Synopsis

UBOUND(ARRAY, DIM)

Arguments

The argument ARRAY is an array of any type. The optional argument DIM is a scalar that has the value of valid dimension of the array (valid dimensions are between the values 1 and n where n is the rank of the array).

Return Value

The return value is an integer, or an array of rank one and size n, where n is the rank of the argument ARRAY. For the function with a DIM argument, the value is the value of the upper bound in the specified dimension. For the function with no DIM supplied, the return value is an array with all the upper bounds for ARRAY.


UNPACK

Unpack an array of rank one dimension into an array of any number of dimensions.

Synopsis

UNPACK(VECTOR, MASK, FIELD)

Arguments

The VECTOR argument is an array of any type and of rank one. It must have as many elements as there are true elements in MASK. The MASK argument is of type logical array. The FIELD argument must be the same type as VECTOR and must be conformable with MASK.

Return Value

The result array has the same type as VECTOR and the shape of MASK. For further details and information on the FIELD argument, refer to The Fortran 90 Handbook.


VERIFY

Verify that a character string, STRING, contains all characters from a set of characters, SET.

Synopsis

VERIFY(STRING, SET, BACK)

Arguments

The argument STRING is of type character. The argument SET is of type character. The argument BACK is of type logical.

Return Value

The return value is an integer. The function returns the position of the first (or last) character that is not in the set. BACK is a logical that determines if the first or last character position is returned.


<< << " border=0> >> > " border=0> Title Contents Index Home Help

Powered by Plone This site conforms to the following standards: