Sun Studio 12: Fortran Library Reference

2.3 Non-Standard Fortran 95 Intrinsic Functions

The following functions are considered intrinsics by the f95 compiler, but are not part of the Fortran 95 standard.

2.3.1 Basic Linear Algebra Functions (BLAS)

When compiling with -xknown_lib=blas, the compiler will recognize calls to the following routines as intrinsics and will optimize for and link to the Sun Performance Library implementation. The compiler will ignore user-supplied versions of these routines.

Table 2–2 BLAS Intrinsics

Function  

Description  

CAXPY

DAXPY

SAXPY

ZAXPY

Product of a scalar and a vector plus a vector 

CCOPY

DCOPY

SCOPY

ZCOPY

Copy a vector 

CDOTC

CDOTU

DDOT

SDOT

ZDOTC

ZDOTU

Dot product (inner product) 

CSCAL

DSCAL

SSCAL

ZSCAL

Scale a vector 

See the Sun Performance Library User’s Guide for more information on these routines.

2.3.2 Interval Arithmetic Intrinsic Functions

The following table lists intrinsic functions that are recognized by the compiler when compiling for interval arithmetic (-xia). For details, see the Fortran 95 Interval Arithmetic Programming Reference.

DINTERVAL

DIVIX

INF

INTERVAL

ISEMPTY

MAG

MID

MIG

NDIGITS

QINTERVAL

SINTERVAL

SUP

VDABS

VDACOS

VDASIN

VDATAN

VDATAN2

VDCEILING

VDCOS

VDCOSH

VDEXP

VDFLOOR

VDINF

VDINT

VDISEMPTY

VDLOG

VDLOG10

VDMAG

VDMID

VDMIG

VDMOD

VDNINT

VDSIGN

VDSIN

VDSINH

VDSQRT

VDSUP

VDTAN

VDTANH

VDWID

VQABS

VQCEILING

VQFLOOR

VQINF

VQINT

VQISEMPTY

VQMAG

VQMID

VQMIG

VQNINT

VQSUP

VQWID

VSABS

VSACOS

VSASIN

VSATAN

VSATAN2

VSCEILING

VSCOS

VSCOSH

VSEXP

VSFLOOR

VSINF

VSINT

VSISEMPTY

VSLOG

VSLOG10

VSMAG

VSMID

VSMIG

VSMOD

VSNINT

VSSIGN

VSSIN

VSSINH

VSSQRT

VSSUP

VSTAN

VSTANH

VSWID

WID

 

 

 

2.3.3 Other Vendor Intrinsic Functions

The f95 compiler recognizes a variety of legacy intrinsic functions that were defined by Fortran compilers from other vendors, including Cray Research, Inc. These are obsolete and their use should be avoided.

Table 2–3 Intrinsic Functions From Cray CF90 and Other Compilers

Function  

Arguments  

Description  

CLOC

([C=]c) 

Obtains the address of a character object 

COMPL

([I=]i) 

Bit-by-bit complement of a word. Use NOT(i) instead 

COT

([X=]x) 

Generic cotangent. (Also: DCOT, QCOT) 

CSMG

([I=]i,[J=]j,[K=]k) 

Conditional Scalar Merge 

DSHIFTL

([I=]i,[J=]j,[K=]k) 

Double-object left shift of i and j by k bits 

DSHIFTR

([I=]i,[J=]j,[K=]k) 

Double-object right shift of i and j by k bits 

EQV

([I=]i,[J=]j) 

Logical equivalence. Use IOER(i,j) instead. 

FCD

([I=]i,[J=]j) 

Constructs a character pointer 

IBCHNG

([I=]i, [POS=]j) 

Generic function to change specified bit in a word. 

ISHA

([I=]i, [SHIFT=]j) 

Generic arithmetic shift 

ISHC

([I=]i, [SHIFT=]j) 

Generic circular shift 

ISHL

([I=]i, [SHIFT=]j) 

Generic left shift 

LEADZ

([I=]i) 

Counts number of leading 0 bits 

LENGTH

([I=]i) 

Returns the number of Cray words successfully transferred 

LOC

([I=]i) 

Returns the address of a variable (See 1.4.32 loc: Return the Address of an Object)

NEQV

([I=]i,[J=]j) 

Logical non-equivalence. Use IOER(i,j) instead. 

POPCNT

([I=]i) 

Counts number of bits set to 1 

POPPAR

([I=]i) 

Computes bit popluation parity 

SHIFT

([I=]i,[J=]j) 

Shift left circular. Use ISHFT(i,j) or ISHFTC(i,j,k) instead. 

SHIFTA

([I=]i,[J=]j) 

Arithmetic shift with sign extension. 

SHIFTL

([I=]i,[J=]j) 

Shift left with zero fill. Use ISHFT(i,j) or ISHFTC(i,j,k) instead. 

SHIFTR

([I=]i,[J=]j) 

Shift right with zero fill. Use ISHFT(i,j) or ISHFTC(i,j,k) instead. 

TIMEF

() 

Returns elapsed time since the first call 

UNIT

([I=]i) 

Returns status of BUFFERIN or BUFFEROUT 

XOR

([I=]i,[J=]j) 

Logical exclusive OR. Use IOER(i,j) instead. 

See also 2.3.4.2 Memory Functions for a list of VMS Fortran 77 intrinsics.

2.3.4 Other Extensions

The Fortran 95 compiler recognizes the following additional intrinsic functions:

2.3.4.1 MPI_SIZEOF

MPI_SIZEOF( x, size, error)

Returns the size in bytes of the machine representation of the given variable, x. If x is an array, it returns the size of the base element and not the size of the whole array

input; variable or array of arbitrary type 

size

output; integer; size in bytes of x

error

output; integer; set to an error code if an error detected, zero otherwise 

2.3.4.2 Memory Functions

Memory allocation, reallocation, and deallocation functions malloc(), realloc(), and free() are implemented as f95 intrinsics. See 1.4.35 malloc, malloc64, realloc, free: Allocate/Reallocate/Deallocate Memory for details.