Commit 60267d6b authored by Matthias Redies's avatar Matthias Redies

everything works find so push it (to the limit)

parent a9b36cf9
......@@ -71,9 +71,9 @@ CONTAINS
INTEGER, INTENT(IN) :: nk
! local scalars
INTEGER :: n, nn, iband, nbasfcn, i, i0, j
INTEGER :: iband, nbasfcn, i, i0, j
REAL :: a_ex
TYPE(t_mat) :: tmp, v_x, z
TYPE(t_mat) :: tmp, v_x, z, diff
COMPLEX :: exch(fi%input%neig, fi%input%neig)
call timestart("add_vnonlocal")
......@@ -82,8 +82,11 @@ CONTAINS
a_ex = xcpot%get_exchange_weight()
nbasfcn = MERGE(lapw%nv(1) + lapw%nv(2) + 2*fi%atoms%nlotot, lapw%nv(1) + fi%atoms%nlotot, fi%noco%l_noco)
CALL v_x%init(hmat%l_real, nbasfcn, nbasfcn)
CALL read_v_x(v_x, fi%kpts%nkpt*(jsp - 1) + nk)
! CALL v_x%init(hmat%l_real, nbasfcn, nbasfcn)
! CALL read_v_x(v_x, fi%kpts%nkpt*(jsp - 1) + nk)
call v_x%init(hybdat%v_x(nk, jsp))
call v_x%copy(hybdat%v_x(nk, jsp),1,1)
! add non-local x-potential to the hamiltonian hmat
......
......@@ -97,7 +97,7 @@ CONTAINS
complex :: c_phase_k(hybdat%nbands(k_pack%nk ))
REAL :: wl_iks(fi%input%neig, fi%kpts%nkptf)
TYPE(t_mat) :: ex, v_x, z_k
TYPE(t_mat) :: ex, z_k
CALL timestart("total time hsfock")
nk = k_pack%nk
......@@ -137,6 +137,7 @@ CONTAINS
CALL exchange_valence_hf(k_pack, fi, z_k, c_phase_k, mpdata, jsp, hybdat, lapw, eig_irr, results, &
n_q, wl_iks, xcpot, nococonv, stars, nsest, indx_sest, fmpi, ex)
if(.not. allocated(hybdat%v_x)) allocate(hybdat%v_x(fi%kpts%nkpt, fi%input%jspins))
if(k_pack%submpi%root()) then
! calculate contribution from the core states to the HF exchange
CALL timestart("core exchange calculation")
......@@ -151,10 +152,14 @@ CONTAINS
CALL timestop("core exchange calculation")
call ex_to_vx(fi, nk, jsp, nsymop, psym, hybdat, lapw, z_k, ex, v_x)
CALL write_v_x(v_x, fi%kpts%nkpt*(jsp - 1) + nk)
endif
call ex%save_npy("ex_nk=" // int2str(nk) // "_rank=" // int2str(fmpi%n_rank) // ".npy")
! call MPI_Barrier(MPI_COMM_WORLD, ok)
! call judft_error("stopit: add_Vnonl")
call ex_to_vx(fi, nk, jsp, nsymop, psym, hybdat, lapw, z_k, ex, hybdat%v_x(nk, jsp))
CALL write_v_x(hybdat%v_x(nk, jsp), fi%kpts%nkpt*(jsp - 1) + nk)
endif
call hybdat%v_x(nk,jsp)%bcast(0, k_pack%submpi%comm)
CALL timestop("total time hsfock")
END SUBROUTINE hsfock
END MODULE m_hsfock
......@@ -279,6 +279,7 @@ END IF
CALL calc_hybrid(eig_id,fi,mpdata,hybdat,fmpi,nococonv, stars,enpara,&
results,xcpot,vTot,iterHF)
END SELECT
call MPI_Barrier(fmpi%mpi_comm, ierr)
IF(hybdat%l_calhf) THEN
call mixing_history_reset(fmpi)
iter = 0
......
......@@ -55,7 +55,8 @@ MODULE m_types_hybdat
! coulomb matrix stuff
type(t_coul), allocatable :: coul(:)
type(t_usdus) :: usdus
type(t_usdus) :: usdus
type(t_mat), allocatable :: v_x(:,:) ! nkpt, jsp
contains
procedure :: set_stepfunction => set_stepfunction
procedure :: free => free_hybdat
......@@ -205,7 +206,7 @@ contains
class(t_coul), intent(inout) :: coul
type(t_fleurinput), intent(in) :: fi
integer, intent(in) :: num_radbasfn(:, :), n_g(:), ikpt
integer :: idum, info, isize, l, itype
integer :: info, isize, l, itype
isize = sum([(((2*l + 1)*fi%atoms%neq(itype), l=0, fi%hybinp%lcutm1(itype)),&
itype=1, fi%atoms%ntype)]) &
......
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