I have a large program that reads in an input file that contains a list of additional input files and a unit number. I like to change the code so that it can take advantage of the Fortran 2008 NEWUNIT feature, but this always sets the unit number to a negative value. This is a problem because the code decides what features to employ based on a unit number being greater than zero.
Is there anyway to have something as the following:
LOGICAL::OPENFILE ... IUNIT=0 IF(OPENFILE) OPEN(NEWUNIT=IUNIT,FILE='TEMP.txt')