yambo-code / yambo

This is the official GPL repository of the yambo code
http://www.yambo-code.eu/
GNU General Public License v2.0
91 stars 35 forks source link

PWSCF 6.4.1 xml issues #22

Closed chrisewolf closed 4 years ago

chrisewolf commented 4 years ago

Dear all,

I know that the maintainers are already aware of this from the yambo forum but I recently also found another format issue that only shows up in spin-polarized calculations

`p2y

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error in routine qexsd_read_band_structure (1): fmt problem (dims I) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% `

I think this is also related to a change in xml format between recent versions of pwscf.

sangallidavide commented 4 years ago

Dear chrisewolk, we are preparing the release of yambo 4.4

The code is presently in the master of the yambo repo. Can you check if with such version of p2y everything works fine ?

chrisewolf commented 4 years ago

Dear Davide,

I just compiled yambo and ran a spin-polarized (nspin=2, tot_magnetization=1) calculation; then tried to p2y it but the same error shows up.

PWSCF: Program PWSCF v.6.4.1 starts on 9Aug2019 at 20: 5:37 P2Y: This is p2y 4.4.0 rev.108 P(Wscf) 2 Y(ambo) interface

The error is <---> DBs path set to . <---> detected QE data format: qexsd <---> == PWscf v.6.x generated data (QEXSD fmt) == <---> Header/K-points/Energies... %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Error in routine qexsd_read_band_structure (2): fmt problem (dims I) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

if there is any further information that could be helpful please let me know!

Best, Chris

sangallidavide commented 4 years ago

Ok, I've been able to reproduce the bug. It is due to p2y trying to read the variable nbnd, while for spin_polarized calculations the variable nbnd_up/nbnd_dw should be used. We'll post here as soon as the bug is fixed.

andrea-ferretti commented 4 years ago

Dear All,

I've attempted a fix which seems to work in the cases I've tested: here is the patch:

diff --git a/interfaces/p2y/qexsd_p2y.F b/interfaces/p2y/qexsd_p2y.F
index 7faa7a8..3b5bed3 100644
--- a/interfaces/p2y/qexsd_p2y.F
+++ b/interfaces/p2y/qexsd_p2y.F
@@ -1467,6 +1467,7 @@ CONTAINS
       integer,                intent(out) :: ierr
       !
       integer :: nbnd_, nkpts_, nspin_, ik, ndim
+      integer :: nbnd_up_, nbnd_dw_
       logical :: lsda_, noncolin_, lfound
       real(dbl) :: rvec(3)
       real(dbl), allocatable :: eig_(:), occ_(:)
@@ -1498,8 +1499,17 @@ CONTAINS
          if (ierr/=0) return
       endif
       !
-      call iotk_scan_dat( iunit, "nbnd", nbnd_, IERR=ierr)
+      call iotk_scan_dat( iunit, "nbnd", nbnd_, FOUND=lfound, IERR=ierr)
       if (ierr/=0) return
+      !
+      if (.not. lfound) then
+         call iotk_scan_dat( iunit, "nbnd_up", nbnd_up_, IERR=ierr)
+         if (ierr/=0) return
+         call iotk_scan_dat( iunit, "nbnd_dw", nbnd_dw_, IERR=ierr)
+         if (ierr/=0) return
+         nbnd_=nbnd_up_+nbnd_dw_
+      endif
+      !
       if (nspin_==2) nbnd_=nbnd_/2
       if (present(nbnd)) nbnd=nbnd_
       !

We'll keep testing it and include it in the yambo pgl repo asap.

take care Andrea

sangallidavide commented 4 years ago

the fix has now been imported in the master