To: J3 J3/21-170r1 From: Van Snyder & JOR Subject: 16.10.2.24 OUTPUT_UNIT needs to specify it works for PRINT Date: 2021-October-19 Reference: 21-007, 21-170 This r1 paper has updated line and subclause numbers for edits (21-007r2 instead of F18), and additional explanatory comments. 1. Introduction --------------- (new commentary) Subclause 12.6.4.3 [247:7-16] discusses all the UNIT stuff for READs without an io-control-list, the * for READ and WRITE, and PRINT unit stuff. But that subclause is far removed from 12.5.1, where SOME of the unit stuff is discussed. This paper makes those two subclauses more consistent. 16.10.2.13 also discusses INPUT_UNIT, and 16.10.2.24 discusses OUTPUT_UNIT, but neglects to mention the PRINT statement. (end new commentary) Subclause 12.5.1p4 "Referring to a file" specifies that the unit used in a READ statement that does not specify a unit is the same as the unit used in a READ statement in which the unit is specified by an asterisk, and that this is the same unit as defined by the INPUT_UNIT named constant in the intrinsic module ISO_FORTRAN_ENV. That paragraph goes on to specify that the unit used in a WRITE statement in which the unit is specified by an asterisk is the same unit as defined by the OUTPUT_UNIT named constant in the intrinsic module ISO_FORTRAN_ENV, but does not mention the PRINT statement. Subclause 16.10.2.13 "INPUT_UNIT" specifies that the unit specified by an asterisk is the same as the unit defined by INPUT_UNIT and the same as the unit used in a READ statement that does not include an input/output control list. This needs to be specified in 12.4.1p4. That the asterisk unit in a WRITE statement might be believed to be the same unit as the one used in a PRINT statement is suggested in subclause 12.6.4.8.3p4 "Executing defined input/output data transfers" in the second list item: If the parent data transfer statement is a WRITE statement with an asterisk unit or a PRINT statement, the unit argument shall have the same value as the named constant OUTPUT_UNIT in the intrinsic module ISO_FORTRAN_ENV. This needs to be made explicit in 12.5.1p4, and in 16.10.2.24 "OUTPUT_UNIT". (new commentary) Also see 12.6.4.3. (end new commentary) 2. Edits -------- [230:15] After "(16.10.2.13)." add "This unit is also used by a READ statement without an io-control-spec-list." [230:17] After "ISO_FORTRAN_ENV (16.10.2.24)" add "This unit is also used by the PRINT statement." [457:14] After "(12.6.4.3)" insert "; this unit is the one used by a PRINT statement"