Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP Fortran Compiler for HP-UX: HP Fortran Programmer's Reference > Chapter 11 Intrinsic procedures

Intrinsic procedure specifications

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

The following sections describe the HP Fortran intrinsic procedures. The descriptions are ordered alphabetically, by intrinsic name. All of the intrinsics are generic. This means that the type, kind, and rank of the actual arguments can differ for each reference to the same intrinsic. In many cases, the kind and type of intrinsic function results are the same as that of the principal argument. For example, the SIN function may be called with any kind of real argument or any kind of complex argument, and the result has the type and kind of the argument.

Intrinsic procedure references may use keyword option. The actual argument expression is preceded by the dummy argument name—the argument keyword—and the equals sign (=). The argument keywords are shown in the descriptions.

Some intrinsic procedure’s arguments are optional. Optional arguments are noted as such in the following descriptions.

ABORT()

Description

Close all files, terminate the program, and cause an exception to create a core file.

Class

Nonstandard subroutine.

ABS(A)

Description

Absolute value.

Class

Elemental function.

Argument

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

Result type/
type parameters

The same as A except that if A is complex, the result is real.

Result value(s)

  • If A is of type integer or real, the value of the result is |A|.

  • If A is complex with value (x, y), the result is equal to a processor-dependent approximation to the square root of (x2 + y2).

Specific forms

BABS, CABS, CDABS, DABS, HABS, QABS, ZABS.

ACHAR(I)

Description

Returns the character in a specified position of the ASCII collating sequence. It is the inverse of the IACHAR function.

Class

Elemental function.

Argument

I must be of type integer.

Result type/
type parameters

Character of length one with kind type parameter value KIND(’A’).

Result value

If I has a value in the range 0 <= I <= 127, the result is the character in position I of the ASCII collating sequence, provided the processor is capable of representing that character; otherwise, the result is processor-dependent.

If the processor is not capable of representing both uppercase and lowercase letters and I corresponds to a letter in a case that the processor is not capable of representing, the result is the letter in the case that the processor is capable of representing.

ACHAR(IACHAR(C)) must have the value C for any character C capable of representation in the processor.

ACOS(X)

Description

Arccosine (inverse cosine) function in radians.

Class

Elemental function.

Argument

X must be of type real with a value that satisfies the inequality |X| <= 1.

Result type/
type parameters

Same as X.

Result value

The result has a value equal to a processor-dependent approximation to arccos(X), expressed in radians. It lies in the range 0 <= ACOS(X) <= Pi.

Specific forms

DCOS, QACOS.

ACOSD(X)

Description

Arccosine (inverse cosine) function in degrees.

Class

Elemental nonstandard function.

Argument

X must be of type real with a value that satisfies the inequality |X| <= 1.

Result type/
type parameters

Same as X.

Result value

The result has a value equal to a processor-dependent approximation to arccos(X), expressed in degrees. It lies in the range 0 <= ACOSD(X) <= 180.

Specific forms

DACOSD, QACOSD.

ACOSH(X)

Description

Hyperbolic arccosine of radians.

Class

Elemental nonstandard function.

Argument

X must be of type real with a value X >= 1.

Result type/
type parameters

Same as X.

Result value

The result has a value equal to a processor-dependent approximation to the hyperbolic arccosine of X. It lies in the range 0 <= ACOSH(X).

Specific forms

DACOSH, QACOSH.

ADJUSTL(STRING)

Description

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

Class

Elemental function.

Argument

STRING must be of type character.

Result type

Character of the same length and kind type parameter as STRING.

Result value

The value of the result is the same as STRING except that any leading blanks have been deleted and the same number of trailing blanks have been inserted.

ADJUSTR(STRING)

Description

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

Class

Elemental function.

Argument

STRING must be of type character.

Result type

Character of the same length and kind type parameter as STRING.

Result value

The value of the result is the same as STRING except that any trailing blanks have been deleted and the same number of leading blanks have been inserted.

AIMAG(Z)

Description

Imaginary part of a complex number.

Class

Elemental function.

Argument

Z must be of type complex.

Result type/
type parameters

Real with the same kind type parameter as Z.

Result value

If Z has the value (x, y), the result has value y.

AINT(A, KIND)

Optional argument

KIND

Description

Truncation to a whole number.

Class

Elemental function.

Arguments

A

must be of type real.

KIND (optional)

must be a scalar integer initialization expression.

Result type/
type parameter
s

The result is of type real. If KIND is present, the kind type parameter is that specified by KIND; otherwise, the kind type parameter is that of A.

Result value

If |A| < 1, AINT(A) has the value 0; if A >= 1, AINT(A) has a value equal to the integer whose magnitude is the largest integer that does not exceed the magnitude of A and whose sign is the same as the sign of A.

Specific forms

DDINT,DINT,QINT.

ALL(MASK, DIM)

Optional argument

DIM

Description

Determine whether all values are .TRUE. in MASK along dimension DIM.

Class

Transformational function.

Arguments

MASK

must be of type logical. It must not be scalar.

DIM (optional)

must be scalar and of type integer with value in the range 1 <= DIM <= n where n is the rank of MASK. The corresponding actual argument must not be an optional dummy argument.

Result type,
type parameters,
and shape

The result is of type logical with the same kind type parameter as MASK. It is scalar if DIM is absent or MASK has rank one; otherwise, the result is an array of rank n-1 and of shape (d1, d2, ..., dDIM-1, dDIM+1, ..., dn) where (d1, d2, ..., dn) is the shape of MASK.

Result value

Case 1

The result of ALL(MASK) has the value .TRUE. if all elements of MASK are .TRUE. or if MASK has size zero, and the result has value .FALSE. if any element of MASK is .FALSE..

Case 2

If MASK has rank one, ALL(MASK, DIM) has a value equal to that of ALL(MASK). Otherwise, the value of element (s1, s2, ..., sDIM-1, sDIM+1, ..., sn) of ALL(MASK, DIM) is equal to ALL(MASK (s1, s2, ..., sDIM-1, :, sDIM+1, ..., sn)).

ALLOCATED(ARRAY)

Description

Indicate whether or not an allocatable array is currently allocated.

Class

Inquiry function.

Argument

ARRAY must be an allocatable array.

Result type,
type parameters,
and shape

Default logical scalar.

Result value

The result has the value .TRUE. if ARRAY is currently allocated and has the value .FALSE. if ARRAY is not currently allocated. The result is undefined if the allocation status of the array is undefined.

AND(I, J)

Description

Logical AND.

Class

Elemental nonstandard function.

Arguments

I

must be of type integer.

J

must be of type integer with the same kind type parameter as I.

Result type/
type parameters

Same as I.

Result value

The result has the value obtained by performing a logical AND on I and J bit-by-bit according to Table 11-4 “Truth table for AND intrinsic”.

Table 11-4 Truth table for AND intrinsic

I

J

AND(I, J)

1

1

1

1

0

0

0

1

0

0

0

1

 

The model for interpreting an integer value as a sequence of bits is described in “The Bit Model”.

ANINT(A, KIND)

Optional argument

KIND

Description

Nearest whole number.

Class

Elemental function.

Arguments

A

must be of type real.

KIND (optional)

must be a scalar integer initialization expression.

Result type/
type parameters

The result is of type real. If KIND is present, the kind type parameter is that specified by KIND; otherwise, the kind type parameter is that of A.

Result value

If A>0, ANINT(A) has the value AINT(A+0.5); if A <= 0, ANINT(A) has the value AINT(A-0.5).

Specific forms

DNINT, QNINT.

ANY(MASK, DIM)

Optional argument

DIM

Description

Determine whether any value is .TRUE. in MASK along dimension DIM.

Class

Transformational function.

Arguments

MASK

must be of type logical. It must not be scalar.

DIM (optional)

must be scalar and of type integer with a value in the range 1 <= DIM <= n, where n is the rank of MASK. The corresponding actual argument must not be an optional dummy argument.

Result type,
type parameters,
and shape

The result is of type logical with the same kind type parameter as MASK. It is scalar if DIM is absent or MASK has rank one; otherwise, the result is an array of rank n-1 and of shape (d1, d2, ..., dDIM-1, dDIM+1, ..., dn) where (d1, d2, ..., dn) is the shape of MASK.

Result value

Case 1

The result of ANY(MASK) has the value .TRUE. if any element of MASK is .TRUE. and has the value .FALSE. if no elements are .TRUE. or if MASK has size zero.

Case 2

If MASK has rank one, ANY(MASK,DIM) has a value equal to that of ANY(MASK). Otherwise, the value of element (s1, s2, ..., sDIM-1, sDIM+1, ..., sn) of ANY(MASK, DIM) is equal to ANY(MASK(s1, s2, ..., sDIM-1, :, sDIM+1, ..., sn)).

ASIN(X)

Description

Arcsine (inverse sine) function in radians.

Class

Elemental function.

Argument

X must be of type real. Its value must satisfy the inequality |X| >= 1.

Result type/
type parameters

Same as X.

Result value

The result has a value equal to a processor-dependent approximation to arcsin(X), expressed in radians. It lies in the range -Pi/2 <= ASIN(X) <= Pi/2.

Specific forms

DASIN, QASIN.

ASIND(X)

Description

Arcsine (inverse sine) function in degrees.

Class

Elemental nonstandard function.

Argument

X must be of type real. Its value must satisfy the inequality |X| <= 1.

Result type/
type parameters

Same as X.

Result value

The result has a value equal to a processor-dependent approximation to arcsin(X), expressed in degrees. It lies in the range
-90 <= ASIN(X) <= 90.

Specific forms

DASIND, QASIND.

ASINH(X)

Description

Hyperbolic arcsine of radians.

Class

Elemental nonstandard function.

Argument

X must be of type real.

Result type/
type parameters

Same as X.

Result value

The result has a value equal to a processor-dependent approximation to the hyperbolic arcsine of X.

Specific forms

DASINH, QASINH.

ASSOCIATED(POINTER, TARGET)

Optional argument

TARGET

Description

Returns the association status of its pointer argument or indicates the pointer is associated with the target.

Class

Inquiry function.

Arguments

POINTER

must be a pointer and may be of any type. Its pointer association status must not be undefined.

TARGET (optional)

must be a pointer or target. If it is a pointer, its pointer association status must not be undefined.

Result type

The result is scalar of type default logical.

Result value

Case 1

If TARGET is absent, the result is .TRUE. if POINTER is currently associated with a target and .FALSE. if it is not.

Case 2

If TARGET is present and is a target, the result is .TRUE. if POINTER is currently associated with TARGET and .FALSE. if it is not.

Case 3

If TARGET is present and is a pointer, the result is .TRUE. if both POINTER and TARGET are currently associated with the same target, and is .FALSE. otherwise. If either POINTER or TARGET is disassociated, the result is .FALSE..

ATAN(X)

Description

Arctangent (inverse tangent) function in radians.

Class

Elemental function.

Argument

X must be of type real.

Result type/
type parameters

Same as X.

Result value

The result has a value equal to a processor-dependent approximation to arctan(X), expressed in radians, that lies in the range -Pi/2 <= ATAN(X) <= Pi/2.

Specific forms

DATAN, QATAN.

ATAN2(Y, X)

Description

Arctangent (inverse tangent) function in radians. The result is the principal value of the argument of the nonzero complex number (X, Y).

Class

Elemental function.

Arguments

Y

must be of type real.

X

must be of the same type and kind type parameter as Y. If Y has the value zero, X must not have the value zero.

Result type/
type parameters

Same as X.

Result value

The result has a value equal to a processor-dependent approximation to the principal value of the argument of the complex number (X, Y), expressed in radians.

The result lies in the range -Pi <= ATAN2(Y, X) <= Pi and is equal to a processor-dependent approximation to a value of arctan(Y/X) if X is not 0.

If Y>0, the result is positive. If Y=0, the result is zero if X>0 and the result is Pi if X<0. If Y<0, the result is negative. If X=0, the absolute value of the result is Pi/2.

Specific forms

DATAN2,QATAN2.

ATAN2D(Y, X)

Description

Arctangent (inverse tangent) function in degrees.

Class

Elemental nonstandard function.

Arguments

Y

must be of type real.

X

must be of the same type and kind type parameter as Y.

Result type/
type parameters

Same as X.

Result value

The result has a value equal to a processor-dependent approximation to the principal value of the argument of the complex number (X, Y), expressed in degrees, that lies in the range
-90 < ATAN2D(Y,X) < 90.

Specific forms

DATAN2D,QATAN2D.

ATAND(X)

Description

Arctangent (inverse tangent) function in degrees.

Class

Elemental nonstandard function.

Argument

X must be of type real.

Result type/
type parameters

Same as X.

Result value

The result has a value equal to a processor-dependent approximation to arctan(X), expressed in degrees, that lies in the range
-90 < ATAND(X) < 90.

Specific forms

DATAND,QATAND.

ATANH(X)

Description

Hyperbolic arctangent of radians.

Class

Elemental nonstandard function.

Argument

X must be of type real.

Result type/
type parameters

Same as X.

Result value

The result has a value equal to a processor-dependent approximation to the hyperbolic arctangent of X.

Specific forms

DATANH, QATANH.

BADDRESS(X)

Description

Return the address of X.

Class

Inquiry nonstandard function.

Argument

X may be of any type.

Result type

The result is of type default integer.

BIT_SIZE(I)

Description

Returns the number of bits n, defined by the model described in “The Bit Model”, for integers with the kind parameter of the argument.

Class

Inquiry function.

Argument

I must be of type integer.

Result type,
type parameters,
and shape

Scalar integer with the same kind type parameter as I.

Result value

The result has the value of the number of bits n in the model integer, defined for bit manipulation contexts in “The Bit Model”, for integers with the kind parameter of the argument.

BTEST(I, POS)

Description

Tests a bit of an integer value.

Class

Elemental function.

Arguments

I

must be of type integer.

POS

must be of type integer. It must be nonnegative and be less than BIT_SIZE(I).

Result type

The result is of type default logical.

Result value

The result has the value .TRUE. if bit POS of I has the value 1 and has the value .FALSE. if bit POS of I has the value 0. The model for the interpretation of an integer value as a sequence of bits is described in “The Bit Model”.

Specific forms

BBTEST, BITEST, BJTEST, BKTEST, HTEST.

CEILING(A)

Description

Returns the least integer greater than or equal to its argument.

Class

Elemental function.

Argument

A must be of type real.

Result type/
type parameters

Default integer.

Result value

The result has a value equal to the least integer greater than or equal to A. The result is undefined if the processor cannot represent this value in the default integer type.

CHAR(I, KIND)

Optional argument

KIND

Description

Returns the character in a given position of the processor collating sequence associated with the specified kind type parameter. It is the inverse of the function ICHAR.

Class

Elemental function.

Arguments

I

must be of type integer with a value in the range 0 <= I <= n-1, where n is the number of characters in the collating sequence associated with the specified kind type parameter.

KIND (optional)

must be a scalar integer initialization expression.

Result type/
type parameters

Character of length one. If KIND is present, the kind type parameter is that specified by KIND; otherwise, the kind type parameter is that of default character type.

Result value

The result is the character in position I of the collating sequence associated with the specified kind type parameter.

ICHAR(CHAR(I, KIND(C))) must have the value I for 0 <= I <= n-1 and CHAR(ICHAR(C), KIND(C)) must have the value C for any character C capable of representation in the processor.

CMPLX(X, Y, KIND)

Optional arguments

Y, KIND

Description

Convert to complex type.

Class

Elemental function.

Arguments

X

must be of type integer, real, or complex.

Y (optional)

must be of type integer or real. It must not be present if X is of type complex.

KIND (optional)

must be a scalar integer initialization expression.

Result type/
type parameters

The result is of type complex. If KIND is present, the kind type parameter is that specified by KIND; otherwise, the kind type parameter is that of default real type.

Result value

  • If Y is absent and X is not complex, it is as if Y were present with the value zero.

  • If Y is absent and X is complex, it is as if Y were present with the value AIMAG(X).

CMPLX(X,Y,KIND) has the complex value whose real part is REAL(X,KIND) and whose imaginary part is REAL(Y,KIND).

CONJG(Z)

Description

Conjugate of a complex number.

Class

Elemental function.

Argument

Z must be of type complex.

Result type/
type parameter
s

Same as Z.

Result value

If Z has the value (x, y), the result has the value (x, -y).

Specific forms

DCONJG.

COS(X)

Description

Cosine function in radians.

Class

Elemental function.

Argument

X must be of type real or complex.

Result type/
type parameters

Same as X.

Result value

The result has a value equal to a processor-dependent approximation to cos(X). If X is of type real, it is regarded as a value in radians. If X is of type complex, its real part is regarded as a value in radians.

Specific forms

CCOS, CDCOS, DCOS, QCOS, ZCOS.

COSD(X)

Description

Cosine function in degrees.

Class

Elemental nonstandard function.

Argument

X must be of type real.

Result type/
type parameters

Same as X.

Result value

The result has a value equal to a processor-dependent approximation to cos(X).

Specific forms

DCOSD, QCOSD.

COSH(X)

Description

Hyperbolic cosine function.

Class

Elemental function.

Argument

X must be of type real.

Result type/
type parameters

Same as X.

Result value

The result has a value equal to a processor-dependent approximation to cosh(X).

Specific forms

DCOSH, QCOSH.

COUNT(MASK, DIM)

Optional argument

DIM

Description

Count the number of .TRUE. elements of MASK along dimension DIM.

Class

Transformational function.

Arguments

MASK

must be of type logical. It must not be scalar.

DIM (optional)

must be scalar and of type integer with a value in the range

1 <= DIM <= n, where n is the rank of MASK. The corresponding actual argument must not be an optional dummy argument.

Result type,
type parameters,
and shape

The result is of type default integer. It is scalar if DIM is absent or MASK has rank one; otherwise, the result is an array of rank n-1 and of shape (d1, d2, ..., dDIM-1, dDIM+1, ..., dn) where (d1, d2, ..., dn) is the shape of MASK.

Result value

Case 1

The result of COUNT(MASK) has a value equal to the number of .TRUE. elements of MASK or has the value zero if MASK has size zero.

Case 2

If MASK has rank one, COUNT(MASK, DIM) has a value equal to that of COUNT(MASK). Otherwise, the value of element (s1, s2, ..., sDIM-1, sDIM+1, ..., sn) of COUNT(MASK, DIM) is equal to COUNT(MASK(s1, s2, ..., sDIM-1, :, sDIM+1, ..., sn)).

Specific forms

KCOUNT.

CSHIFT(ARRAY, SHIFT, DIM)

Optional argument

DIM

Description

Perform a circular shift on an array expression of rank one, or perform circular shifts on all the complete rank one sections along a given dimension of an array expression of rank two or greater.

Elements shifted out at one end of a section are shifted in at the other end. Different sections may be shifted by different amounts and in different directions (positive for left shifts, negative for right shifts).

Class

Transformational function.

Arguments

ARRAY

may be of any type. It must not be scalar.

SHIFT

must be of type integer and must be scalar if ARRAY has rank one; otherwise, it must be scalar or of rank n-1 and of shape (d1, d2, ..., dDIM-1, dDIM+1, ..., dn) where (d1, d2, ..., dn) is the shape of ARRAY.

DIM (optional)

must be a scalar and of type integer with a value in the range 1 <= DIM <= n, where n is the rank of ARRAY. If DIM is omitted, it is as if it were present with the value 1.

Result type,
type parameters,
and shape

The result is of the type and type parameters of ARRAY, and has the shape of ARRAY.

Result value

Case 1

If ARRAY has rank one, element i of the result is ARRAY(1 + MODULO(i + SHIFT - 1, SIZE(ARRAY))).

Case 2

If ARRAY has rank greater than one, section (s1, s2, ..., sDIM-1, :, sDIM+1, ...., sn) of the result has a value equal to CSHIFT(ARRAY(s1, s2, ..., sDIM-1, :, sDIM+1, ...., sn), sh, 1), where sh is SHIFT or SHIFT(s1, s2, ..., sDIM-1, sDIM+1, ..., sn).

Specific forms

KCSHIFT.

DATE(DATESTR)

Description

Return current system date.

Class

Nonstandard subroutine.

Argument

DATESTR must be of type character. It must be a character string of length 9 or more.

DATE_AND_TIME(DATE, TIME, ZONE, VALUES)

Optional arguments

DATE, TIME, ZONE, VALUES

Description

Returns data on the real-time clock and date in a form compatible with the representations defined in ISO 8601:1988 (“Data elements and interchange formats — Information interchange — Representation of dates and times”).

Class

Subroutine.

Arguments

DATE (optional)

must be scalar and of type default character, and must be of length at least 8 in order to contain the complete value. It is an INTENT(OUT) argument. Its leftmost 8 characters are set to a value of the form CCYYMMDD, where CC is the century, YY the year within the century, MM the month within the year, and DD the day within the month. If there is no date available, they are set to blank.

TIME (optional)

must be scalar and of type default character, and must be of length at least 10 in order to contain the complete value. It is an INTENT(OUT) argument. Its leftmost 10 characters are set to a value of the form hhmmss.sss, where hh is the hour of the day, mm is the minutes of the hour, and ss.sss is the seconds and milliseconds of the minute. If there is no clock available, they are set to blank.

ZONE (optional)

must be scalar and of type default character, and must be of length at least 5 in order to contain the complete value. It is an INTENT(OUT) argument. Its leftmost 5 characters are set to a value of the form (+/-)hhmm, where hh and mm are the time difference with respect to Coordinated Universal Time (UTC) in hours and parts of an hour expressed in minutes, respectively. If there is no clock available, they are set to blank.

VALUES (optional)

must be of type default integer and of rank one. It is an INTENT(OUT) argument. Its size must be at least 8. The values returned in VALUES are as follows:

VALUES(1)

the year (for example, 1990), or -HUGE(0) if there is no date available;

VALUES(2)

the month of the year, or -HUGE(0) if there is no date available;

VALUES(3)

the day of the month, or -HUGE(0) if there is no date available;

VALUES(4)

the time difference with respect to Coordinated Universal Time (UTC) in minutes, or -HUGE(0) if this information is not available;

VALUES(5)

the hour of the day, in the range of 0 to 23, or -HUGE(0) if there is no clock;

VALUES(6)

the minutes of the hour, in the range 0 to 59, or -HUGE(0) if there is no clock;

VALUES(7)

the seconds of the minute, in the range 0 to 60, or -HUGE(0) if there is no clock;

VALUES(8)

the milliseconds of the second, in the range 0 to 999, or -HUGE(0) if there is no clock.

The HUGE intrinsic function is described in “HUGE(X)”.

DBLE(A)

Description

Convert to double precision real type.

Class

Elemental function.

Argument

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

Result type/
type parameters

Double precision real.

Result value

Case 1

If A is of type double precision real, DBLE(A) = A.

Case 2

If A is of type integer or real, the result is as much precision of the significant part of A as a double precision real datum can contain.

Case 3

If A is of type complex, the result is as much precision of the significant part of the real part of A as a double precision real datum can contain.

Specific forms

DBLEQ.

DCMPLX(X,Y)

Optional argument

Y

Description

Convert to double precision complex type.

Class

Elemental nonstandard function.

Arguments

X

must be of type integer, real, or complex.

Y

must not be supplied if X is of type complex; otherwise is optional and must be of the same type and kind type parameter as X.

Result type/
type parameters

Double precision complex.

DFLOAT(A)

Description

Convert to double precision type.

Class

Elemental nonstandard function.

Argument

A must be of type integer.

Result type/
type parameters

Double precision.

Specific forms

DFLOTI, DFLOTJ, DFLOTK.

DIGITS(X)

Description

Returns the number of significant digits in the model representing numbers of the same type and kind type parameter as the argument.

Class

Inquiry function.

Argument

X must be of type integer or real. It may be scalar or array valued.

Result type,
type parameters,
and shape

Default integer scalar.

Result value

The result has the value q if X is of type integer and p if X is of type real, where q and p are as defined in “Data representation models” for the model representing numbers of the same type and kind type parameter as X.

DIM(X, Y)

Description

The difference X-Y if it is positive; otherwise zero.

Class

Elemental function.

Arguments

X

must be of type integer or real.

Y

must be of the same type and kind type parameter as X.

Result type/
type parameters

Same as X.

Result value

The value of the result is X-Y if X > Y and zero otherwise.

Specific forms

BDIM, DDIM, HDIM, QDIM.

DNUM(I)

Description

Convert to double precision.

Class

Elemental nonstandard function.

Argument

I must be of type character.

Result type

Double precision.

DOT_PRODUCT(VECTOR_A, VECTOR_B)

Description

Performs dot-product multiplication of numeric or logical vectors.

Class

Transformational function.

Arguments

VECTOR_A

must be of numeric type (integer, real, or complex) or of logical type. It must be array valued and of rank one.

VECTOR_B

must be of numeric type if VECTOR_A is of numeric type or of type logical if VECTOR_A is of type logical. It must be array valued and of rank one. It must be of the same size as VECTOR_A.

Result type,
type parameters,
and shape

The result is scalar.

If the arguments are of numeric type, the type and kind type parameter of the result are those of the expression VECTOR_A * VECTOR_B determined by the types of the arguments.

If the arguments are of type logical, the result is of type logical with the kind type parameter of the expression VECTOR_A .AND. VECTOR_B.

Result value

Case 1

If VECTOR_A is of type integer or real, the result has the value SUM(VECTOR_A*VECTOR_B). If the vectors have size zero, the result has the value zero.

Case 2

If VECTOR_A is of type complex, the result has the value SUM(CONJG(VECTOR_A)*VECTOR_B). If the vectors have size zero, the result has the value zero.

Case 3

If VECTOR_A is of type logical, the result has the value ANY(VECTOR_A .AND. VECTOR_B). If the vectors have size zero, the result has the value .FALSE..

DPROD(X, Y)

Description

Double precision real product.

Class

Elemental function.

Arguments

X

must be of type default real.

Y

must be of type default real.

Result type/
type parameters

Double precision real.

Result value

The result has a value equal to a processor-dependent approximation to the product of X and Y.

DREAL(A)

Description

Convert to double precision.

Class

Elemental nonstandard function.

Argument

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

Result

Double precision.

EOSHIFT(ARRAY, SHIFT, BOUNDARY, DIM)

Optional arguments

BOUNDARY, DIM

Description

Perform an end-off shift on an array expression of rank one or perform end-off shifts on all the complete rank-one sections along a given dimension of an array expression of rank two or greater.

Elements are shifted off at one end of a section and copies of a boundary value are shifted in at the other end.

Different sections may have different boundary values and may be shifted by different amounts and in different directions (positive for left shifts, negative for right shifts).

Class

Transformational function.

Arguments

ARRAY

may be of any type. It must not be scalar.

SHIFT

must be of type integer and must be scalar if ARRAY has rank one; otherwise, it must be scalar or of rank n-1 and of shape (d1, d2, ..., dDIM-1, dDIM+1, ..., dn) where (d1, d2, ..., dn) is the shape of ARRAY.

BOUNDARY (optional)

must be of the same type and type parameters as ARRAY and must be scalar if ARRAY has rank one; otherwise, it must be either scalar or of rank n-1 and of shape (d1, d2, ..., dDIM-1, dDIM+1, ..., dn). BOUNDARY may be omitted for the data types listed in Table 11-5 “Default values for the BOUNDARY argument”, which lists the default values of BOUNDARY for each data type.

Table 11-5 Default values for the BOUNDARY argument

Data type of ARRAY

Default value of BOUNDARY

Integer

0

Real

0.0

Complex

(0.0, 0.0)

Logical

.FALSE.

Character (len)

len blanks

 

DIM (optional)

must be scalar and of type integer with a value in the range 1 <= DIM <= n, where n is the rank of ARRAY. If DIM is omitted, it is as if it were present with the value 1.

Result type,
type parameters,
and shape

The result has the type, type parameters, and shape of ARRAY.

Result value

Element (s1, s1, ..., sn) of the result has the value ARRAY (s1, s2, ..., sDIM-1, sDIM + sh, sDIM+1, ..., sn) where sh is SHIFT or SHIFT(s1, s2, ..., sDIM-1, sDIM+1, ..., sn) provided the inequality LBOUND(ARRAY, DIM) <= sDIM + sh <= UBOUND(ARRAY, DIM) holds and is otherwise BOUNDARY or BOUNDARY(s1, s2, ..., sDIM-1, sDIM+1, ..., sn).

Specific forms

KEOSHIFT.

EPSILON(X)

Description

Returns a positive model number that is almost negligible compared to unity in the model representing numbers of the same type and kind type parameter as the argument.

Class

Inquiry function.

Argument

X must be of type real. It may be scalar or array valued.

Result type,
type parameters, and shape

Scalar of the same type and kind type parameter as X.

Result value

The result has the value b1-p where b and p are as defined in “The Real Number System Model” for the model representing numbers of the same type and kind type parameter as X.

EXIT(STATUS)

Optional argument

STATUS

Description

Close all files and terminate the program.

Class

Nonstandard subroutine.

Argument

STATUS must be of type integer.

If STATUS is supplied, the calling program exits with a return code status of STATUS. Otherwise the return code status is indeterminate.

In csh the $status environment variable holds the return code for the last executed command. In ksh, the $? environment variable holds the return code.

EXP(X)

Description

Exponential.

Class

Elemental function.

Argument

X must be of type real or complex.

Result type/
type parameter
s

Same as X.

Result value

The result has a value equal to a processor-dependent approximation to ex. If X is of type complex, its imaginary part is regarded as a value in radians.

Specific forms

CEXP,CDEXP, DEXP, QEXP,ZEXP.

EXPONENT(X)

Description

Returns the exponent part of the argument when represented as a model number.

Class

Elemental function.

Argument

X must be of type real.

Result type

Default integer.

Result value

The result has a value equal to the exponent e of the model representation (see “The Real Number System Model”) for the value of X, provided X is nonzero and e is within the range for default integers. The result is undefined if the processor cannot represent e in the default integer type. EXPONENT(X) has the value zero if X is zero.

FLOOR(A)

Description

Returns the greatest integer less than or equal to its argument.

Class

Elemental function.

Argument

A must be of type real.

Result type/
type parameters

Default integer.

Result value

The result has a value equal to the greatest integer less than or equal to A. The result is undefined if the processor cannot represent this value in the default integer type.

FLUSH(LUNIT)

Description

Flush pending I/O on a logical unit.

Class

Nonstandard subroutine.

FNUM(UNIT)

Description

Get an operating system file descriptor.

Class

Inquiry nonstandard function.

FRACTION(X)

Description

Returns the fractional part of the model representation of the argument value.

Class

Elemental function.

Argument

X must be of type real.

Result type/
type parameters

Same as X.

Result value

The result has the value X * b-e, where b and e are as defined in “The Real Number System Model”. If X has the value zero, the result has the value zero.

FREE(P)

Description

Free a block of memory.

Class

Nonstandard subroutine.

FSET(UNIT, NEWFD, OLDFD)

Description

Attach a system file descriptor to a logical unit.

Class

Nonstandard subroutine.

FSTREAM(UNIT)

Description

Retrieve a C language FILE stream pointer.

Class

Inquiry nonstandard function.

GETARG(N, STRING)

Description

Get the arguments passed to the program.

Class

Nonstandard subroutine.

Arguments

N

must be of type integer. N specifies which command-line argument is requested. When N=1, it returns the program name. When N=0, it returns all blanks.

STRING

must be a character variable. It is assigned the requested command-line argument, padded with blanks on the end. If the requested argument is longer than STRING, a truncated version is assigned to STRING.

GETENV(VAR, VALUE)

Description

Return the value of a system environment variable.

Class

Nonstandard subroutine.

Arguments

VAR and VALUE are of type character. VAR specifies the environment variable name. The character variable VALUE is assigned the environment variable’s value. VALUE must be declared large enough to hold the value. If the environment variable is not defined VALUE is set to all blanks.

GRAN()

Description

Generate Gaussian normal random numbers.

Class

Elemental nonstandard function.

Result

REAL(4). The numbers generated by GRAN have a mean of 0.0, a standard deviation of 1.0, and a range of approximately -5.0 through +5.0.

HFIX(A)

Description

Convert to INTEGER(2) type.

Class

Elemental nonstandard function.

Argument

A must be of type integer, real, double precision, or complex.

Result

INTEGER(2) type.

HUGE(X)

Description

Returns the largest number in the model representing numbers of the same type and kind type parameter as the argument.

Class

Inquiry function.

Argument

X must be of type integer or real. It may be scalar or array valued.

Result type,
type parameters,
and shape

Scalar of the same type and kind type parameter as X.

Result value

The result has the value rq - 1 if X is of type integer and

(1 - b-p) b ** emax

if X is of type real, where r, q, b, p, and emax are as defined in “The Real Number System Model”.

IACHAR(C)

Description

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

Class

Elemental function.

Argument

C must be of type default character and of length one.

Result type/
type parameters

Default integer.

Result value

If C is in the collating sequence defined by the codes specified in ISO 646:1983 (“Information technology — ISO 7-bit coded character set for information interchange”), the result is the position of C in that sequence and satisfies the inequality (0 <= IACHAR(C) <= 127).

A processor-dependent value is returned if C is not in the ASCII collating sequence. The results are consistent with the LGE, LGT, LLE, and LLT lexical comparison functions. For example, if LLE(C, D) is .TRUE., IACHAR(C) .LE. IACHAR(D) is .TRUE. where C and D are any two characters representable by the processor.

IADDR(X)

Description

Return the address of X.

Class

Inquiry nonstandard function.

Argument

X may be of any type.

Result type

The result is of type default integer.

See “BADDRESS(X)” for examples.

IAND(I, J)

Description

Performs a bitwise logical AND.

Class

Elemental function.

Arguments

I

must be of type integer.

J

must be of type integer with the same kind type parameter as I.

Result type/
type parameters

Same as I.

Result value

The result has the value obtained by combining I and J bit-by-bit according to Table 11-6 “Truth table for IAND intrinsic”.

Table 11-6 Truth table for IAND intrinsic

I

J

IAND(I, J)

1

1

1

1

0

0

0

1

0

0

0

0

 

The model for the interpretation of an integer value as a sequence of bits is in “The Bit Model”.

Specific forms

BIAND, HIAND, IIAND, JIAND, KIAND.

IARGC()

Description

Get the number of arguments passed to the program.

Class

Elemental nonstandard function.

Result type

Integer.

Result value

If no arguments are passed to the program, IARGC returns zero. Otherwise IARGC returns a count of the arguments that follow the program name on the command line.

IBCLR(I, POS)

Description

Clears a bit to zero.

Class

Elemental function.

Arguments

I

must be of type integer.

POS

must be of type integer. It must be nonnegative and less than BIT_SIZE(I).

Result type/
type parameters

Same as I.

Result value

The result has the value of the sequence of bits of I, except that bit POS of I is set to zero. The model for the interpretation of an integer value as a sequence of bits is in “The Bit Model”.

Specific forms

BBCLR, HBCLR, IIBCLR, JIBCLR, KIBCLR.

IBITS(I, POS, LEN)

Description

Extracts a sequence of bits.

Class

Elemental function.

Arguments

I

must be of type integer.

POS

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

LEN

must be of type integer and nonnegative.

Result type/
type parameters

Same as I.

Result value

The result has the value of the sequence of LEN bits in I beginning at bit POS, right-adjusted and with all other bits zero. The model for the interpretation of an integer value as a sequence of bits is in “The Bit Model”.

Specific forms

BBITS, HBITS, IIBITS, JIBITS, KIBITS.

IBSET(I, POS)

Description

Sets a bit to one.

Class

Elemental function.

Arguments

I

must be of type integer.

POS

must be of type integer. It must be nonnegative and less than BIT_SIZE(I).

Result type/
type parameters

Same as I.

Result value

The result has the value of the sequence of bits of I, except that bit POS of I is set to one. The model for the interpretation of an integer value as a sequence of bits is in “The Bit Model”.

Specific forms

HBSET, IIBSET,JIBSET,KIBSET.

ICHAR(C)

Description

Returns the position of a character in the processor collating sequence associated with the kind type parameter of the character.

Class

Elemental function.

Argument

C must be of type character and of length one. Its value must be that of a character capable of representation in the processor.

Result type/
type parameters

Default integer.

Result value

The result is the position of C in the processor collating sequence associated with the kind type parameter of C and is in the range 0 <= IACHAR(C) <n-1, where n is the number of characters in the collating sequence.

For any characters C and D capable of representation in the processor, C.LE.D is .TRUE. if and only if ICHAR(C) .LE. ICHAR(D) is .TRUE., and C.EQ.D is .TRUE. if and only if ICHAR(C).EQ. ICHAR(D) is .TRUE..

IDATE(MONTH, DAY, YEAR)

Description

Return the month, day, and year of current system.

Class

Nonstandard subroutine.

Arguments

MONTH, DAY, and YEAR must be of type integer.

IDIM(X, Y)

Description

Integer positive difference.

Class

Nonstandard function.

Arguments

X

must be of type integer.

Y

must be of type integer with the same kind type parameter as X.

Result type/
type parameters

Integer of same kind type parameter as X.

Result value

If X > Y, IDIM(X, Y) is X-Y. If X <= Y, IDIM(X, Y) is zero.

Specific forms

IIDIM,JIDIM. KIDIM.

IEOR(I, J)

Description

Performs a bitwise exclusive OR.

Class

Elemental function.

Arguments

I

must be of type integer.

J

must be of type integer with the same kind type parameter as I.

Result type/
type parameters

Same as I.

Result value

The result has the value obtained by combining I and J bit-by-bit according to Table 11-7 “Truth table for IEOR intrinsic”.

Table 11-7 Truth table for IEOR intrinsic

I

J

IEOR(I, J)

1

1

0

1

0

1

0

1

1

0

0

0

 

The model for the interpretation of an integer value as a sequence of bits is in “The Bit Model”.

Specific forms

BIEOR, HIEOR, IIEOR, JIEOR, KIEOR.

IGETARG(N, STR, STRLEN)

Description

Get command-line argument.

Class

Inquiry nonstandard function.

Arguments

N

must be of type integer. N specifies which command-line argument is requested. When N=0, it returns the program name.

STR

must be a character variable. It is assigned first STRLEN characters of the requested command-line argument, padded with blanks on the end. If the requested argument is longer than STR, a truncated version is assigned to STR.

STRLEN

must be of type integer. STRLEN specifies the number of characters of argument N to assign to STR.

Result value

IGETARG returns an integer value, either -1 if the requested argument was not found, or a positive integer that indicates the number of characters copied from the command line to STR.

IJINT(A)

Description

Convert to INTEGER(2) type.

Class

Elemental nonstandard function.

Argument

A must be of type INTEGER(4).

Result

INTEGER(2) type.

IMAG(A)

Description

Imaginary part of complex number.

Class

Elemental nonstandard function.

Argument

A must be of type complex or double complex.

Result

Real if A is complex. Double precision if A is double complex.

INDEX(STRING, SUBSTRING, BACK)

Optional argument

BACK

Description

Returns the starting position of a substring within a string.

Class

Elemental function.

Arguments

STRING

must be of type character.

SUBSTRING

must be of type character with the same kind type parameter as STRING.

BACK (optional)

must be of type logical.

Result type/
type parameters

Default integer.

Result value

Case 1

If BACK is absent or present with the value .FALSE., the result is the minimum positive value of I such that STRING(I : I + LEN(SUBSTRING) - 1) = SUBSTRING or zero if there is no such value.

Zero is returned if LEN(STRING) < LEN(SUBSTRING) and one is returned if LEN(SUBSTRING) = 0.

Case 2

If BACK is present with the value .TRUE., the result is the maximum value of I less than or equal to LEN(STRING) - LEN(SUBSTRING) + 1 such that STRING(I : I + LEN(SUBSTRING) - 1) = SUBSTRING or zero if there is no such value.

Zero is returned if LEN(STRING) < LEN(SUBSTRING) and LEN(STRING) + 1 is returned if LEN(SUBSTRING) = 0.

Specific forms

KINDEX.

INT(A, KIND)

Optional argument

KIND

Description

Convert to integer type.

Class

Elemental function.

Arguments

A

must be of type integer, real, or complex.

KIND (optional)

must be a scalar integer initialization expression.

Result type/
type parameters

Integer. If KIND is present, the kind type parameter is that specified by KIND; otherwise, the kind type parameter is that of default integer type.

Result value

Case 1

If A is of type integer, INT(A) = A.

Case 2

If A is of type real, there are two cases: if |A| < 1, INT(A) has the value 0; if |A| >= 1, INT(A) is the integer whose magnitude is the largest integer that does not exceed the magnitude of A and whose sign is the same as the sign of A.

Case 3

If A is of type complex, INT(A) is the value obtained by applying the above rules (for reals) to the real part of A. The result is undefined if the processor cannot represent the result in the specified integer type.

Specific forms

IFIX, IIFIX, IINT, JIFIX, JINT, KIFIX, KINT.

INT1(A)

Description

Convert to INTEGER(1) type.

Class

Elemental nonstandard function.

Argument

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

Result

INTEGER(1) type. If A is complex, INT1(A) is equal to the truncated real portion of A.

INT2(A)

Description

Convert to INTEGER(2) type.

Class

Elemental nonstandard function.

Argument

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

Result

INTEGER(2) type. If A is complex, INT2(A) is equal to the truncated real portion of A.

INT4(A)

Description

Convert to INTEGER(4) type.

Class

Elemental nonstandard function.

Argument

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

Result

INTEGER(4) type. If A is complex, INT4(A) is equal to the truncated real portion of A.

INT8(A)

Description

Convert to INTEGER(8) type.

Class

Elemental nonstandard function.

Argument

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

Result

INTEGER(8) type. If A is complex, INT8(A) is equal to the truncated real portion of A.

Specific forms

IDINT.

INUM(I)

Description

Convert character to INTEGER(2) type.

Class

Elemental nonstandard function.

Argument

I must be of type character.

Result

INTEGER(2) type.

IOMSG(N, MSG)

Description

Print the text for an I/O message.

Class

Nonstandard subroutine.

IOR(I, J)

Description

Performs a bitwise inclusive OR.

Class

Elemental function.

Arguments

I

must be of type integer.

J

must be of type integer with the same kind type parameter as I.

Result type/
type parameters

Same as I.

Result value

The result has the value obtained by combining I and J bit-by-bit according to Table 11-8 “Truth table for IOR intrinsic”.

Table 11-8 Truth table for IOR intrinsic

I

J

IOR(I, J)

1

1

1

1

0

1

0

1

1

0

0

0

 

The model for the interpretation of an integer value as a sequence of bits is in “The Bit Model”.

Specific forms

BIOR, HIOR, IIOR, JIOR, KIOR

IQINT(A)

Description

Convert to integer type.

Class

Elemental nonstandard function.

Argument

A must be of type REAL(16).

Result

Integer type.

Specific forms

IIQINT, JIQINT,KIQINT.

IRAND()

Description

Generate pseudorandom numbers.

Class

Elemental nonstandard function.

Result type/
type parameters

INTEGER(4) type.

Result value

RAND generates numbers in the range 0 through 215-1.

NOTE: For details about restarting the pseudorandom number generator used by IRAND and RAND, see “SRAND(ISEED)”.

IRANP(X)

Description

Generate Poisson-distributed random numbers.

Class

Elemental nonstandard function.

Argument

X must be of REAL(4) type and must be in the range 0.0 through 87.33. For better performance, it is recommended that X be less than 50.0 (see “Result value” below).

Result type/
type parameters

INTEGER(4) type.

Result value

IRANP returns an error code of -1 if X <= 0.0.

IRANP returns an error code of -2 if X > 87.33.

IRANP calculates exponentially distributed random numbers until the product is less than exp(-X). The random number returned by IRANP is the number of exponentials needed, minus 1. IRANP makes an average of X+1 calls to RAND, so it is recommended that X be less than 50.

ISHFT(I, SHIFT)

Description

Performs a logical shift.

Class

Elemental function.

Arguments

I

must be of type integer.

SHIFT

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

Result type/
type parameters

Same as I.

Result value

The result has the value obtained by shifting the bits of I by SHIFT positions.

If SHIFT is positive, the shift is to the left; if SHIFT is negative, the shift is to the right; and if SHIFT is zero, no shift is performed. Bits shifted out from the left or from the right, as appropriate, are lost. Zeros are shifted in from the opposite end.

The model for the interpretation of an integer value as a sequence of bits is described in “The Bit Model”.

Specific forms

BSHFT, HSHFT, IISHFT, JISHFT, KISHFT.

ISHFTC(I, SHIFT, SIZE)

Optional argument

SIZE

Description

Performs a circular shift of the rightmost bits.

Class

Elemental function.

Arguments

I

must be of type integer.

SHIFT

must be of type integer. The absolute value of SHIFT must be less than or equal to SIZE.

SIZE (optional)

must be of type integer. The value of SIZE must be positive and must not exceed BIT_SIZE(I). If SIZE is absent, it is as if it were present with the value of BIT_SIZE(I).

Result type/
type parameters

Same as I.

Result value

The result has the value obtained by shifting the SIZE rightmost bits of I circularly by SHIFT positions.

If SHIFT is positive, the shift is to the left; if SHIFT is negative, the shift is to the right; and if SHIFT is zero, no shift is performed. No bits are lost. The unshifted bits are unaltered.

The model for the interpretation of an integer value as a sequence of bits is described in “The Bit Model”.

Specific forms

HSHFTC,ISHFTC, JISHFTC, KISHFTC.

ISIGN(A, B)

Description

Absolute value of A times the sign of B.

Class

Elemental nonstandard function.

Arguments

A

must be of type integer.

B

must be of type integer with the same kind type parameter as A.

Result type/
type parameters

Same as A.

Result value

The value of the result is |A| if B>= 0 and -|A| if B < 0.

ISNAN(X)

Description

Determine if a value is NaN (not a number).

Class

Elemental nonstandard function.

Argument

X must be of type real.

Result type

Logical.

IXOR(I, J)

Description

Exclusive OR.

Class

Elemental nonstandard function.

Arguments

I

must be of type integer.

J

must be of type integer with the same kind type parameter as I.

Result type/
type parameters

Same as I.

Result value

The result has the value obtained by performing an exclusive OR on I and J bit-by-bit according to Table 11-9 “Truth table for IXOR intrinsic”.

Table 11-9 Truth table for IXOR intrinsic

I

J

IXOR(I, J)

1

1

0

1

0

1

0

1

1

0

0

0

 

The model for interpreting an integer value as a sequence of bits is described in “The Bit Model”.

Specific forms

BIXOR, HIXOR, IIXOR, JIXOR.

IZEXT(A)

Description

Zero extend.

Class

Generic elemental nonstandard function.

Argument

A

must be of type INTEGER(1), INTEGER(2), LOGICAL(1), or LOGICAL(2).

Result type/
type parameters

The result is of type INTEGER(2).

Result

IZEXT converts A to INTEGER(2) by sign-extending zeroes instead of the actual sign bit.

JNUM(I)

Description

Convert character to integer type.

Class

Elemental nonstandard function.

Argument

I must be of type character.

Result

Integer type.

JZEXT(A)

Description

Zero extend.

Class

Generic elemental nonstandard function.

Argument

A

must be of type INTEGER(1), INTEGER(2), INTEGER(4), LOGICAL(1), LOGICAL(2), or LOGICAL(4).

Result type/
type parameters

The result is of type INTEGER(4).

Result

JZEXT converts A to INTEGER(4) by sign-extending zeroes instead of the actual sign bit.

KIND(X)

Description

Returns the value of the kind type parameter of X.

Class

Inquiry function.

Argument

X may be of any intrinsic type.

Result type,
type parameters,
and shape

Default integer scalar.

Result value

The result has a value equal to the kind type parameter value of X.

KZEXT(A)

Description

Zero extend.

Class

Generic elemental nonstandard function.

Argument

A

must be of type INTEGER(1), INTEGER(2), INTEGER(4), INTEGER(8), LOGICAL(1), LOGICAL(2), LOGICAL(4), or LOGICAL(8).

Result type/
type parameters

The result is of type INTEGER(8).

Result

KZEXT converts A to INTEGER(8) by sign-extending zeroes instead of the actual sign bit.

LBOUND(ARRAY, DIM)

Optional argument

DIM

Description

Returns all the lower bounds or a specified lower bound of an array.

Class

Inquiry function.

Arguments

ARRAY

may be of any type. It must not be scalar. It must not be a pointer that is disassociated or an allocatable array that is not allocated.

DIM (optional)

must be scalar and of type integer with a value in the range 1 <= DIM <= n, where n is the rank of ARRAY. The corresponding actual argument must not be an optional dummy argument.

Result type,
type parameters,
and shape

The result is of type default integer. It is scalar if DIM is present; otherwise, the result is an array of rank one and size n, where n is the rank of ARRAY.

Result value

Case 1

For an array section or for an array expression other than a whole array or array structure component, LBOUND(ARRAY, DIM) has the value 1. For a whole array or array structure component, LBOUND(ARRAY, DIM) has the value:

  • equal to the lower bound for subscript DIM of ARRAY if dimension DIM of ARRAY does not have extent zero or if ARRAY is an assumed-size array of rank DIM

    or

  • one (1), otherwise.

Case 2

LBOUND(ARRAY) has a value whose ith component is equal to LBOUND(ARRAY, i), for i= 1, 2, ..., n, where n is the rank of ARRAY.

Specific forms

KLBOUND.

LEN(STRING)

Description

Returns the length of a character entity.

Class

Inquiry function.

Argument

STRING must be of type character. It may be scalar or array valued.

Result type,
type parameters,
and shape

Default integer scalar.

Result value

The result has a value equal to the number of characters in STRING if it is scalar or in an element of STRING if it is array valued.

Specific forms

KLEN.

LEN_TRIM(STRING)

Description

Returns the length of the character argument without counting trailing blank characters.

Class

Elemental function.

Argument

STRING must be of type character.

Result type/
type parameter

Default integer.

Result value

The result has a value equal to the number of characters remaining after any trailing blanks in STRING are removed. If the argument contains no nonblank characters, the result is zero.

Specific forms

KLEN_TRIM.

LGE(STRING_A, STRING_B)

Description

Tests whether a string is lexically greater than or equal to another string, based on the ASCII collating sequence.

Class

Elemental function.

Arguments

STRING_A

must be of type default character.

STRING_B

must be of type default character.

Result type/
type parameters

Default logical.

Result value

If the strings are of unequal length, the comparison is made as if the shorter string were extended on the right with blanks to the length of the longer string.

If either string contains a character not in the ASCII character set, the result is processor dependent.

The result is .TRUE. if the strings are equal or if STRING_A follows STRING_B in the ASCII collating sequence; otherwise, the result is .FALSE. Note that the result is .TRUE. if both STRING_A and STRING_B are of zero length.

LGT(STRING_A, STRING_B)

Description

Tests whether a string is lexically greater than another string, based on the ASCII collating sequence.

Class

Elemental function.

Arguments

STRING_A

must be of type default character.

STRING_B

must be of type default character.

Result type/
type parameters

Default logical.

Result value

If the strings are of unequal length, the comparison is made as if the shorter string were extended on the right with blanks to the length of the longer string.

If either string contains a character not in the ASCII character set, the result is processor-dependent.

The result is .TRUE. if STRING_A follows STRING_B in the ASCII collating sequence; otherwise, the result is .FALSE.. Note that the result is .FALSE. if both STRING_A and STRING_B are of zero length.

LLE(STRING_A, STRING_B)

Description

Tests whether a string is lexically less than or equal to another string, based on the ASCII collating sequence.

Class

Elemental function.

Arguments

STRING_A

must be of type default character.

STRING_B

must be of type default character.

Result type/
type parameters

Default logical.

Result value

If the strings are of unequal length, the comparison is made as if the shorter string were extended on the right with blanks to the length of the longer string.

If either string contains a character not in the ASCII character set, the result is processor dependent.

The result is .TRUE. if the strings are equal or if STRING_A precedes STRING_B in the ASCII collating sequence; otherwise, the result is .FALSE.. Note that the result is .TRUE. if both STRING_A and STRING_B are of zero length.

LLT(STRING_A, STRING_B)

Description

Tests whether a string is lexically less than another string, based on the ASCII collating sequence.

Class

Elemental function.

Arguments

STRING_A

must be of type default character.

STRING_B

must be of type default character.

Result type/
type parameters

Default logical.

Result value

If the strings are of unequal length, the comparison is made as if the shorter string were extended on the right with blanks to the length of the longer string.

If either string contains a character not in the ASCII character set, the result is processor-dependent.

The result is .TRUE. if STRING_A precedes STRING_B in the ASCII collating sequence; otherwise, the result is .FALSE.. Note that the result is .FALSE. if both STRING_A and STRING_B are of zero length.

LOC(X)

Description

Return the address of the argument.

Class

Inquiry nonstandard function.

LOG(X)

Description

Natural logarithm.

Class

Elemental function.

Argument

X must be of type real or complex. If X is real, its value must be greater than zero. If X is complex, its value must not be zero.

Result type/
type parameter
s

Same as X.

Result value

The result has a value equal to a processor-dependent approximation to logex. A result of type complex is the principal value with imaginary part w in the range -Pi < w <= Pi. The imaginary part of the result is Pi only when the real part of the argument is less than zero and the imaginary part of the argument is zero.

Specific forms

ALOG, CDLOG, CLOG, DLOG, QLOG, ZLOG.

LOG10(X)

Description

Common logarithm.

Class

Elemental function.

Argument

X must be of type real. The value of X must be greater than zero.

Result type/
type parameters

Same as X.

Result value

The result has a value equal to a processor-dependent approximation to log10X.

Specific forms

ALOG10, DLOG10, QLOG10.

LOGICAL(L, KIND)

Optional argument

KIND

Description

Converts between kinds of logical.

Class

Elemental function.

Arguments

L

must be of type logical.

KIND (optional)

must be a scalar integer initialization expression.

Result type/
type parameters

Logical. If KIND is present, the kind type parameter is that specified by KIND; otherwise, the kind type parameter is that of default logical.

Result value

The value is that of L.

LSHFT(I, SHIFT)

Description

Left shift.

Class

Elemental nonstandard function.

LSHIFT(I, SHIFT)

Description

Left shift.

Class

Elemental nonstandard function.

MALLOC(SIZE)

Description

Allocate a block of memory.

Class

Transformational nonstandard function.

MATMUL(MATRIX_A, MATRIX_B)

Description

Performs matrix multiplication of numeric or logical matrices.

Class

Transformational function.

Arguments

MATRIX_A

must be of numeric type (integer, real, or complex) or of logical type. It must be array valued and of rank one or two.

MATRIX_B

must be of numeric type if MATRIX_A is of numeric type and of logical type if MATRIX_A is of logical type. It must be array valued and of rank one or two.

If MATRIX_A has rank one, MATRIX_B must have rank two. If MATRIX_B has rank one, MATRIX_A must have rank two. The size of the first (or only) dimension of MATRIX_B must equal the size of the last (or only) dimension of MATRIX_A.

Result type,
type parameters,
and shape

If the arguments are of numeric type, the type and kind type parameter of the result are determined by the types of MATRIX_A and MATRIX_B.

If the arguments are of type logical, the result is of type logical with the kind type parameter of the arguments.

The shape of the result depends on the shapes of the arguments as follows:

Case 1

If MATRIX_A has shape [n, m] and MATRIX_B has shape [m, k], the result has shape [n, k].

Case 2

If MATRIX_A has shape [m] and MATRIX_B has shape [m, k], the result has shape [k].

Case 3

If MATRIX_A has shape [n, m] and MATRIX_B has shape [m], the result has shape [n].

Result value

Case 1

Element (i, j) of the result has the value SUM(MATRIX_A(i,:) * MATRIX_B(:, j)) if the arguments are of numeric type and has the value ANY(MATRIX_A(i, :) .AND. MATRIX_B(:, j)) if the arguments are of logical type.

Case 2

Element (j) of the result has the value SUM(MATRIX_A(:) * MATRIX_B(:, j)) if the arguments are of numeric type and has the value ANY(MATRIX_A(:) .AND. MATRIX_B(:, j)) if the arguments are of logical type.

Case 3

Element (i) of the result has the value SUM(MATRIX_A(i, :) * MATRIX_B(:)) if the arguments are of numeric type and has the value ANY(MATRIX_A(i, :) .AND. MATRIX_B(:)) if the arguments are of logical type.

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

Optional arguments

A3, ...

Description

Maximum value.

Class

Elemental function.

Arguments

The arguments must all have the same type which must be integer or real, and they must all have the same kind type parameter.

Result type/
type parameters

Same as the arguments.

Result value

The value of the result is that of the largest argument.

Specific forms

AIMAX0,AJMAX0, AKMAX0, AMAX0, AMAX1, DMAX1, IMAX0, IMAX1, JMAX0, JMAX1, KMAX0, KMAX1, MAX0, MAX1, QMAX1.

MAXEXPONENT(X)

Description

Returns the maximum exponent in the model representing numbers of the same type and kind type parameter as the argument.

Class

Inquiry function.

Argument

X must be of type real. It may be scalar or array valued.

Result type,
type parameters,
and shape

Default integer scalar.

Result value

The result has the value emax, as defined in “The Real Number System Model”.

Specific forms

KMAXLOC.

MAXLOC(ARRAY, MASK)

Optional argument

MASK

Description

Returns the location of the first element of ARRAY having the maximum value of the elements identified by MASK.

Class

Transformational function.

Arguments

ARRAY

must be of type integer or real. It must not be scalar.

MASK (optional)

must be of type logical and must be conformable with ARRAY.

Result type,
type parameters,
and shape

The result is of type default integer; it is an array of rank one and of size equal to the rank of ARRAY.

Result value

Case 1

If MASK is absent, the result is a rank-one array whose element values are the values of the subscripts of an element of ARRAY whose value equals the maximum value of all of the elements of ARRAY.

The ith subscript returned lies in the range 1 to ei, where ei is the extent of the ith dimension of ARRAY.

If more than one element has the maximum value, the element whose subscripts are returned is the first such element, taken in array element order. If ARRAY has size zero, the value of the result is processor-dependent.

Case 2

If MASK is present, the result is a rank-one array whose element values are the values of the subscripts of an element of ARRAY, corresponding to a .TRUE. element of MASK, whose value equals the maximum value of all such elements of ARRAY.

The ith subscript returned lies in the range 1 to ei, where ei is the extent of the ith dimension of ARRAY.

If more than one such element has the maximum value, the element whose subscripts are returned is the first such element taken in array element order.

If there are no such elements (that is, if ARRAY has size zero or every element of MASK has the value .FALSE.), the value of the result is processor-dependent.

In both cases, an element of the result is undefined if the processor cannot represent the value as a default integer.

MAXVAL(ARRAY, DIM, MASK)

Optional arguments

DIM, MASK

Description

Maximum value of the elements of ARRAY along dimension DIM that correspond to the .TRUE. elements of MASK.

Class

Transformational function.

Arguments

ARRAY

must be of type integer or real. It must not be scalar.

DIM (optional)

must be scalar and of type integer with a value in the range 1 <= DIM <= n where n is the rank of ARRAY. The corresponding actual argument must not be an optional dummy argument.

MASK (optional)

must be of type logical and must be conformable with ARRAY.

Result type,
type parameters,
and shape

The result is of the same type and kind type parameter as ARRAY.

It is scalar if DIM is absent or ARRAY has rank one; otherwise, the result is an array of rank n-1 and of shape (d1, d2, ..., dDIM-1, dDIM+1, ..., dn) where (d1, d2, ..., dn) is the shape of ARRAY.

Result value

Case 1

The result of MAXVAL(ARRAY) has a value equal to the maximum value of all the elements of ARRAY or has the value of the negative number of the largest magnitude supported by the processor for numbers of the type and kind type parameter of ARRAY if ARRAY has size zero.

Case 2

The result of MAXVAL(ARRAY, MASK = MASK) has a value equal to the maximum value of the elements of ARRAY corresponding to .TRUE. elements of MASK or has the value of the negative number of the largest magnitude supported by the processor for numbers of the same type and kind type parameter as ARRAY if there are no .TRUE. elements.

Case 3

If ARRAY has rank one, MAXVAL(ARRAY, DIM [,MASK]) has a value equal to that of MAXVAL(ARRAY [,MASK = MASK]). Otherwise, the value of element (s1, s2, ..., sDIM-1, sDIM+1, ..., sn) of MAXVAL(ARRAY, DIM [,MASK]) is equal to the following:

MAXVAL(ARRAY(s1, s2, ..., sDIM-1, :, sDIM+1, ..., sn) [, MASK = MASK(s1, s2, ..., sDIM-1, :, sDIM+1, ..., sn) ] )

MCLOCK()

Description

Return time accounting for a program.

Class

Inquiry nonstandard function.

Result type

Integer.

Result value

The value returned, in units of microseconds, is the sum of the current process’s user time and the user and system time of all its child processes.

MERGE(TSOURCE, FSOURCE, MASK)

Description

Choose alternative value according to the value of a mask.

Class

Elemental function.

Arguments

TSOURCE

may be of any type.

FSOURCE

must be of the same type and type parameters as TSOURCE.

MASK

must be of type logical.

Result type/
type parameters

Same as TSOURCE.

Result value

The result is TSOURCE if MASK is .TRUE. and FSOURCE otherwise.

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

Optional arguments

A3, ...

Description

Minimum value.

Class

Elemental function.

Arguments

The arguments must all be of the same type, which must be integer or real, and they must all have the same kind type parameter.

Result type/
type parameters

Same as the arguments.

Result value

The value of the result is that of the smallest argument.

Specific forms

AIMIN0, AJMIN0, AKMIN0, AMIN0, AMIN1, DMIN1, IMIN0, IMIN1, JMIN0, JMIN1, KMIN0, KMIN1, MIN0, MIN1, QMIN1.

MINEXPONENT(X)

Description

Returns the minimum exponent in the model representing numbers of the same type and kind type parameter as the argument.

Class

Inquiry function.

Argument

X must be of type real. It may be scalar or array valued.

Result type,
type parameters,
and shape

Default integer scalar.

Result value

The result has the value emin, as defined in “The Real Number System Model”.

MINLOC(ARRAY, MASK)

Optional argument

MASK

Description

Returns the location of the first element of ARRAY having the minimum value of the elements identified by MASK.

Class

Transformational function.

Arguments

ARRAY

must be of type integer or real. It must not be scalar.

MASK (optional)

must be of type logical and must be conformable with ARRAY.

Result type,
type parameters,
and shape

The result is of type default integer; it is an array of rank one and of size equal to the rank of ARRAY.

Result value

Case 1

If MASK is absent, the result is a rank-one array whose element values are the values of the subscripts of an element of ARRAY whose value equals the minimum value of all the elements of ARRAY.

The ith subscript returned lies in the range 1 to ei, where ei is the extent of the ith dimension of ARRAY.

If more than one element has the minimum value, the element whose subscripts are returned is the first such element, taken in array element order. If ARRAY has size zero, the value of the result is processor-dependent.

Case 2

If MASK is present, the result is a rank-one array whose element values are the values of the subscripts of an element of ARRAY, corresponding to a .TRUE. element of MASK, whose value equals the minimum value of all such elements of ARRAY.

The ith subscript returned lies in the range 1 to ei, where ei is the extent of the ith dimension of ARRAY. If more than one such element has the minimum value, the element whose subscripts are returned is the first such element taken in array element order.

If ARRAY has size zero or every element of MASK has the value .FALSE., the value of the result is processor-dependent.

In both cases, an element of the result is undefined if the processor cannot represent the value as a default integer.

Specific forms

KMINLOC.

MINVAL(ARRAY, DIM, MASK)

Optional argument

DIM, MASK

Description

Minimum value of all the elements of ARRAY along dimension DIM corresponding to .TRUE. elements of MASK.

Class

Transformational function.

Arguments

ARRAY

must be of type integer or real. It must not be scalar.

DIM (optional)

must be scalar and of type integer with a value in the range 1 <= DIM <= n, where n is the rank of ARRAY. The corresponding actual argument must not be an optional dummy argument.

MASK (optional)

must be of type logical and must be conformable with ARRAY.

Result type,
type parameters,
and shape

The result is of the same type and kind type parameter as ARRAY. It is scalar if DIM is absent or ARRAY has rank one; otherwise, the result is an array of rank n-1 and of shape (d1, d2, ..., dDIM-1, dDIM+1, ..., dn) where (d1, d2, ..., dn) is the shape of ARRAY.

Result value

Case 1

The result of MINVAL(ARRAY) has a value equal to the minimum value of all the elements of ARRAY or has the value of the positive number of the largest magnitude supported by the processor for numbers of the type and kind type parameter of ARRAY if ARRAY has size zero.

Case 2

The result of MINVAL(ARRAY, MASK = MASK) has a value equal to the minimum value of the elements of ARRAY corresponding to .TRUE. elements of MASK or has the value of the positive number of the largest magnitude supported by the processor for numbers of the same type and kind type parameter as ARRAY if there are no .TRUE. elements.

Case 3

If ARRAY has rank one, MINVAL(ARRAY, DIM [,MASK]) has a value equal to that of MINVAL(ARRAY [,MASK = MASK]). Otherwise, the value of element (s1, s2, ..., sDIM-1, sDIM+1, ..., sn) of MINVAL(ARRAY, DIM [,MASK]) is equal to the following:

MINVAL(ARRAY(s1, s2, ..., sDIM-1, :, sDIM+1, ..., sn) [, MASK= MASK(s1, s2, ..., sDIM-1, :, sDIM+1, ..., sn) ] )

MOD(A, P)

Description

Remainder function.

Class

Elemental function.

Arguments

A

must be of type integer or real.

P

must be of the same type and kind type parameter as A.

Result type/
type parameters

Same as A.

Result value

If P is not 0, the value of the result is A - INT(A/P) * P. If P=0, the result is processor-dependent.

Specific forms

AMOD, BMOD, DMOD, HMOD, IMOD, JMOD, KMOD, QMOD.

MODULO(A, P)

Description

Modulo function.

Class

Elemental function.

Arguments

A

must be of type integer or real.

P

must be of the same type and kind type parameter as A.

Result type/
type parameters

Same as A.

Result value

Case 1

A is of type integer. If P is not 0, MODULO(A, P) has the value R such that A = Q * P + R, where Q is an integer, the inequalities 0 <= R<P hold if P>0, and P<R <= 0 hold if P<0. If P=0, the result is processor-dependent.

Case 2

A is of type real. If P is not 0, the value of the result is A -FLOOR (A / P) * P. If P=0, the result is processor-dependent.

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

Description

Copies a sequence of bits from one data object to another.

Class

Elemental subroutine.

Arguments

FROM

must be of type integer. It is an INTENT(IN) argument.

FROMPOS

must be of type integer and nonnegative. It is an INTENT(IN) argument. FROMPOS + LEN must be less than or equal to BIT_SIZE(FROM). The model for the interpretation of an integer value as a sequence of bits is described in “The Bit Model”.

LEN

must be of type integer and nonnegative. It is an INTENT(IN) argument.

TO

must be a variable of type integer with the same kind type parameter value as FROM and may be the same variable as FROM. It is an INTENT(INOUT) argument.

TO is set by copying the sequence of bits of length LEN, starting at position FROMPOS of FROM to position TOPOS of TO. No other bits of TO are altered. On return, the LEN bits of TO starting at TOPOS are equal to the value that the LEN bits of FROM starting at FROMPOS had on entry.

The model for the interpretation of an integer value as a sequence of bits is described in “The Bit Model”.

TOPOS

must be of type integer and nonnegative. It is an INTENT(IN) argument. TOPOS + LEN must be less than or equal to BIT_SIZE(TO).

Specific forms

BMVBITS, HMVBITS.

NEAREST(X, S)

Description

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

Class

Elemental function.

Arguments

X

must be of type real.

S

must be of type real and not equal to zero.

Result type/
type parameters

Same as X.

Result value

The result has a value equal to the machine representable number distinct from X and nearest to it in the direction of the infinity with the same sign as S.

NINT(A, KIND)

Optional argument

KIND

Description

Nearest integer.

Class

Elemental function.

Arguments

A

must be of type real.

KIND (optional)

must be a scalar integer initialization expression.

Result type/
type parameters

Integer. If KIND is present, the kind type parameter is that specified by KIND; otherwise, the kind type parameter is that of default integer type.

Result value

If A>0, NINT(A) has the value INT(A+0.5); if A <= 0, NINT(A) has the value INT(A-0.5). The result is undefined if the processor cannot represent the result in the specified integer type.

Specific forms

IDNINT, IIDNNT,IIQNNT, ININT, IQNINT, JIDNNT,JIQNNT, JNINT, KIDNNT, KIQNNT, KNINT.

NOT(I)

Description

Performs a bitwise logical complement.

Class

Elemental function.

Argument

I must be of type integer.

Result type/
type parameters

Same as I.

Result value

The result has the value obtained by complementing I bit-by-bit according to the following truth table:

Table 11-10 Truth table for NOT intrinsic

I

NOT(I)

1

0

0

1

 

The model for the interpretation of an integer value as a sequence of bits is described in “The Bit Model”.

Specific forms

BNOT, HNOT, INOT, JNOT, KNOT.

OR(I, J)

Description

Bitwise logical OR.

Class

Elemental nonstandard function.

Arguments

I

must be of type integer.

J

must be of type integer with the same kind type parameter as I.

Result type/
type parameters

Same as I.

Result value

The result has the value obtained by performing an OR on I and J bit-by-bit according to the following truth table:

Table 11-11 Truth table for OR intrinsic

I

J

OR(I, J)

1

1

1

1

0

1

0

1

1

0

0

0

 

The model for interpreting an integer value as a sequence of bits is described in “The Bit Model”.

PACK(ARRAY, MASK, VECTOR)

Optional argument

VECTOR

Description

Pack an array into an array of rank one under the control of a mask.

Class

Transformational function.

Arguments

ARRAY

may be of any type. It must not be scalar.

MASK

must be of type logical and must be conformable with ARRAY.

VECTOR (optional)

must be of the same type and type parameters as ARRAY and must have rank one. VECTOR must have at least as many elements as there are .TRUE. elements in MASK. If MASK is scalar with the value .TRUE., VECTOR must have at least as many elements as there are in ARRAY.

Result type,
type parameters,
and shape

The result is an array of rank one with the same type and type parameters as ARRAY. If VECTOR is present, the result size is that of VECTOR; otherwise, the result size is the number t of .TRUE. elements in MASK unless MASK is scalar with the value .TRUE., in which case the result size is the size of ARRAY.

Result value

Element i of the result is the element of ARRAY that corresponds to the ith .TRUE. element of MASK, taking elements in array element order, for i= 1, 2, ..., t. If VECTOR is present and has size n>t, element i of the result has the value VECTOR (i), for i= t+1, ..., n.

Specific forms

KPACK.

PRECISION(X)

Description

Returns the decimal precision in the model representing real numbers with the same kind type parameter as the argument.

Class

Inquiry function.

Argument

X must be of type real or complex. It may be scalar or array valued.

Result type,
type parameters,
and shape

Default integer scalar.

Result value

The result has the value INT((p-1) * LOG10(b))+k. The values of b and p are as defined in “The Real Number System Model” for the model representing real numbers with the same kind type parameter as X. The value of k is 1 if b is an integral power of 10 and 0 otherwise.

PRESENT(A)

Description

Determine whether an optional argument is present.

Class

Inquiry function.

Argument

A must be the name of an optional dummy argument that is accessible in the procedure in which the PRESENT function reference appears.

Result type/
type parameters

Default logical scalar.

Result value

The result has the value .TRUE. if A is present and otherwise has the value .FALSE.

PRODUCT(ARRAY, DIM, MASK)

Optional arguments

DIM, MASK

Description

Product of all the elements of ARRAY along dimension DIM corresponding to the .TRUE. elements of MASK.

Class

Transformational function.

Arguments

ARRAY

must be of type integer, real, or complex. It must not be scalar.

DIM (optional)

must be scalar and of type integer with a value in the range 1 <= DIM <= n, where n is the rank of ARRAY. The corresponding actual argument must not be an optional dummy argument.

MASK (optional)

must be of type logical and must be conformable with ARRAY.

Result type,
type parameters,
and shape

The result is of the same type and kind type parameter as ARRAY. It is scalar if DIM is absent or ARRAY has rank one; otherwise, the result is an array of rank n-1 and of shape (d1, d2, ..., dDIM-1, dDIM+1, ..., dn) where (d1, d2, ..., dn) is the shape of ARRAY.

Result value

Case 1

The result of PRODUCT(ARRAY) has a value equal to a processor-dependent approximation to the product of all the elements of ARRAY or has the value one if ARRAY has size zero.

Case 2

The result of PRODUCT(ARRAY, MASK = msk) has a value equal to a processor-dependent approximation to the product of the elements of ARRAY corresponding to the .TRUE. elements of msk or has the value one if there are no .TRUE. elements.

Case 3

If ARRAY has rank one, PRODUCT(ARRAY, DIM [,msk]) has a value equal to that of PRODUCT(ARRAY [,MASK = msk]). Otherwise, the value of element (s1, s2, ..., sDIM-1, sDIM+1, ..., sn) of PRODUCT(ARRAY, DIM [,msk]) is equal to the following:

PRODUCT(ARRAY(s1, s2, ..., sDIM-1, :, sDIM+1, ..., sn) &
[, MASK = msk(s1, s2, ..., sDIM-1, :, sDIM+1, ..., sn)])

QEXT(A)

Description

Convert to REAL(16) type.

Class

Elemental nonstandard function.

Argument

A must be of type integer, real, double precision, or complex.

Result

REAL(16).

Specific forms

QEXTD.

QFLOAT(A)

Description

Convert to REAL(16) type.

Class

Elemental nonstandard function.

Argument

A must be of type integer or REAL(4).

Result

REAL(16).

Specific forms

QFLOATI, QFLOTI, QFLOTJ, QFLOTK.

QNUM(I)

Description

Convert character to REAL(16) type.

Class

Elemental nonstandard function.

Argument

I must be of type character.

Result

REAL(16) type.

QPROD(X, Y)

Description

Double precision product.

Class

Elemental nonstandard function.

Arguments

X and Y must be of type double precision.

Result

REAL(16) type.

RADIX(X)

Description

Returns the base of the model representing numbers of the same type and kind type parameter as the argument.

Class

Inquiry function.

Argument

X must be of type integer or real. It may be scalar or array valued.

Result type,
type parameters,
and shape

Default integer scalar.

Result value

The result has the value r if X is of type integer and the value b if X is of type real, where r and b are as defined in “The Real Number System Model”.

RAN(ISEED)

Description

Multiplicative congruent random number generator.

Class

Elemental nonstandard function.

Argument

ISEED must be an INTEGER(4) variable or array element. RAN stores a number in ISEED to be used by the next call to RAN.

ISEED should initially be set to an odd number, preferably very large; see the following example.

Result type/
type parameters

REAL(4) type.

NOTE: To ensure different random values for each run of a program, ISEED should be set to a different value each time the program is run. One way to implement this would be to have the user enter the seed at the start of the program. Another way would be to compute a value from the current year, day, and month (returned by IDATE) and the number of seconds since midnight (returned by SECNDS).

RAND()

Description

Generate successive pseudorandom numbers uniformly distributed in the range of 0.0 to 1.0.

Class

Elemental nonstandard function.

Result type/
type parameters

REAL(4) type.

NOTE: For details about restarting the pseudorandom number generator used by IRAND and RAND, see “SRAND(ISEED)” section.

RANDOM_NUMBER(HARVEST)

Description

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

Class

Subroutine.

Argument

HARVEST must be of type real. It is an INTENT(OUT) argument. It may be a scalar or an array variable. It is set to contain pseudorandom numbers from the uniform distribution in the interval 0 <= x < 1.

RANDOM_SEED(SIZE, PUT, GET)

Optional arguments

SIZE, PUT, GET

Description

Restarts or queries the pseudorandom number generator used by RANDOM_NUMBER.

Class

Subroutine.

Arguments

There must either be exactly one or no arguments present.

SIZE (optional)

must be scalar and of type default integer. It is an INTENT(OUT) argument. It is set to the number N of integers that the processor uses to hold the value of the seed.

PUT (optional)

must be a default integer array of rank one and size >= N. It is an INTENT(IN) argument. It is used by the processor to set the seed value.

GET (optional)

must be a default integer array of rank one and size >= N. It is an INTENT(OUT) argument. It is set by the processor to the current value of the seed. If no argument is present, the processor sets the seed to a processor-dependent value.

RANGE(X)

Description

Returns the decimal exponent range in the model representing integer or real numbers with the same kind type parameter as the argument.

Class

Inquiry function.

Argument

X must be of type integer, real, or complex. It may be scalar or array valued.

Result type,
type parameters,
and shape

Default integer scalar.

Result value

Case 1

For an integer argument, the result has the value INT(LOG10(huge)), where huge is the largest positive integer in the model representing integer numbers with same kind type parameter as X. See “The Integer Number System Model” for more information.

Case 2

For a real or complex argument, the result has the value INT(MIN(LOG10(huge), -LOG10(tiny))), where huge and tiny are the largest and smallest positive numbers in the model representing real numbers with the same value for the kind type parameter as X. See “The Real Number System Model” for more information.

Example

RANGE(X) has the value 38 for real X, whose model is described in “The Real Number System Model”, because in this case huge= (1 - 2-24) * 2127 and tiny = 2-127.

Specific forms

SNGL, SNGLQ.

REAL(A, KIND)

Optional argument

KIND

Description

Convert to real type.

Class

Elemental function.

Arguments

A

must be of type integer, real, or complex.

KIND (optional)

must be a scalar integer initialization expression.

Result type/
type parameters

Real.

Case 1

If A is of type integer or real and KIND is present, the kind type parameter is that specified by KIND.

If A is of type integer or real and KIND is not present, the kind type parameter is the processor-dependent kind type parameter for the default real type.

Case 2

If A is of type complex and KIND is present, the kind type parameter is that specified by KIND.

If A is of type complex and KIND is not present, the kind type parameter is the kind type parameter of A.

Result value

Case 1

If A is of type integer or real, the result is equal to a processor-dependent approximation to A.

Case 2

If A is of type complex, the result is equal to a processor-dependent approximation to the real part of A.

Specific forms

FLOAT, FLOATI, FLOATJ, FLOATK.

REPEAT(STRING, NCOPIES)

Description

Concatenate several copies of a string.

Class

Transformational function.

Arguments

STRING

must be scalar and of type character.

NCOPIES

must be scalar and of type integer. Its value must not be negative.

Result type,
type parameters,
and shape

Character scalar of length NCOPIES times that of STRING, with the same kind type parameter as STRING.

Result value

The value of the result is the concatenation of NCOPIES copies of STRING.

Specific forms

KREPEAT.

RESHAPE(SOURCE, SHAPE, PAD, ORDER)

Optional arguments

PAD, ORDER

Description

Constructs an array of a specified shape from the elements of a given array.

Class

Transformational function.

Arguments

SOURCE

may be of any type. It must be array valued. If PAD is absent or of size zero, the size of SOURCE must be greater than or equal to PRODUCT(SHAPE). The size of the result is the product of the values of the elements of SHAPE.

SHAPE

must be of type integer, rank one, and constant size. Its size must be positive and less than 8. It must not have an element whose value is negative.

PAD (optional)

must be of the same type and type parameters as SOURCE. PAD must be array valued.

ORDER (optional)

must be of type integer, must have the same shape as SHAPE, and its value must be a permutation of [1, 2, ..., n], where n is the size of SHAPE. If absent, it is as if it were present with value [1, 2, ..., n].

Result type,
type parameters,
and shape

The result is an array of shape SHAPE (that is, SHAPE(RESHAPE(SOURCE, SHAPE, PAD, ORDER)) is equal to SHAPE) with the same type and type parameters as SOURCE.

Result value

The elements of the result, taken in permuted subscript order ORDER(1), ..., ORDER(n), are those of SOURCE in normal array element order followed if necessary by those of PAD in array element order, followed if necessary by additional copies of PAD in array element order.

Specific forms

KRESHAPE.

RNUM(I)

Description

Convert character to real type.

Class

Elemental nonstandard function.

Argument

I must be of type character.

Result

Default real type.

RRSPACING(X)

Description

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

Class

Elemental function.

Argument

X must be of type real.

Result type/
type parameters

Same as X.

Result value

The result has the value |X * b-e| * bp, where b, e, and p are as defined in “The Real Number System Model”.

RSHFT(I, SHIFT)

Description

Bitwise right shift.

Class

Elemental nonstandard function.

RSHIFT(I, SHIFT)

Description

Bitwise right shift.

Class

Elemental nonstandard function.

SCALE(X, I)

Description

Returns X * bI where b is the base in the model representation of X. See “The Real Number System Model” for a description of this.

Class

Elemental function.

Arguments

X

must be of type real.

I

must be of type integer.

Result type/
type parameters

Same as X.

Result value

The result has the value X * bI, where b is defined in “The Real Number System Model”, provided this result is within range; if not, the result is processor dependent.

SCAN(STRING, SET, BACK)

Optional argument

BACK

Description

Scan a string for any one of the characters in a set of characters.

Class

Elemental function.

Arguments

STRING

must be of type character.

SET

must be of type character with the same kind type parameter as STRING.

BACK (optional)

must be of type logical.

Result type/
type parameters

Default integer.

Result value

Case 1

If BACK is absent or is present with the value .FALSE. and if STRING contains at least one character that is in SET, the value of the result is the position of the leftmost character of STRING that is in SET.

Case 2

If BACK is present with the value .TRUE. and if STRING contains at least one character that is in SET, the value of the result is the position of the rightmost character of STRING that is in SET.

Case 3

The value of the result is zero if no character of STRING is in SET or if the length of STRING or SET is zero.

SECNDS(X)

Description

Return the number of seconds that have elapsed since midnight, less the value of the argument.

Class

Elemental nonstandard function.

Argument

X must be of type REAL(4).

Result type/
type parameters

REAL(4).

NOTE: SECNDS is accurate to one one-hundredth of a second (0.01 second). The SECNDS routine is useful for computing elapsed time for a code’s execution.

SELECTED_INT_KIND(R)

Description

Returns a value of the kind type parameter of an integer data type that represents all integer values n with -10R < n < 10R.

Class

Transformational function.

Argument

R must be scalar and of type integer.

Result type,
type parameters,
and shape

Default integer scalar.

Result value

The result has a value equal to the value of the kind type parameter of an integer data type that represents all values n in the range of values n with -10R < n < 10R, or if no such kind type parameter is available on the processor, the result is -1.

If more than one kind type parameter meets the criteria, the value returned is the one with the smallest decimal exponent range, unless there are several such values, in which case the smallest of these kind values is returned.

SELECTED_REAL_KIND(P, R)

Optional arguments

P, R

Description

Returns a value of the kind type parameter of a real data type with decimal precision of at least P digits and a decimal exponent range of at least R.

Class

Transformational function.

Arguments

At least one argument must be present.

P (optional)

must be scalar and of type integer.

R (optional)

must be scalar and of type integer.

Result type,
type parameters,
and shape

Default integer scalar.

Result value

The result has a value equal to a value of the kind type parameter of a real data type with decimal precision, as returned by the function PRECISION, of at least P digits and a decimal exponent range, as returned by the function RANGE, of at least R.

If no such kind type parameter is available on the processor, the result is -1 if the precision is not available, -2 if the exponent range is not available, and -3 if neither is available.

If more than one kind type parameter value meets the criteria, the value returned is the one with the smallest decimal precision, unless there are several such values, in which case the smallest of these kind values is returned.

SET_EXPONENT(X, I)

Description

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

Class

Elemental function.

Arguments

X

must be of type real.

I

must be of type integer.

Result type/
type parameters

Same as X.

Result value

The result has the value X * bI-e, where b and e are as defined in “The Real Number System Model”, provided this result is within range; if not, the result is processor-dependent.

If X has value zero, the result has value zero.

SHAPE(SOURCE)

Description

Returns the shape of an array or a scalar.

Class

Inquiry function.

Argument

SOURCE may be of any type. It may be array valued or scalar. It must not be a pointer that is disassociated or an allocatable array that is not allocated. It must not be an assumed-size array.

Result type,
type parameters,
and shape

The result is a default integer array of rank one whose size is equal to the rank of SOURCE.

Result value

The value of the result is the shape of SOURCE.

Specific forms

KSHAPE.

SIGN(A, B)

Description

Absolute value of A times the sign of B.

Class

Elemental function.

Arguments

A

must be of type integer or real.

B

must be of the same type and kind type parameter as A.

Result type/
type parameters

Same as A.

Result value

The value of the result is |A| if B>= 0 and -|A| if B < 0.

Specific forms

BSIGN, DSIGN, HSIGN, IISIGN, JSIGN, QSIGN, KISIGN.

SIN(X)

Description

Sine function in radians.

Class

Elemental function.

Argument

X must be of type real or complex.

Result type/
type parameters

Same as X.

Result value

The result has a value equal to a processor-dependent approximation to sin(X).

  • If X is of type real, it is regarded as a value in radians.

  • If X is of type complex, its real part is regarded as a value in radians.

Specific forms

CDSIN, CSIN, DSIN, QSIN, ZSIN.

SIND(X)

Description

Sine function in degrees.

Class

Elemental nonstandard function.

Argument

X must be of type real.

Result type/
type parameters

Same as X.

Result value

The result has a value equal to a processor-dependent approximation to sin(X).

Specific forms

QSIND.

SINH(X)

Description

Hyperbolic sine function.

Class

Elemental function.

Argument

X must be of type real.

Result type/
type paramete
rs

Same as X.

Result value

The result has a value equal to a processor-dependent approximation to sinh(X).

Specific forms

QSINH.

SIZE(ARRAY, DIM)

Optional argument

DIM

Description

Returns the extent of an array along a specified dimension or the total number of elements in the array.

Class

Inquiry function.

Arguments

ARRAY

may be of any type. It must not be scalar. It must not be a pointer that is disassociated or an allocatable array that is not allocated. If ARRAY is an assumed-size array, DIM must be present with a value less than the rank of ARRAY.

DIM (optional)

must be scalar and of type integer with a value in the range 1 <= DIM <= n, where n is the rank of ARRAY.

Result type,
type parameters,
and shape

Default integer scalar.

Result value

The result has a value equal to the extent of dimension DIM of ARRAY or, if DIM is absent, the total number of elements of ARRAY.

Specific forms

KSIZE.

SIZEOF(A)

Description

Return the number of bytes of storage used by the argument.

Class

Inquiry nonstandard function.

Argument

A may be of any type (except assumed-size arrays or passed-length character arguments).

Result type

Integer.

SPACING(X)

Description

Returns the absolute spacing of model numbers near the argument value.

Class

Elemental function.

Argument

X must be of type real.

Result type/
type parameters

Same as X.

Result value

If X is not zero, the result has the value be-p, where b, e, and p are as defined in “The Real Number System Model”, provided this result is within range; otherwise, the result is the same as that of TINY(X).

SPREAD(SOURCE, DIM, NCOPIES)

Description

Replicates an array by adding a dimension. Broadcasts several copies of SOURCE along a specified dimension (as in forming a book from copies of a single page) and thus forms an array of rank one greater.

Class

Transformational function.

Arguments

SOURCE

may be of any type. It may be scalar or array valued. The rank of SOURCE must be less than 7.

DIM

must be scalar and of type integer with value in the range 1 <= DIM <= n + 1, where n is the rank of SOURCE.

NCOPIES

must be scalar and of type integer.

Result type,
type parameters,
and shape

The result is an array of the same type and type parameters as SOURCE and of rank n + 1, where n is the rank of SOURCE.

Case 1

If SOURCE is scalar, the shape of the result is (MAX(NCOPIES, 0)).

Case 2

If SOURCE is array valued with shape (d1, d2, ..., dn), the shape of the result is (d1, d2, ..., dDIM-1, MAX(NCOPIES, 0), dDIM, ..., dn).

Result value

Case 1

If SOURCE is scalar, each element of the result has a value equal to SOURCE.

Case 2

If SOURCE is array valued, the element of the result with subscripts (r1, r2, ..., rn+1) has the value SOURCE(r1, r2, ..., rDIM-1, rDIM+1, ..., rn+1).

SQRT(X)

Description

Square root.

Class

Elemental function.

Argument

X must be of type real or complex. If X is real, its value must be greater than or equal to zero.

Result type/
type parameters

Same as X.

Result value

The result has a value equal to a processor-dependent approximation to the square root of X.

A result of type complex is the principal value with the real part greater than or equal to zero. When the real part of the result is zero, the imaginary part is greater than or equal to zero.

Specific forms

CDSQRT,CSQRT, DSQRT, QSQRT, ZSQRT.

SRAND(ISEED)

Description

Restart the pseudorandom number generator used by IRAND and RAND.

Class

Elemental nonstandard subroutine.

Argument

ISEED must be of INTEGER(4) type.

The same value for ISEED generates the same sequence of random numbers. To vary the sequence, call SRAND with a different ISEED value each time the program is executed. The default for ISEED is 1.

SUM(ARRAY, DIM, MASK)

Optional arguments

DIM, MASK

Description

Sum all the elements of ARRAY along dimension DIM corresponding to the .TRUE. elements of MASK.

Class

Transformational function.

Arguments

ARRAY

must be of type integer, real, or complex. It must not be scalar.

DIM (optional)

must be scalar and of type integer with a value in the range 1 <= DIM <= n, where n is the rank of ARRAY. The corresponding actual argument must not be an optional dummy argument.

MASK (optional)

must be of type logical and must be conformable with ARRAY.

Result type,
type parameters,
and shape

The result is of the same type and kind type parameter as ARRAY. It is scalar if DIM is absent of ARRAY has rank one; otherwise, the result is an array of rank n-1 and of shape (d1, d2, ..., dDIM-1, dDIM+1, ..., dn) where (d1, d2, ..., dn) is the shape of ARRAY.

Result value

Case 1

The result of SUM(ARRAY) has a value equal to a processor-dependent approximation to the sum of all the elements of ARRAY or has the value zero if ARRAY has size zero.

Case 2

The result of SUM(ARRAY, MASK = msk) has a value equal to a processor-dependent approximation to the sum of the elements of ARRAY corresponding to the .TRUE. elements of msk or has the value zero if there are no .TRUE. elements.

Case 3

If ARRAY has rank one, SUM(ARRAY, DIM [,msk]) has a value equal to that of SUM(ARRAY [,MASK = msk]). Otherwise, the value of element (s1, s2, ..., sDIM-1, sDIM+1, ..., sn) of SUM(ARRAY, DIM [,msk]) is equal to the following:

SUM(ARRAY(s1, s2, ..., sDIM-1, :, sDIM+1, ..., sn) &
[, MASK=msk(s1, s2, ..., sDIM-1, :, sDIM+1, ..., sn)])

SYSTEM(STR)

Description

Issue a shell command from a Fortran 90 program.

Class

Nonstandard subroutine.

Argument

STR must be of type character. SYSTEM gives STR to the default shell (/bin/sh) as input, as if the string were entered at a terminal. When the shell has completed, the process continues.

SYSTEM_CLOCK(COUNT, COUNT_RATE, COUNT_MAX)

Optional arguments

COUNT, COUNT_RATE, COUNT_MAX

Description

Returns integer data from a real-time clock.

Class

Subroutine.

Arguments

COUNT (optional)

must be scalar and of type default integer. It is an INTENT(OUT) argument. It is set to a processor-dependent value based on the current value of the processor clock or to -HUGE(0) if there is no clock. The processor-dependent value is incremented by one for each clock count until the value COUNT_MAX is reached and is reset to zero at the next count. It lies in the range 0 to COUNT_MAX if there is a clock.

COUNT_RATE (optional)

must be scalar and of type default integer. It is an INTENT(OUT) argument. It is set to the number of processor clock counts per second, or to zero if there is no clock.

COUNT_MAX (optional)

must be scalar and of type default integer. It is an INTENT(OUT) argument. It is set to the maximum value that COUNT can have, or to zero if there is no clock.

TAN(X)

Description

Tangent function in radians.

Class

Elemental function.

Argument

X must be of type real.

Result type/
type parameters

Same as X.

Result value

The result has a value equal to a processor-dependent approximation to tan(X), with X regarded as a value in radians.

Specific forms

CTAN,DTAN,QTAN,ZTAN.

TAND(X)

Description

Tangent function in degrees.

Class

Elemental nonstandard function.

Argument

X must be of type real.

Result type/
type parameters

Same as X.

Result value

The result has a value equal to a processor-dependent approximation to tan(X).

Specific forms

DTAND, QTAND.

TANH(X)

Description

Hyperbolic tangent function.

Class

Elemental function.

Argument

X must be of type real.

Result type/
type parameters

Same as X.

Result value

The result has a value equal to a processor-dependent approximation to tanh(X).

Specific forms

DTANH, QTANH.

TIME(TIMESTR)

Description

Return the current system time.

Class

Nonstandard subroutine.

Argument

TIMESTR must be of type character and must provide at least 8 bytes of storage.

Result value

TIME fills TIMESTR with an 8-byte character string of the form hh:mm:ss (hh is the current hour, mm the current minute, ss the number of seconds past the minute).

TINY(X)

Description

Returns the smallest positive number in the model representing numbers of the same type and kind type parameter as the argument.

Class

Inquiry function.

Argument

X must be of type real. It may be scalar or array valued.

Result type,
type parameters,
and shape

Scalar with the same type and kind type parameter as X.

Result value

The result has the value bemin-1

where b and emin are as defined in “The Real Number System Model”.

TRANSFER(SOURCE, MOLD, SIZE)

Optional argument

SIZE

Description

Returns a result with a physical representation identical to that of SOURCE but interpreted with the type and type parameters of MOLD.

Class

Transformational function.

Arguments

SOURCE

may be of any type and may be scalar or array valued.

MOLD

may be of any type and may be scalar or array valued.

SIZE (optional)

must be scalar and of type integer. The corresponding actual argument must not be an optional dummy argument.

Result type,
type parameters,
and shape

The result is of the same type and type parameters as MOLD.

Case 1

If MOLD is a scalar and SIZE is absent, the result is a scalar.

Case 2

If MOLD is array valued and SIZE is absent, the result is array valued and of rank one. Its size is as small as possible such that its physical representation is not shorter than that of SOURCE.

Case 3

If SIZE is present, the result is array valued of rank one and size SIZE.

Result value

If the physical representation of the result has the same length as that of SOURCE, the physical representation of the result is that of SOURCE.

  • If the physical representation of the result is longer than that of SOURCE, the physical representation of the leading part is that of SOURCE and the remainder is undefined.

  • If the physical representation of the result is shorter than that of SOURCE, the physical representation of the result is the leading part of SOURCE. If D and E are scalar variables such that the physical representation of D is as long as or longer than that of E, the value of TRANSFER(TRANSFER(E, D), E) must be the value of E.

  • If D is an array and E is an array of rank one, the value of TRANSFER(TRANSFER(E, D), E, SIZE(E)) must be the value of E.

TRANSPOSE(MATRIX)

Description

Transpose an array of rank two.

Class

Transformational function.

Result type,
type parameters,
and shape

MATRIX may be of any type and must have rank two.

The result is an array of the same type and type parameters as MATRIX and with rank two and shape (n, m) where (m, n) is the shape of MATRIX.

Result value

Element (i, j) of the result has the value MATRIX(j, i), i= 1, 2, ..., n; j= 1, 2, ..., m.

TRIM(STRING)

Description

Returns the argument with trailing blank characters removed.

Class

Transformational function.

Argument

STRING must be of type character and must be a scalar.

Result type/
type parameters

Character with the same kind type parameter value as STRING and with a length that is the length of STRING less the number of trailing blanks in STRING.

Result value

The value of the result is the same as STRING except any trailing blanks are removed. If STRING contains no nonblank characters, the result has zero length.

UBOUND(ARRAY, DIM)

Optional argument

DIM

Description

Returns all the upper bounds of an array or a specified upper bound.

Class

Inquiry function.

Arguments

ARRAY

may be of any type. It must not be scalar. It must not be a pointer that is disassociated or an allocatable array that is not allocated. If ARRAY is an assumed-size array, DIM must be present with a value less than the rank of ARRAY.

DIM (optional)

must be scalar and of type integer with a value in the range 1 <= DIM <= n, where n is the rank of ARRAY. The corresponding actual argument must not be an optional dummy argument.

Result type,
type parameters,
and shape

The result is of type default integer. It is scalar if DIM is present; otherwise, the result is an array of rank one and size n, where n is the rank of ARRAY.

Result value

Case 1

For an array section or for an array expression, other than a whole array or array structure component, UBOUND(ARRAY, DIM) has a value equal to the number of elements in the given dimension; otherwise, it has a value equal to the upper bound for subscript DIM of ARRAY if dimension DIM of ARRAY does not have size zero and has the value zero if dimension DIM has size zero.

Case 2

UBOUND(ARRAY) has a value whose ith component is equal to UBOUND(ARRAY, i), for i= 1, 2, ..., n, where n is the rank of ARRAY.

Specific forms

KUBOUND.

UNPACK(VECTOR, MASK, FIELD)

Description

Unpack an array of rank one into an array under the control of a mask.

Class

Transformational function.

Arguments

VECTOR

may be of any type. It must have rank one. Its size must be at least t where t is the number of .TRUE. elements in MASK.

MASK

must be array valued and of type logical.

FIELD

must be of the same type and type parameters as VECTOR and must be conformable with MASK.

Result type,
type parameters,
and shape

The result is an array of the same type and type parameters as VECTOR and the same shape as MASK.

Result value

The element of the result that corresponds to the ith .TRUE. element of MASK, in array element order, has the value VECTOR(i) for i=1, 2, ..., t, where t is the number of .TRUE. values in MASK. Each other element has a value equal to FIELD if FIELD is scalar or to the corresponding element of FIELD if it is an array.

VERIFY(STRING, SET, BACK)

Optional argument

BACK

Description

Verify that a set of characters contains all the characters in a string by identifying the position of the first character in a string of characters that does not appear in a given set of characters.

Class

Elemental function.

Arguments

STRING

must be of type character.

SET

must be of type character with the same kind type parameter as STRING.

BACK (optional)

must be of type logical.

Result type/
type parameter
s

Default integer.

Result value

Case 1

If BACK is absent or present with the value .FALSE. and if STRING contains at least one character that is not in SET, the value of the result is the position of the leftmost character of STRING that is not in SET.

Case 2

If BACK is present with the value .TRUE. and if STRING contains at least one character that is not in SET, the value of the result is the position of the rightmost character of STRING that is not in SET.

Case 3

The value of the result is zero if each character in STRING is in SET or if STRING has zero length.

XOR(I, J)

Description

Bitwise exclusive OR.

Class

Elemental nonstandard function.

Arguments

I

must be of type integer.

J

must be of type integer with the same kind type parameter as I.

Result type/
type parameter
s

Same as I.

Result value

The result has the value obtained by performing an exclusive OR on I and J bit-by-bit according to Table 11-9 “Truth table for IXOR intrinsic”.

The model for interpreting an integer value as a sequence of bits is described in “The Bit Model”.

ZEXT(A)

Description

Zero extend.

Class

Elemental nonstandard function.

Argument

A must be of type integer or logical.

Result

ZEXT converts a 1-, 2-, or 4-byte logical or integer to a 2- or 4-byte integer by sign-extending zeroes instead of the actual sign bit.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.