To: J3 07-248 From: Jim Xia Subject: Interpretation: Allocatable array on intrinsic assignment with scalar expr Date: 2007 July 12 NUMBER: F03/0093 TITLE: Allocatable array on intrinsic assignment with scalar expr KEYWORDS: allocatable array, intrinsic assignment DEFECT TYPE: Error STATUS: Erratum PROBLEM: Consider CHARACTER(:), ALLOCATABLE :: str(:) ALLOCATE (CHARACTER(1) :: str(0:9)) str = 'reallocate?' According to the rules of interpretation of assignments [139:22-26], allocatable array, str, should be deallocated on this assignment because it has a deferred length type parameter different from the , and then allocated with a length type parameter the same as that of 'reallocate?'. However array str can not be allocated with the shape and bounds of the since it is a scalar. Thus reallocation of str is prohibited based on these rules. The standard, however, provide an interpretation for the shape of in the next paragraph [140:2-3]. These two paragraphs contradict each other in this context. QUESTIONS: (1) Should allocatable array, str, be reallocated on the assignment? (2) If so, what are the values of its length type parameter, shape and bounds? ANSWER: (1) Yes. (2) The length parameter of str after the assignment is 11 (the value returned by LEN('reallocate?')). An edit is provided to clarify for its shape and bounds. EDITS: [139:25] Replace "type parameters of ," with "type parameter of . If is a scalar and is an array, is allocated with the same shape as before deallocation, with each lower bound equal to 1; otherwise is allocated " SUBMITTED BY: Jim Xia HISTORY: m181 Submitted