To: J3 J3/21-170 From: Van Snyder Subject: 16.10.2.22 OUTPUT_UNIT needs to specify it works for PRINT Date: 2021-August-03 Reference: 21-007 1. Introduction --------------- 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 INPUT_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.22 "OUTPUT_UNIT". 2. Edits -------- [217:12 12.5.1 Referring to a file] After "ISO_FORTRAN_ENV (16.10.2.13)." insert a sentence "The same unit is used in a READ statement that does not contain an input/output control list (12.6.4.3)." {This is already specified in 16.10.2.13.} [217:15 12.5.1 Referring to a file] After "ISO_FORTRAN_ENV (16.10.2.22)." insert a sentence "The same unit is used in a PRINT statement." [430:29 16.10.2.22 OUTPUT_UNIT"] After "WRITE statement (12.6.4.3)" insert a clause "; this unit is the one used in a PRINT statement". {Compare this construction to 16.10.2.13 "INPUT_UNIT".}