+------------------------Fortran 2003 Draft Standard-------------------------+
Purpose
An ASSOCIATE statement is the first statement of an ASSOCIATE construct. It establishes an association between each entity and a variable or the value of an expression.
Syntax
.-,----------------------------. V | >>-+-----------------------------+--ASSOCIATE--(----associate_name--=>--selector-+--)->< '-associate_construct_name--:-' |
Rules
If the selector is an expression or a variable with a vector subscript, the entity is assigned the value of the expression or variable. In this case, the associating entity must not become redefined or undefined.
If the selector is a variable without a vector subscript, the entity is associated with the specified variable. Whenever the value of the variable changes, the value of the associated entity changes with it.
If the selector has the ALLOCATABLE attribute, the associating entity does not have the ALLOCATABLE attribute. If the selector has the POINTER attribute, the entity is associated with the target of the pointer and does not have the POINTER attribute. If the selector has the INTENT, TARGET, or VOLATILE attribute, the associating entity has the same attributes if it is a variable.
If the selector has the OPTIONAL attribute, it must be present.
An associating entity has the same type, type parameters, and rank as the selector. If the selector is an array, the associating entity is an array with a lower bound for each dimension equal to the value of the intrinsic LBOUND(selector). The upper bound for each dimension is equal to the lower bound plus the extents minus 1.
An associate_name must be unique within its scoping unit.
If the associate_construct_name appears on an ASSOCIATE construct statement, it must also appear on the corresponding END ASSOCIATE statement.
An ASSOCIATE construct statement must not appear within the dynamic or lexical extent of a parallel region.
Examples
test_equiv: ASSOCIATE (a1 => 2, a2 => 40, a3 => 80) IF ((a1 * a2) .eq. a3) THEN PRINT *, "a3 = (a1 * a3)" END IF END ASSOCIATE test_equiv END
Related Information
+---------------------End of Fortran 2003 Draft Standard---------------------+