J3/14-193 To: J3 From: Van Snyder Subject: Interp concerning interdependence of specifier values Date: 2014 June 18 Reference: Interp F03/0096 (revised for F2008 in 11-129 and Corr. 2) ---------------------------------------------------------------------- NUMBER: TBD TITLE: Interdependence of specifier values in input/output statements KEYWORD: specifier, input/output statement DEFECT TYPE: Erratum STATUS: J3 consideration in progress QUESTIONS: 1. Are the following INQUIRE statement permitted? LOGICAL :: Exist, Opened INQUIRE ( FILE='fred', EXIST=exist ) INQUIRE ( UNIT=42, OPENED=opened 2. Is the following INQUIRE statement permitted? INTEGER :: U INTERFACE FUNCTION P ( A ) INTEGER, INTENT(IN) :: A INTEGER, POINTER :: P END FUNCTION P END INTERFACE INQUIRE ( FILE='fred', NUMBER=u, POSITION=p(u) ) 3. Is the following READ statement permitted? INTEGER :: STATS(42) NAMELIST /IN/ V READ ( *, IN, IOSTAT=STATS(V) ) ANSWERS: 1. According to 9.12p5 "The value of a specifier in an input/output statement shall not depend on the definition or evaluation of any other specifier in the or in that statement." the INQUIRE statements are prohibited because the values of the variables EXIST and OPEN depend upon the values of the FILE= and UNIT= specifiers, respectively. They were intended to be permitted. Edits are provided to correct this mistake. 2. According to 9.12p6 "The value of any subscript or substring bound of a variable that appears in a specifier in an input/output statement shall not depend on any , , or on the definition or evaluation of any other specifier in the or in that statement." the INQUIRE statement is not prohibited because U is not a subscript or substring bound. It was intended to be prohibited. Edits are provided to correct this mistake. 3. According to 9.12p5 "The value of any subscript or substring bound of a variable that appears in a specifier in an input/output statement shall not depend on any , , or on the definition or evaluation of any other specifier in the or in that statement." and 9.12p7 "In a data transfer statement, the variable specified in an IOSTAT=, IOMSG=, or SIZE= specifier, if any, shall not be associated with any entity in the ... ...." and 9.12p8 "In a data transfer statement, if a variable specified in an IOSTAT=, IOMSG=, or SIZE= specifier is an array element reference, its subscript values shall not be affected by the data transfer, the processing, or the definition or evaluation of any other specifier in the ." the READ statement is not prohibited because V does not "depend on any , , or on the definition or evaluation of any other specifier in the or in that statement." Although V is input from namelist, it is not "the variable specified in an IOSTAT=, IOMSG=, or SIZE= specifier." The READ statement was intended to be prohibited. Edits are provided to correct this mistake. EDITS to 10-007r1: [243:3-4 9.12p5] Within the first sentence, as amended by Corrigendum 2, replace "input/output" with "data transfer" and delete "or ", so that the sentence, as amended by Corrigendum 2, becomes "The value of a specifier in a data transfer statement shall not depend on the evaluation of any other specifier in the in that statement." If we assume that the UNIT= , FILE= , or ID= in an are established before the values of any of the s are changed, we need not append "The value of a , , or in an shall not depend upon the definition of any variable in that ." [243:6, 12-15 9.12p6,8] Replace the paragraphs: "In an input/output statement, the value of any argument in a function reference that is a , any subscript, or any substring bound, that appears in a specifier in that statement, shall not be affected by data transfer or processing caused by that statement, or definition or evaluation of any other specifier in the or in that statement."