[Wien] problems with gfortran when unit 6 is associated to file

Pavel Ondračka pavel.ondracka at email.cz
Tue Oct 31 16:16:56 CET 2017


Od: Peter Blaha <pblaha at theochem.tuwien.ac.at>
Komu: A Mailing list for WIEN2k users <wien at zeus.theochem.tuwien.ac.at>
Datum: 31. 10. 2017 15:27:42
Předmět: Re: [Wien] problems with gfortran when unit 6 is associated to file

"I can reproduce this.

Apparently, some "clever informatics-guy" has changed the default 
behaviour, namely that

write(*,... prints to stdout

while

write(6,... prints to the connected file, and ONLY if it has not been 
connected explicitly via an OPEN statement, it would print to stdout.

Now, in gfortran one has changed that to "*" = "6" (why this limitation ??)

We have been using this different behaviour of unit=* or 5 and 6 (for 
read and write) in several places, when we want to alert a user of a 
certain fact (like "inversion is (not) present).

I'll change in SRC_symmetry all "write(6," to "write(66,", which should 
fix this problem (and also modify x_lapw for the corresponding def file).

There might be similar problems in other parts. Let me know if you find one.

Regards"
 

Thanks for looking into this.


I did not detect any more problems so far, however since this type of 
problems can be easily undetected (eg. this can result in extra lines  in 
output files and the unlucky programs trying to parse the files later could 
be in troubles, but not necessarily visibly crashing...so the problems can 
stay hidden), IMO it would be better to stop using the unit 6 for file 
output all over the place. If this is too much work  I can volunteer to 
prepare some patches (on top of 17.1) to change the output files from unit 6
to 66 (or some other) all over the place. This should be quite easy grep&sed
exercise. I'm using gfortran systems extensively so this is quite important 
for me. Might be a good idea to get rid of the usage of unit 5 for reading 
input files as well (in general fortran guides recommend using unit numbers 
above 9 for file input/output).

Best regards

Pavel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://zeus.theochem.tuwien.ac.at/pipermail/wien/attachments/20171031/5fe3376f/attachment.html>


More information about the Wien mailing list