Pages

mercredi 27 avril 2011

len, shape, size in Fortran 90

LEN: find the len of character string
shape: find the len of array. return 1-d array.
size: find the len of array. return a scalar

In Fortran, any variable or expression is either scalar, or has a non-zero rank. In the second case we are dealing with an array--the rank is the number of dimensions to the array.

REAL A(5, 10), B(5, 10), C(5, 10)
declares A, B and C as rank-2 arrays (of real numbers). Their extent in the first dimension is 5, and in the second dimension is 10. The vector of extents associated with an array is called the shape of the array. A, B and C all have shape . Two arrays are conformable if they have the same shape.

Aucun commentaire:

Enregistrer un commentaire