PH498A: List of F90 intrinsics (incomplete)

Fortran 90 intrinsics (incomplete)

Here is an explanation of some of the intrinsics useful for this course.

Arrays

Dimensions

These intrinsics return the total size and size of each dimension of an array.

size(array) returns the total number of elements in array. The optional argument DIM will return the number of elements in a particular dimension.

shape(array) returns an integer vector whose length is the number of dimensions of array, and each element is the size of that dimension. For example

 real*8 A(3,4)
 integer elements,dim1
 integer dims(2)

 elements = size(A)    ! elements = 12
 dim1 = size(A,DIM=1)  ! dim1 = 3
 dims = shape(A)       ! dims = (3,4)

Matrix math

matmul(A,B) returns an array that is the matrix multiplication of A and B. The only requirement is that A and B must be conformable. Thus it can also do matrix-vector multiplication.

dot_product(a,b) returns a scalar that is the dot product of a and b.

transpose(A) Returns an array that is the transpose of A.


Return to Fortran 90 page.
Return to PH498A homepage.