Download PathScale ENZO User Guide

Transcript
•
•
•
Scalar integer arguments used to specify an array bound shall not be modified within the codelet. Ideally,
they should have the INTENT(IN) attribute,
Scalar integer arguments used to specify an array bound must appear before that array in the argument
list,
For better performance, it is recommended to use a constant or a single variable for the lower bound.
Below is a typical example:
Listing 27 – Fortran array declaration in codelet
SUBROUTINE codelet(m,n,A,B,C)
INTEGER, INTENT(IN)
:: m,n
INTEGER, INTENT(INOUT) :: A(100), B(m,n), C(0:m*n-1)
...
END SUBROUTINE
The following forms of arrays are not allowed:
•
•
Assumed-size arrays as in A(*) or B(100,*)
Assumed-shape and deferred-shape arrays as in A(:) or B(3:)
Remark: an array of the form A(:m) is allowed since its lower bound is by default equal to one.
4.2.1.9 IF statements The following forms of IF statements are supported:
•
IF…ENDIF constructs optionally with ELSE IF and ELSE:
IF (A>B) THEN
C = 1
ELSE IF (A<B) THEN
C = -1
ELSE
C = 0
ENDIF
•
Logical IF statements:
IF (A==B) C=0
Current restrictions:
•
•
SELECT CASE constructs are currently not supported.
GOTOs are not supported as well as arithmetic IF statements that are in fact disguised GOTOs.
NVIDIA ® is a registered trademark of the NVIDIA Corporation
This information is the property of PathScale Inc. and cannot be used, reproduced or transmitted without authorization.
Page 51
Copyright © 2010 PathScale Inc. - DOC-ENZO08022010