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.

DescriptionARRAY can be used in a subroutine as a synonym for DIMENSION to establish an argument asan array, and in this case the declarator can use expressions formed from integer variables andconstants to establish the dimensions (adjustable arrays). Note however that these integer variablesmust be either arguments or declared in COMMON; they cannot be local. Note that in this case thefunction of ARRAY is merely to supply a mapping of the argument to the subroutine code, and notto allocate storage.The typing of the array in an ARRAY statement is defined by the initial letter of the array name inthe same way as variable names, unless overridden by an IMPLICIT or type declaration statement.Arrays may appear in type declaration and COMMON statements but the array name can appear inonly one array declaration.ExampleREAL, ARRAY(3:10):: ARRAY_ONEINTEGER, ARRAY(3,-2:2):: ARRAY_TWOThis specifies ARRAY_ONE as a vector having eight elements with the lower bound of 3 and theupper bound of 10.ARRAY_TWO as a matrix of two dimensions having fifteen elements. The first dimension hasthree elements and the second has five with bounds from -2 to 2.ASSIGN 77(Obsolescent) The ASSIGN statement assigns a statement label to a variable. Internal procedurescan be used in place of the ASSIGN statement. Other cases where the ASSIGN statement is usedcan be replaced by using character strings (for different format statements that were formallyassigned labels by using an integer variable as a format specifier).SyntaxASSIGN a TO babDescriptionis the statement label.is an integer variable.Executing an ASSIGN statement assigns a statement label to an integer variable. This is the onlyway that a variable may be defined with a statement label value. The statement label must be:58 Chapter 3

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

Saved successfully!

Ooh no, something went wrong!