13.07.2015 Views

A Brief Introduction to Fortran 77 - Polaris

A Brief Introduction to Fortran 77 - Polaris

A Brief Introduction to Fortran 77 - Polaris

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.

Triplet notationSections of arrays are identified in <strong>Fortran</strong> 90 using tripletsof the form l:u:s. A triplet represent the sequence ofsubscriptsl, l+s, l+2*s,...,l+m*swhere m is the smallest number such thatl+(m+1)s > u (if s ≥ l)orl+(m+1)s < u (if s ≤ l)For example, the section A(3:5,2,1:2) of an array A isthe array of shape (3,2):A(3,2,1) A(3,2,2)A(4,2,1) A(4,2,2)A(5,2,1) A(5,2,2)If l is omitted, the lober bound for the array is assumed. If uis omitted, the upper bound is assumed. If s is omitted, 1 isassumed. The stride s cannot be 0© 1998 David A. Padua38 of 118

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

Saved successfully!

Ooh no, something went wrong!