REAL array(2,2,2,2,2,2,2,2,2,2,2,2,2,2,2)declares a 15-dimensional array.
SELECTED_INT_KIND(18)
is a valid integer kind number.
PARAMETER
) that is an array can assume its shape from
its defining expression; this is called an implied-shape array.
The syntax is that the upper bound of every dimension must be an asterisk, for
example
REAL,PARAMETER :: idmat3(*,*) = Reshape( [ 1,0,0,0,1,0,0,0,1 ], [ 3,3 ] ) REAL,PARAMETER :: yeardata(2000:*) = [ 1,2,3,4,5,6,7,8,9 ]declares
idmat3
to have the bounds (1:3,1:3)
, and yeardata
to have the bounds (2000:2008)
.
TYPE
keyword can be used to declare entities of intrinsic type,
simply by putting the intrinsic type-spec within the parentheses.
For example,
TYPE(REAL) x TYPE(COMPLEX(KIND(0d0))) y TYPE(CHARACTER(LEN=80)) zis completely equivalent, apart from being more confusing, to
REAL x COMPLEX(KIND(0d0)) y CHARACTER(LEN=80) z
DOUBLEPRECISION
.
PROCEDURE,NOPASS :: a PROCEDURE,NOPASS :: b=>x PROCEDURE,NOPASS :: cthe single statement
PROCEDURE,NOPASS :: a, b=>x, cwill suffice.
C_ASSOCIATED
, 7.0 for C_LOC
and C_FUNLOC
]
A specification expression may now use the C_ASSOCIATED
, C_LOC
and C_FUNLOC
functions from the ISO_C_BINDING
module.
For example, given a TYPE(C_PTR)
variable X and another interoperable variable Y
with the TARGET
attribute,
INTEGER workspace(MERGE(10,20,C_ASSOCIATED(X,C_LOC(Y))))is allowed, and will give
workspace
a size of 10 elements if the C pointer X
is associated with Y
, and 20 elements otherwise.
INTERFACE OPERATOR(.user.) PURE INTEGER FUNCTION userfun(x) REAL,INTENT(IN) :: x END FUNCTION END INTERFACEthe user-defined operator
.user.
may be used in a specification expression as follows:
LOGICAL mask(.user.(3.145))
Note that this applies to overloaded intrinsic operators as well as user-defined operators.