Download PathScale ENZO User Guide

Transcript
MODULE foo
INTEGER,
INTEGER,
INTEGER,
INTEGER,
INTEGER,
INTEGER,
INTEGER,
INTEGER,
END MODULE
PARAMETER
PARAMETER
PARAMETER
PARAMETER
PARAMETER
PARAMETER
PARAMETER
PARAMETER
foo
::
::
::
::
::
::
::
::
INT4 = SELECTED_INT_KIND(4)
INT10 = SELECTED_INT_KIND(10)
INT14 = SELECTED_INT_KIND(14)
FLOAT_4_7 = SELECTED_REAL_KIND(4,7)
FLOAT_P10 = SELECTED_REAL_KIND(P=10)
FLOAT_R20 = SELECTED_REAL_KIND(R=40)
FLOAT = KIND(1.0E0)
DOUBLE = KIND(1.0D0)
Because of the difficulty to ensure consistent rounding in floating point arithmetic, operations on REAL or COMPLEX
data types are not yet supported. It is however possible to define parameters of REAL or COMPLEX types as long as
their expressions only contain:
•
•
•
•
•
REAL constant (e.g. 1.2, 1.2D0, 1.2_4, 1.2_INT4)
COMPLEX constant
Unary operator -
Parentheses
References to other parameters of the same type
REAL conversions whether they are implicit or explicit are not supported. In practice that means that the
expression must be of the exact same type as the parameter. For instance, the example below is correct if we
assume that the default REAL kind is 4:
REAL(4), PARAMETER :: X1 = 3.1415
REAL , PARAMETER :: X2 = 3.1415_4
However, the following equivalent declarations containing an implicit and an explicit cast to REAL(8) will not be
able to be evaluated:
REAL(8), PARAMETER :: Y1 = 3.1415
REAL(8), PARAMETER :: Y2 = REAL(3.1415,kind=8)
In practice, one could write the declaration which is similar even though it is not semantically equivalent:
REAL(8), PARAMETER :: Y =3.1415_8
Note: Fortran module support will be improved in future releases, so some of these limitations will be
removed in the future.
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 53
Copyright © 2010 PathScale Inc. - DOC-ENZO08022010