[Pw_forum] Bug in PW/pw_readfile

Iurii TIMROV iurii.timrov at polytechnique.edu
Fri Jul 27 19:35:12 CEST 2012


Dear QE developers,

It seems there is a bug in the subroutine PW/pw_readfile. It shows up when
a phonon calculation is restarted. I checked QE v.5.0.1, the bug hasn't
been fixed. It is related to the unit "iunout". In the beginning of the 
pw_readfile, there is a look for an empty unit:

CALL iotk_free_unit( iunout, ierr )

Afterwards, in the subroutine "read_band_structure" the unit "iunout" is
used. But the problem is that in "read_band_structure" the unit "iunout"
is declared second time:

INTEGER :: iunout

Thus, "iunout" is a random number, which sometimes may be negative, and
therefore the data file cannot be read. Due to this, the code escapes from
this routine (return), the data file is not read, and the code crashes
somewhere else. It is strange to me, why the code escapes (return
statement) instead of giving an error message (it takes time to find such
bugs due to this).

The solution of the problem is simple: just to remove "INTEGER :: iunout".

If this is not a bug, please explain me why. But in my case the code
doesn't work with this.

Best,
Iurii


Iurii TIMROV
Doctorant (PhD student)
Laboratoire des Solides Irradies
Ecole Polytechnique
F-91128 Palaiseau
+33 1 69 33 45 08




More information about the users mailing list