alpha2f.x does not read the input

The newly added alpha2f.x code expects a simple namelist at the end of the
regular input for the electron-phonon case. This does not work for two reasons:
- input is not available from unit 5, but from unit "qestdin"
- unit qestdin is closed by the code reading the phonon data (phq_readin)
Workaround (very unsatisfactory):
- input is read from qestdin, and
- phq_readin does not close qestdin
Not sure about side effects. Might fix issue #322.
This commit is contained in:
Paolo Giannozzi 2021-05-08 20:36:13 +02:00
parent d38b6d54a4
commit b07e1754c1
2 changed files with 6 additions and 5 deletions

View File

@ -380,7 +380,7 @@ PROGRAM alpha2f
USE mp_global, ONLY : mp_startup, mp_global_end
USE environment, ONLY : environment_start, environment_end
USE elph_tetra_mod, ONLY : in_alpha2f
USE io_global, ONLY : ionode
USE io_global, ONLY : qestdin, ionode
!
USE alpha2f_vals, ONLY : nfreq
USE alpha2f_routines, ONLY : read_lam, compute_a2f, compute_lambda, read_polarization
@ -388,6 +388,7 @@ PROGRAM alpha2f
implicit none
!
CHARACTER (LEN=256) :: auxdyn
INTEGER :: ios
!
NAMELIST /INPUTA2F/ nfreq
!
@ -399,7 +400,7 @@ PROGRAM alpha2f
!
CALL phq_readin()
!
IF(ionode) READ( 5, INPUTA2F)
IF(ionode) READ( qestdin, INPUTA2F )
!
CALL check_initial_status(auxdyn)
!

View File

@ -927,9 +927,9 @@ SUBROUTINE phq_readin()
ENDIF
nat_todo_input=nat_todo
!
! end of reading, close unit qestdin, remove tenporary input file if existing
!
IF (meta_ionode) ios = close_input_file ()
! end of reading, close unit qestdin, remove temporary input file if existing
! FIXME: closing input file here breaks alpha2F.x that reads what follows
!!! IF (meta_ionode) ios = close_input_file ()
IF (epsil.AND.(lgauss .OR. ltetra)) &
CALL errore ('phq_readin', 'no elec. field with metals', 1)