Commit 2b763377 authored by Gregor Michalicek's avatar Gregor Michalicek

Fixed bug in setup of HDLOs in r_inpXML

r_inpXML included a call to setlomap. This subroutine has the side effect
to reinitialize ulo_der to a value according to the definition in the old
inp file. I removed the call to setlomap and included the missing other
initializations directly in r_inpXML.

Note that there is still a bug in the LO setup iff multiple LOs with same
l quantum numbers are defined for the same species. Fleur has the rquirement
that the LOs are ordered with respect to the l quantum numbers. This ordering
is not yet performed in r_inpXML.
parent f75fc888
......@@ -1678,7 +1678,36 @@ SUBROUTINE r_inpXML(&
CALL juDFT_error("llo(j,n)>llod",calledby ="inped")
END IF
END DO
CALL setlomap(iType,atoms)
! Replace call to setlomap with the following 3 loops (preliminary).
! atoms%nlol and atoms%lo1l arrays are strange. This should be solved differently.
DO l = 0,atoms%llod
atoms%nlol(l,iType) = 0
atoms%lo1l(l,iType) = 0
END DO
DO ilo = 1,atoms%nlod
atoms%l_dulo(ilo,iType) = .FALSE.
END DO
DO ilo = 1,atoms%nlo(iType)
#ifdef CPP_APW
IF (atoms%ulo_der(ilo,iType).EQ.1) THEN
atoms%l_dulo(ilo,iType) = .TRUE.
END IF
#endif
WRITE(6,'(A,I2,A,I2)') 'I use',atoms%ulo_der(ilo,iType),'. derivative of l =',atoms%llo(ilo,iType)
IF (atoms%llo(ilo,iType)>atoms%llod) CALL juDFT_error(" l > llod!!!",calledby="r_inpXML")
l = atoms%llo(ilo,iType)
IF (ilo.EQ.1) THEN
atoms%lo1l(l,iType) = ilo
ELSE
IF (l.NE.atoms%llo(ilo-1,iType)) THEN
atoms%lo1l(l,iType) = ilo
END IF
END IF
atoms%nlol(l,iType) = atoms%nlol(l,iType) + 1
END DO
#ifdef CPP_APW
WRITE (6,*) 'atoms%lapw_l(n) = ',atoms%lapw_l(iType)
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment