09-171r1 To: J3 From: Van Snyder Subject: Interpretation concerning elemental intrinsic pointer targets and actual arguments Date: 2009 March 27 References: 04-007 NUMBER: TBD TITLE: Elemental intrinsic pointer targets and actual arguments KEYWORDS: Elemental intrinsic, procedure pointer, dummy procedure DEFECT TYPE: Error STATUS: TBD QUESTION: The sixth paragraph of subclause 7.4.2.2 [145:7-8] specifies that if a procedure target is a that is a specific name and a generic name, as is the case for many of the intrinsic procedures listed in subclause 13.6 [298:13ff]and not marked with a bullet (the ones allowed to be procedure pointer targets), the specific procedure is used. Constraint C728 in subclause 7.4.2 [144:7] allows a to be an elemental intrinsic procedure. The implication of these two texts is that a nonelemental specific intrinsic procedure is associated with the procedure pointer as its target. This should be specified explicitly. For each intrinsic function listed in 13.6 and not marked with a bullet, does there exist a nonelemental specific intrinsic version for every rank, or only for rank zero? If the procedure pointer has explicit interface and has a dummy argument that is not a scalar, can the procedure pointer be pointer associated with a nonelemental specific intrinsic procedure having an argument of the same rank? The same questions, mutatis mutandis, apply to argument association: Constraint C1228 [267:14] in subclause 12.4 allows an actual argument to be an elemental intrinsic procedure. C1229 and the second paragraph of subclause 12.4.1.3 [271:15-19] (redundantly) require an intrinsic procedure actual argument to be one listed in 13.6 and not marked with a bullet. The last sentence of the second paragraph of subclause 12.4.1.3 specifies that if an actual argument is a procedure name is a specific name and a generic name, as is the case for many of the intrinsic procedures listed in subclause 13.6 and not marked with a bullet (the ones allowed to be procedure pointer targets), the specific procedure is used. The implication of these texts is that a nonelemental specific intrinsic procedure is the actual argument associated with the dummy argument. For each intrinsic function listed in 13.6 and not marked with a bullet, does there exist a nonelemental specific intrinsic version for every rank, or only for rank zero? If both the procedure and the dummy procedure have explicit interface, and the dummy procedure has a dummy argument that is not a scalar, can the dummy procedure be argument associated with a nonelemental specific intrinsic procedure having an argument of the same rank? ANSWER (1): In both cases the specific procedure used is the scalar one. Edits are provided to clarify this. ANSWER (2): In the case of a procedure pointer, the scalar specific intrinsic procedure is used if the procedure pointer has explicit interface and has scalar dummy arguments, or if the procedure pointer has implicit interface. If the procedure pointer has explicit interface and has array dummy arguments, the dummy arguments shall all have the same rank and the specific intrinsic procedure of the appropriate rank becomes the target of the procedure pointer. Otherwise the association is prohibited. In the case of a dummy procedure, the scalar specific intrinsic procedure is used if the procedure has explicit interface, the dummy procedure has explicit interface and the dummy procedure has scalar dummy arguments, or if either the procedure or dummy procedure has implicit interface. If the procedure has explicit interface, the dummy procedure has explicit interface, and the dummy procedure has array dummy arguments, the dummy arguments of the dummy procedure shall all have the same rank and the specific intrinsic procedure of the appropriate rank becomes associated with the dummy procedure. Otherwise the association is prohibited. Edits are provided to clarify this. EDITS (1): Insert the following after Constraint C728 [144:7+] in subclause 7.4.2: C728a (R742) If is a specific intrinsic procedure and has explicit interface, all dummy arguments of the specified interface shall be scalars." Insert the following after the final paragraph of subclause 7.4.2.2 [145:8+]: "If is an elemental intrinsic procedure the scalar specific intrinsic procedure becomes pointer associated with . If has implicit interface it is interpreted to have the same number of dummy arguments as and those dummy arguments are interpreted to be scalars." Insert the following as a new paragraph after the second paragraph of subclause 12.4.1.3 [271:19+]: "If an actual argument is an elemental intrinsic procedure, the scalar specific intrinsic procedure is associated with the dummy argument. C1233a (R1221) If the is a specific intrinsic procedure, the referenced procedure has explicit interface, and the dummy procedure corresponding to the actual argument has explicit interface, all arguments of the dummy procedure shall be scalars. If the actual argument is an elemental intrinsic procedure and the referenced procedure has implicit interface, the dummy procedure corresponding to the actual argument shall either have implicit interface or shall have scalar dummy arguments." EDITS (2): Insert the following after Constraint C728 [144:7+] in subclause 7.4.2: C728a (R742) If is a specific intrinsic procedure and has explicit interface, all dummy arguments of the specified interface shall be have the same rank." Insert the following after the final paragraph of subclause 7.4.2.2 [145:8+]: "If is an elemental intrinsic procedure the specific nonelemental intrinsic procedure of the appropriate rank is associated with . If has explicit interface the specific nonelemental intrinsic procedure having arguments of the same rank as the dummy arguments of the specified interface becomes pointer associated with . If has implicit interface it is interpreted to have the same number of dummy arguments as and those dummy arguments are interpreted to be scalars." Insert the following as a new paragraph after the second paragraph of subclause 12.4.1.3 [271:19+]: "If the actual argument is an elemental intrinsic procedure the nonelemental specific intrinsic procedure of appropriate rank is associated with the dummy argument. If the referenced procedure has implicit interface, or if it has explicit interface and the dummy procedure has implicit interface, a scalar version of the specific intrinsic procedure is used. If the referenced procedure has implicit interface and the dummy procedure has explicit interface, it shall have scalar arguments. If the referenced procedure has explicit interface and the dummy procedure has explicit interface, the nonelemental specific intrinsic procedure having arguments of the same rank as the arguments of the dummy procedure is associated with the dummy procedure. C1233a (R1221) If the is a specific intrinsic procedure, the referenced procedure has explicit interface, and the dummy procedure corresponding to the actual argument has explicit interface, all arguments of the dummy procedure shall have the same rank." SUBMITTED BY: Van Snyder HISTORY: