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.

ExamplesDIMENSION ARRAY1(3:10), ARRAY2(3,-2:2)This specifies ARRAY1 as a vector having eight elements with the lower bound of 3 and the upperbound of 10.ARRAY2 as a matrix of two dimensions having fifteen elements. The first dimension has threeelements and the second has five with bounds from -2 to 2.CHARACTER B(0:20)*4This example sets up an array B with 21 character elements each having a length of fourcharacters. Note that the character array has been dimensioned in a type declaration statement andtherefore cannot subsequently appear in a DIMENSION statement.DO (Iterative) 90The DO statement introduces an iterative loop and specifies the loop control index and parameters.There are two forms of DO statement, block and non-block (FORTRAN 77 style). There are twoforms of block do statements, DO iterative and DO WHILE. Refer to the description of DOWHILE for more details on this form of DO statement.SyntaxDO (block)[do-construct-name : ] DO [label ] [loop-control][execution-part-construct][label] END DOloop-controllabelindexis an increment index expression of the form:[index = e1 e2 [, e3]]labels the last executable statement in the loop (this must not be atransfer of control).is the name of a variable called the DO variable.e1 is an expression which yields an initial value for i.e2 is an expression which yields a final value for i.e3is an optional expression yielding a value specifying the incrementvalue for i. The default for e3 is 1.Fortran Statements 75

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

Saved successfully!

Ooh no, something went wrong!