olap matrix setup copied to read_olap

parent a882a1a1
...@@ -117,21 +117,7 @@ CONTAINS ...@@ -117,21 +117,7 @@ CONTAINS
call timestart("read in olap") call timestart("read in olap")
nbasfcn = lapw%hyb_num_bas_fun(fi) nbasfcn = lapw%hyb_num_bas_fun(fi)
call olap%alloc(fi%sym%invs, nbasfcn) call olap%alloc(fi%sym%invs, nbasfcn)
call read_olap(olap, fi%kpts%nkpt*(jsp - 1) + nk) call read_olap(olap, fi%kpts%nkpt*(jsp - 1) + nk, nbasfcn)
IF(olap%l_real) THEN
DO i = 1, nbasfcn
DO j = 1, i
olap%data_r(i, j) = olap%data_r(j, i)
END DO
END DO
ELSE
DO i = 1, nbasfcn
DO j = 1, i
olap%data_c(i, j) = CONJG(olap%data_c(j, i))
END DO
END DO
olap%data_c = conjg(olap%data_c)
END IF
call timestop("read in olap") call timestop("read in olap")
IF(hybdat%l_calhf) THEN IF(hybdat%l_calhf) THEN
......
...@@ -147,12 +147,28 @@ contains ...@@ -147,12 +147,28 @@ contains
read(id_coulomb, rec=nk) coulomb read(id_coulomb, rec=nk) coulomb
end subroutine read_coulomb_c end subroutine read_coulomb_c
subroutine read_olap(mat, rec) subroutine read_olap(olap, rec, nbasfcn)
implicit none implicit none
TYPE(t_mat), INTENT(INOUT):: mat TYPE(t_mat), INTENT(INOUT):: olap
INTEGER, INTENT(IN) :: rec INTEGER, INTENT(IN) :: rec, nbasfcn
integer :: i, j
CALL read_matrix(mat, rec, id_olap)
CALL read_matrix(olap, rec, id_olap)
IF(olap%l_real) THEN
DO i = 1, nbasfcn
DO j = 1, i
olap%data_r(i, j) = olap%data_r(j, i)
END DO
END DO
ELSE
DO i = 1, nbasfcn
DO j = 1, i
olap%data_c(i, j) = CONJG(olap%data_c(j, i))
END DO
END DO
olap%data_c = conjg(olap%data_c)
END IF
END subroutine read_olap END subroutine read_olap
subroutine write_olap(mat, rec) subroutine write_olap(mat, rec)
......
...@@ -555,23 +555,7 @@ SUBROUTINE rdmft(eig_id,mpi,input,kpts,banddos,sliceplot,cell,atoms,enpara,stars ...@@ -555,23 +555,7 @@ SUBROUTINE rdmft(eig_id,mpi,input,kpts,banddos,sliceplot,cell,atoms,enpara,stars
nbasfcn = MERGE(lapw%nv(1)+lapw%nv(2)+2*atoms%nlotot,lapw%nv(1)+atoms%nlotot,noco%l_noco) nbasfcn = MERGE(lapw%nv(1)+lapw%nv(2)+2*atoms%nlotot,lapw%nv(1)+atoms%nlotot,noco%l_noco)
CALL olap%alloc(sym%invs,nbasfcn) CALL olap%alloc(sym%invs,nbasfcn)
CALL read_olap(olap, kpts%nkpt*(jspin-1)+ikpt) CALL read_olap(olap, kpts%nkpt*(jspin-1)+ikpt, nbasfcn)
IF (olap%l_real) THEN
DO i = 1, nbasfcn
DO j = 1, i
olap%data_r(i,j) = olap%data_r(j,i)
END DO
END DO
ELSE
DO i = 1, nbasfcn
DO j = 1, i
olap%data_c(i,j) = CONJG(olap%data_c(j,i))
END DO
END DO
olap%data_c = conjg(olap%data_c)
END IF
zMat%matsize2 = hybdat%nbands(ikpt) ! reduce "visible matsize" for the following computations zMat%matsize2 = hybdat%nbands(ikpt) ! reduce "visible matsize" for the following computations
......
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