------- Comment #4 from kargl at gcc dot gnu dot org 2005-10-29 00:14 ------- Intel and PGI are wrong according to the standard. Gfortran is doing the right thing. See section 9.4 File Connection. In particular "The external unit identified by a particular value of a scalar-int-expr is the same external unit in all program units of the program." Also, read Note 9.13. I'm here referencing material from the Final Committee Draft for the Fortran 2003 standard.
You'll also find Section 9.4.3 Connection of a file to a unit An external unit has a property of being connected or not connected. If connected, it refers to an external file. An external unit may become connected by preconnection or by the execution of an OPEN statement. The property of connection is symmetric; the unit is connected to a file if and only if the file is connected to the unit. In short, if you want to different files, then you need to have unique unit numbers. -- kargl at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kargl at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24576