12.07.2015 Views

PGI Fortran - Servidor WWW del Cluster Ladon-Hidra

PGI Fortran - Servidor WWW del Cluster Ladon-Hidra

PGI Fortran - Servidor WWW del Cluster Ladon-Hidra

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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2.4.1 An Array Declaration ElementAn array declaration has the following form:name([lb:]ub[,[lb:]ub]... )where name is the symbolic name of the array, lb is the specification of the lower bound of thedimension and ub is the specification of the upper bound. The upper bound, ub must be greaterthan the lower bound lb. The values lb and ub may be negative. The bound lb is taken to be 1 if itis not specified. The difference (ub-lb+1) specifies the number of elements in that dimension. Thenumber of lb,ub pairs specifies the rank of the array. Assuming the array is of a data type thatrequires N bytes per element, the total amount of storage of the array is:N*(ub-lb+1)*(ub-lb+1)*...The dimension specifiers of an array subroutine argument may themselves be subroutinearguments or members of COMMON.2.4.2 Deferred Shape ArraysDeferred-shape arrays are those arrays whose shape can be changed by an executable statement.Deferred-shape arrays are declared with a rank, but with no bounds information. They assumetheir shape when either an ALLOCATE statement or a REDIMENSION statement is encountered.For example, the following statement declares a deferred shape REAL array A of rank two:REAL A(:, :)2.4.3 SubscriptsA subscript is used to specify an array element for access. An array name qualified by a subscriptlist has the following form:name(sub[,sub]...)where there must be one sub entry for each dimension in array name.Each sub must be an integer expression yielding a value which is within the range of the lower andupper bounds. Arrays are stored as a linear sequence of values in memory and are held such thatthe first element is in the first store location and the last element is in the last store location. In amulti-dimensional array the first subscript varies more rapidly than the second, the second morerapidly than the third, and so on (column major order).40 Chapter 2

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

Saved successfully!

Ooh no, something went wrong!