02.07.2013 Views

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Intrinsic procedures<br />

Basic terms and concepts<br />

NOTE Some compile-line options—for example, +autodbl—change the default data<br />

type sizes and can cause different or invalid intrinsic procedure references.<br />

Classes of intrinsics<br />

Intrinsic procedures are classified as:<br />

470<br />

Elemental intrinsics<br />

Transformational functions<br />

Inquiry functions<br />

The following sections describe each class. The descriptions in “Intrinsic procedure<br />

specifications” on page 479 identify the class of each intrinsic.<br />

Elemental intrinsics<br />

An intrinsic procedure is elemental if it is specified as having scalar arguments but will actual<br />

arguments that are arrays. Calling an elemental intrinsic with an array argument causes the<br />

function to perform the scalar operation on each element of the array. MVBITS is the only<br />

elemental subroutine. All other intrinsic subroutines are nonelemental.<br />

An elemental function that is called with all scalar dummy arguments delivers a scalar result.<br />

Calling an elemental function with conformable array arguments, however, results in a<br />

conformable array result. If both array and scalar arguments are specified to an elemental<br />

function, each scalar is treated as an array in which all elements have the scalar value. The<br />

“scalar array” is conformable with the array arguments.<br />

Transformational functions<br />

Transformational intrinsic functions are nonelemental. Such functions require at least one<br />

array argument and return either a scalar or array result based on actual arguments that<br />

cannot be evaluated elementally. Often, an array result will be of a different shape than the<br />

argument(s). For example, SUM returns a scalar result that represents the sum of all the<br />

elements of the array argument.<br />

Inquiry functions<br />

Inquiry intrinsic functions return information based on the properties of the principal<br />

argument—its value is irrelevant, and the argument need not be defined. For example, the<br />

SIZE inquiry function can be used to return the extent of an array along one dimension or the<br />

total number of elements in the array.<br />

Chapter 11

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!