Commit 9bb562cc authored by Matthias Redies's avatar Matthias Redies

introduce eig_id to hybdat

parent 5682077c
......@@ -4,7 +4,7 @@ MODULE m_hf_init
! preparations for HF and hybinp functional calculation
!
CONTAINS
SUBROUTINE hf_init(mpdata, hybinp, atoms, input, hybdat)
SUBROUTINE hf_init(eig_id, mpdata, hybinp, atoms, input, hybdat)
USE m_types
USE m_hybrid_core
USE m_util
......@@ -12,6 +12,7 @@ CONTAINS
USE m_io_hybinp
USE m_types_hybdat
IMPLICIT NONE
integer, intent(in) :: eig_id
TYPE(t_mpdata), intent(inout) :: mpdata
TYPE(t_hybinp), INTENT(IN) :: hybinp
TYPE(t_atoms), INTENT(IN) :: atoms
......@@ -20,6 +21,7 @@ CONTAINS
INTEGER:: l, m, i, l1, l2, m1, m2
!initialize hybdat%gridf for radial integration
CALL intgrf_init(atoms%ntype, atoms%jmtd, atoms%jri, atoms%dx, atoms%rmsh, hybdat%gridf)
! preparations for core states
......@@ -30,6 +32,7 @@ CONTAINS
call hybdat%free()
call hybdat%allocate(atoms, hybinp, mpdata%num_radfun_per_l)
hybdat%eig_id = eig_id
! pre-calculate gaunt coefficients
hybdat%fac(0) = 1
hybdat%sfac(0) = 1
......
......@@ -134,13 +134,13 @@ CONTAINS
CALL coulombmatrix(mpi, atoms, kpts, cell, sym, mpdata, hybinp, hybdat, xcpot)
CALL hf_init(mpdata, hybinp, atoms, input, hybdat)
CALL hf_init(eig_id, mpdata, hybinp, atoms, input, hybdat)
CALL timestop("Preparation for hybinp functionals")
CALL timestart("Calculation of non-local HF potential")
DO jsp = 1, input%jspins
call timestart("HF_setup")
CALL HF_setup(mpdata,hybinp, input, sym, kpts, atoms, &
mpi, noco, cell, oneD, results, jsp, enpara, eig_id, &
mpi, noco, cell, oneD, results, jsp, enpara, &
hybdat, sym%invs, v%mt(:, 0, :, :), eig_irr)
call timestop("HF_setup")
......
......@@ -8,8 +8,8 @@ MODULE m_hf_setup
CONTAINS
SUBROUTINE hf_setup(mpdata, hybinp, input, sym, kpts, atoms, mpi, noco, cell, oneD, results, jsp, enpara, eig_id_hf, &
hybdat, l_real, vr0, eig_irr)
SUBROUTINE hf_setup(mpdata, hybinp, input, sym, kpts, atoms, mpi, noco, cell,&
oneD, results, jsp, enpara, hybdat, l_real, vr0, eig_irr)
USE m_types
USE m_eig66_io
USE m_util
......@@ -35,7 +35,7 @@ CONTAINS
TYPE(t_results), INTENT(INOUT) :: results
TYPE(t_hybdat), INTENT(INOUT) :: hybdat
INTEGER, INTENT(IN) :: jsp, eig_id_hf
INTEGER, INTENT(IN) :: jsp
REAL, INTENT(IN) :: vr0(:, :, :)
LOGICAL, INTENT(IN) :: l_real
......@@ -71,7 +71,7 @@ CONTAINS
if(.not. allocated(eig_irr)) allocate(eig_irr(input%neig, kpts%nkpt), stat=ok)
IF (ok /= 0) call judft_error('eigen_hf: failure allocation eig_irr')
eig_irr = 0
if(allocated(hybdat%kveclo_eig)) deallocate(hybdat%kveclo_eig)
allocate(hybdat%kveclo_eig(atoms%nlotot, kpts%nkpt), stat=ok)
IF (ok /= 0) call judft_error('eigen_hf: failure allocation hybdat%kveclo_eig')
......@@ -89,7 +89,7 @@ CONTAINS
CALL lapw%init(input, noco, kpts, atoms, sym, nk, cell, sym%zrfs)
nbasfcn = MERGE(lapw%nv(1) + lapw%nv(2) + 2*atoms%nlotot, lapw%nv(1) + atoms%nlotot, noco%l_noco)
CALL zMat(nk)%init(l_real, nbasfcn, merge(input%neig*2,input%neig,noco%l_soc))
CALL read_eig(eig_id_hf, nk, jsp, zmat=zMat(nk))
CALL read_eig(hybdat%eig_id, nk, jsp, zmat=zMat(nk))
IF(l_exist.AND.zmat(1)%l_real) THEN
READ(993,rec=nk) zDebug_r(:,:)
......
......@@ -190,7 +190,11 @@ contains
rec = kpts%nkptf * (jsp - 1) + ik
CALL read_matrix(mat, rec, id_z)
! if(ik <= kpts%nkpt) then
! read_eig()
! else
CALL read_matrix(mat, rec, id_z)
! endif
END subroutine read_z
subroutine write_z(mat, rec)
......
......@@ -394,7 +394,7 @@ SUBROUTINE rdmft(eig_id,mpi,input,kpts,banddos,sliceplot,cell,atoms,enpara,stars
CALL coulombmatrix(mpi,atoms,kpts,cell,sym,mpdata,hybinp,hybdat,xcpot)
CALL hf_init(mpdata,hybinp,atoms,input,hybdat)
CALL hf_init(eig_id,mpdata,hybinp,atoms,input,hybdat)
WRITE(*,*) 'RDMFT: HF initializations end'
......@@ -517,7 +517,7 @@ SUBROUTINE rdmft(eig_id,mpi,input,kpts,banddos,sliceplot,cell,atoms,enpara,stars
results%neig(:,:) = neigTemp(:,:)
CALL HF_setup(mpdata,hybinp,input,sym,kpts,atoms,mpi,noco,&
cell,oneD,results,jspin,enpara,eig_id,&
cell,oneD,results,jspin,enpara,&
hybdat,sym%invs,vTot%mt(:,0,:,:),eig_irr)
results%neig(:,:) = highestState(:,:) + 1
......@@ -571,7 +571,7 @@ SUBROUTINE rdmft(eig_id,mpi,input,kpts,banddos,sliceplot,cell,atoms,enpara,stars
CALL invtrafo%alloc(olap%l_real,hybdat%nbands(ikpt),nbasfcn)
CALL trafo%TRANSPOSE(invtrafo)
DO i = 1, hybdat%nbands(ikpt)
DO j = 1, i-1
IF (exMat%l_real) THEN
......
......@@ -30,6 +30,7 @@ MODULE m_types_hybdat
COMPLEX, ALLOCATABLE :: stepfunc(:,:,:)
INTEGER :: nbasp = -1
INTEGER :: maxbasm1 = -1
INTEGER :: eig_id = -1
INTEGER, ALLOCATABLE :: nbasm(:)
contains
procedure :: set_stepfunction => set_stepfunction
......
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