10.07.2015 Views

PGI Fortran Reference manual - The Portland Group

PGI Fortran Reference manual - The Portland Group

PGI Fortran Reference manual - The Portland Group

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.

<strong>Fortran</strong> Arrays4.1.1. Explicit Shape ArraysExplicit shape arrays are those arrays familiar to FORTRAN 77 programmers. Each dimensionis declared with an explicit value. <strong>The</strong>re are two special cases of explicit arrays. In a procedure,an explicit array whose bounds are passed in from the calling program is called an automaticarray.<strong>The</strong> second special case, also found in a procedure, is that of an adjustable-array which is adummy array where the bounds are passed from the calling program.4.1.2. Assumed Shape ArraysAn assumed shape array is a dummy array whose bounds are determined from the actualarray. Intrinsics called from the called program can determine sizes of the extents in the calledprogram’s dummy array.4.1.3. Deferred Shape ArraysA deferred shape array is an array that is declared, but not with an explicit shape. Upondeclaration, the array's type, its kind, and its rank (number of dimensions) are determined.Deferred shape arrays are of two varieties, allocatable arrays and array pointers.4.1.4. Assumed Size ArraysAn assumed size array is a dummy array whose size is determined from the corresponding arrayin the calling program. <strong>The</strong> array’s rank and extents may not be declared the same as the originalarray, but its total size (number of elements) is the same as the actual array. This form of arrayshould not need to be used in new <strong>Fortran</strong> programs.4.2. Array SpecificationArrays may be specified in either of two types of data type specification statements, attributeorientedspecifications or entity-oriented specifications. Arrays may also optionally havedata assigned to them when they are declared. This section covers the basic form of entitybaseddeclarations for the various types of arrays. Note that all the details of array passing forprocedures are not covered here; refer to <strong>The</strong> <strong>Fortran</strong> 95 Handbook for complete details on theuse of arrays as dummy arguments.4.2.1. Explicit Shape ArraysExplicit shape arrays are defined with a specified rank, each dimension must have an upperbound specified, and a lower bound may be specified. Each bound is explicitly defined with aspecification of the form:[lower-bound:] upper-bound<strong>PGI</strong> <strong>Fortran</strong> <strong>Reference</strong> Guide 65

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

Saved successfully!

Ooh no, something went wrong!