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
idmat3to have the bounds
yeardatato have the bounds
TYPEkeyword 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
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_FUNLOC] A specification expression may now use the
C_FUNLOCfunctions from the
ISO_C_BINDINGmodule. For example, given a
TYPE(C_PTR)variable X and another interoperable variable
INTEGER workspace(MERGE(10,20,C_ASSOCIATED(X,C_LOC(Y))))is allowed, and will give
workspacea size of 10 elements if the C pointer
Xis 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:
Note that this applies to overloaded intrinsic operators as well as user-defined operators.