mirror of https://gitlab.com/QEF/q-e.git
fix numbers of elements for Hubbard_m
we write only from 1 to 2*l + 1 instead of 1 t 2*hub_lmax +1 same thing, mutatis mutandis, for noncolinear
This commit is contained in:
parent
32c6cef2d1
commit
080d2d16b0
|
@ -462,10 +462,10 @@ CONTAINS
|
|||
Hubbard_l(isp) = hu_l
|
||||
objldim = dft_obj%dftU%Hubbard_Um(ihub)%size
|
||||
IF (objldim == 2*hu_l + 1) THEN
|
||||
Hubbard_Um(:,ispin,isp) = dft_obj%dftU%Hubbard_Um(ihub)%HubbardM
|
||||
Hubbard_Um(1:2*hu_l+1,ispin,isp) = dft_obj%dftU%Hubbard_Um(ihub)%HubbardM
|
||||
ELSE IF (objldim == 2*(2*hu_l +1)) THEN
|
||||
Hubbard_Um(:,1,isp) = dft_obj%dftU%Hubbard_Um(ihub)%HubbardM(1:2*hu_l+1)
|
||||
Hubbard_Um(:,2,isp) = dft_obj%dftU%Hubbard_Um(ihub)%HubbardM(2*hu_l+2:4*hu_l+2)
|
||||
Hubbard_Um(1:2*hu_l+1,1,isp) = dft_obj%dftU%Hubbard_Um(ihub)%HubbardM(1:2*hu_l+1)
|
||||
Hubbard_Um(1:2*hu_l+1,2,isp) = dft_obj%dftU%Hubbard_Um(ihub)%HubbardM(2*hu_l+2:4*hu_l+2)
|
||||
ELSE
|
||||
call errore("qexsd_copy_dft:", &
|
||||
"size of Hubbard_Um element not compatible with label",1)
|
||||
|
|
|
@ -578,7 +578,7 @@ CONTAINS
|
|||
type(hubbardM_type),allocatable :: objs(:)
|
||||
character(len=*) :: labs(:), tag
|
||||
!
|
||||
integer :: nhubm, ihubm,nt, nspin, msize, it, ispin, nhubmtot, iobj
|
||||
integer :: nhubm, ihubm,nt, nspin, msize, it, ispin, nhubmtot, iobj, ldim
|
||||
integer, allocatable :: packdati(:),channels_per_specimen(:),hubm(:)
|
||||
real(dp) :: uvalue
|
||||
!
|
||||
|
@ -599,12 +599,14 @@ CONTAINS
|
|||
!
|
||||
do ihubm = 1, nhubm
|
||||
it = packdati(ihubm)
|
||||
ldim = 2 * l(it) + 1
|
||||
if (noncolin ) ldim = 2 * ldim
|
||||
iobj = 1
|
||||
if (ihubm .gt. 1) iobj = iobj + sum(channels_per_specimen(1:ihubm-1))
|
||||
do ispin = 1, nspin
|
||||
if (ANY(dati(:,ispin,ihubm)/=0.0_DP)) THEN
|
||||
call qes_init(objs(iobj), TRIM(tag), TRIM(species(it)),TRIM(labs(it)), ispin, &
|
||||
HubbardM = dati(:,ispin, ihubm))
|
||||
HubbardM = dati(1:ldim,ispin, ihubm))
|
||||
if (nspin == 1) objs(iobj)%spin_ispresent = .FALSE.
|
||||
iobj = iobj + 1
|
||||
end if
|
||||
|
|
Loading…
Reference in New Issue