J3/06-137 Date: 15 February 2006 To: J3 From: Van Snyder Subject: MOLD= on ALLOCATE References: 02-274, 03-254, 04-152 Number: J3-034 Basic Functionality: A MOLD keyword should be added to ALLOCATE similar to the SOURCE keyword, which would provide only the type and deferred type parameters of the allocated data, but not the values. Specification and syntax: Add a MOLD keyword to the ALLOCATE statement, to determine the type and type parameters of the allocated object, just like SOURCE, but without copying the value to the allocated object. Default initialization may be applied. Relax the prohibition against allocating more than one object in an ALLOCATE statement with SOURCE=. Allow the MOLD= expression to be any rank, regardless of the allocation objects. Edits with respect to 04-007: [110:15+] Add another right-hand side to R624: "<> MOLD = " [111:7-8,11] Within C623 and C625, replace " or SOURCE=" by ", , SOURCE=, or MOLD=" twice. [111:21] Within C631 replace " shall not appear" with "neither nor MOLD= shall appear". [111:21-23] Replace C631 and C632 with "C631 (R623) At most one of SOURCE=, MOLD= and shall appear. C632 (R623) Each shall be type compatible (5.1.1.2) with . If SOURCE= appears, shall be a scalar or have the same rank as each ." [111:32-36] Replace the third paragraph after C633 by "If is specified, each is allocated with the specified dynamic type and type parameters; if is specified, the is allocated with the same type and type parameters as those of the dynamic type of ; otherwise, each is allocated with its dynamic type the same as its declared type and type parameter values." {Reworded to avoid the awful "allocation allocates". Note to editor: it might be better to maintain a distinction between specifying the type and type parameter values, and allocating an object with those specifications. Deferred.} [111:37-39] Replace the fourth paragraph after C633 because the first sentence is now covered by the revised previous paragraph, it needs rewording to make up for this deletion, the term "nondeferred value" has no meaning, and "of any of the" is too wordy: "If appears and the value of a type parameter it specifies differs from the value of a corresponding nondeferred type parameter specified in the declaration of any , an error condition occurs. If the value of a nondeferred length type parameter of an is different from the value of the corresponding type parameter of , an error condition occurs." [112:10+] Add a new paragraph and Note before Note 6.19: "If MOLD= appears and is a variable, its value need not be defined. NOTE 6.18a The can be an array or scalar independently of whether an is an array or a scalar. Only the dynamic type and type parameter values of are relevant; its rank, shape and value are not." History: m167 04-152