To: J3 Members J3/16-120r1 From: Van Snyder & Steve Lionel Subject: Several units for one file, nonadvancing, asynchronous, etc. Reference: 15-226, 14-174r1 (UK-12), 16-007 Date: 2016 February 08 1. Introduction =============== [211:24-25 9.5.4p4 and 212:31 9.5.6.1p8 in 15-007r2] 9.5.4p4 says it is processor dependent whether a file can be connected to more than one unit at the same time. 9.5.6.1p8 prevents it. Which one is it? Since the permission was added by work item UK-12 (14-174r1) we can presume it is intended to be allowed. Once you open a can of worms, you need a bigger can to put them back. Connecting several units to a file is not mentioned in the introduction. If a file is connected to more than one unit, how do asynchronous output and nonadvancing output work? Are their behaviors processor dependent, or should these actions be prohibited? /JOR's position is that asynchronous output is already covered by existing language. Wording to say that nonadvancing output is processor dependent is needed. 8.1.6.5p5 says that if records are written to a file connected for sequential access during more than one iteration of a DO CONCURRENT construct, the ordering between records is processor dependent. This is posed by reference to a file, not a unit, so if a file is connected to more than one unit, there is no new problem. The subclause is silent concerning the relationship between DO CONCURRENT and asynchronous output. Asynchronous is probably OK because 9.6.2.5p3 says asynchronous transfers are "read, written, and processed as they would have been if the data transfers were synchronous. /JOR's position is that no edits are needed here. The description of the NUMBER= specifier says it assigns the unit number of the connected file. It doesn't say which unit number is assigned if more than one is connected. The simplest answer is that it is processor dependent. A complicated additional feature is to allow (but not require) a rank-one allocatable array, which is thereby allocated with a size equal to the number of units attached to the file (zero if there are none), and each element is assigned the external unit number for one of those units. /JOR prefers saying that the number returned in such cases is processor- dependent. The alternative would be a new feature and out-of-scope. 2. Edits ======== [xvi Introduction, under Input/output] Insert a sentence: "Whether a file can be connected to more than one unit is processor dependent instead of prohibited." [212:31 9.5.6.1p8] Delete the paragraph that begins "If a file is already connected...." [220:18+ 9.6.2.4p1+] Insert a paragraph: "The effect of nonadvancing output using different units connected to the same file is processor dependent." [509:35+] Insert an item: "o the effect of nonadvancing output using different units connected to the same file (9.6.2.4);" 3. Edits for INQUIRE by file ============================ [243:14 9.10.2.18p1] Insert a sentence before the one that begins "If there is no unit...": "If more than one unit is connected, which external unit number is assigned to the is processor dependent." [510:10+] Insert a list item: " o the external unit number assigned to the in the NUMBER= specifier in an INQUIRE by file statement if more than one unit is connected to the file (9.10.2.18);"