Automatic allocation of an available file unit



I noticed that J3 is (finally) implementing automatic file unit allocation:
http://j3-fortran.org/doc/year/06/06-138r2.txt

I see that the plan is to use negative unit numbers for automatically assigned units. It seems to me that there would be fewer conflicts by using positive numbers starting at some number higher than the old compiler limits, an therefore unlikely to conflict with old code using constant unit numbers.

That's just my 2 cents.

I have been strictly avoiding constant unit numbers for a long time, using a function that returns a free UNIT, found by a simple INQUIRE loop, which also returns the unit number in an optional argument, so you can do an open statement like this:

open(unit=file_unit(data_unit), ...)
read(data_unit,...)

Joe
.