11.07.2015 Views

Fortran 90 Handbook

Fortran 90 Handbook

Fortran 90 Handbook

SHOW MORE
SHOW LESS
  • No tags were found...

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

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

6TYPE ADDRESS_BOOKINTEGER NO_ADDRESSES (26)TYPE (DATE) FIRST_ENTRY, LAST_ENTRYEND TYPE ADDRESS_BOOK. . .TYPE (ADDRESS_BOOK) CLIENTSthen CLIENTS % NO_ADDRESSES refers to a rank-one integer array eventhough CLIENTS refers to a scalar of type ADDRESS_BOOK.It is possible to reference a scalar element of an array. For example, if X isdeclared:REAL X (40, 20, 30)then X (3, 5, 21) refers to a scalar element. It is also possible to reference asection of an array, for example X(1:10, 3:4, 15:30). A section is itself an array.A whole object is referenced by its name if it is a variable or a named constant.A part of an object is referenced by a designator which is a whole objectreference followed by a substring selector, a component selector, an arrayelement selector, or an array section selector.An array section selector is a list of section subscripts, one for each dimensionof the array. There are three possibilities for section subscripts: a singlesubscript, a subscript triplet, or a vector subscript.If a single subscript appears in a section selector, it will reduce by one the rankof the resulting array section. For example, X(1:10, 3, 15:30) is a rank-two array.A subscript triplet selects a regularly formed section. For example, X (2:40:2, 1,1) is a rank-one array that consists of the even-numbered elements in the firstdimension of X. A subscript triplet may be reduced to a single colon (:). In thiscase, the entire range of the dimension is selected. X ( :, 1, 1) references theentire first column of X.A vector subscript may select an irregularly formed section. If II =(/ 3, 7, 19, 2 /), then X (II, 1, 1) is a rank-one array consisting of the elementsX (3, 1, 1), X (7, 1, 1), X (19, 1, 1), and X (2, 1, 1).When operations on arrays are performed, no order of evaluation is required;however, there is an order for array elements that is reflected in input andoutput sequences and in certain intrinsic functions. This order is “columnwise”;that is, the subscripts along the first dimension vary most rapidly.224 <strong>Fortran</strong> <strong>90</strong> <strong>Handbook</strong>Copyright © 1992 J. Adams, W. Brainerd, J. Martin, B. Smith, and J. Wagener

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

Saved successfully!

Ooh no, something went wrong!