Commit 49d5f493 authored by Daniel Wortmann's avatar Daniel Wortmann

Changed interface and functionality of read_eig & write_eig, most probable still broken...

parent 12fb707b
...@@ -133,7 +133,7 @@ CONTAINS ...@@ -133,7 +133,7 @@ CONTAINS
! .. Local Scalars .. ! .. Local Scalars ..
TYPE(t_lapw):: lapw TYPE(t_lapw):: lapw
INTEGER :: llpd INTEGER :: llpd
REAL wk,wronk,sign,emcd_lo,emcd_up REAL wronk,sign,emcd_lo,emcd_up
INTEGER i,ie,iv,ivac,j,k,l,l1,lh ,n,ilo,isp,nat,& INTEGER i,ie,iv,ivac,j,k,l,l1,lh ,n,ilo,isp,nat,&
nbands,noded,nodeu,noccbd,nslibd,na,& nbands,noded,nodeu,noccbd,nslibd,na,&
ikpt,npd ,jsp_start,jsp_end,ispin ikpt,npd ,jsp_start,jsp_end,ispin
...@@ -144,8 +144,6 @@ CONTAINS ...@@ -144,8 +144,6 @@ CONTAINS
! ...Local Arrays .. ! ...Local Arrays ..
INTEGER n_bands(0:dimension%neigd),ncore(atoms%ntype) INTEGER n_bands(0:dimension%neigd),ncore(atoms%ntype)
REAL cartk(3),xp(3,dimension%nspd),e_mcd(atoms%ntype,input%jspins,dimension%nstd) REAL cartk(3),xp(3,dimension%nspd),e_mcd(atoms%ntype,input%jspins,dimension%nstd)
REAL ello(atoms%nlod,atoms%ntype,dimension%jspd),evac(2,dimension%jspd)
REAL epar(0:atoms%lmaxd,atoms%ntype,dimension%jspd),evdu(2,dimension%jspd)
REAL eig(dimension%neigd) REAL eig(dimension%neigd)
REAL vz0(2) REAL vz0(2)
REAL uuilon(atoms%nlod,atoms%ntype),duilon(atoms%nlod,atoms%ntype) REAL uuilon(atoms%nlod,atoms%ntype),duilon(atoms%nlod,atoms%ntype)
...@@ -342,7 +340,7 @@ CONTAINS ...@@ -342,7 +340,7 @@ CONTAINS
eig_id,& eig_id,&
mpi%irank,mpi%isize,jspin,dimension%jspd,& mpi%irank,mpi%isize,jspin,dimension%jspd,&
noco%l_noco,& noco%l_noco,&
ello,evac,epar,wk,n_bands,n_size) n_bands,n_size)
#ifdef CPP_MPI #ifdef CPP_MPI
! Sinchronizes the RMA operations ! Sinchronizes the RMA operations
CALL MPI_BARRIER(mpi%mpi_comm,ie) CALL MPI_BARRIER(mpi%mpi_comm,ie)
...@@ -375,11 +373,11 @@ CONTAINS ...@@ -375,11 +373,11 @@ CONTAINS
DO l = 0,atoms%lmax(n) DO l = 0,atoms%lmax(n)
DO ispin =jsp_start,jsp_end DO ispin =jsp_start,jsp_end
CALL radfun(& CALL radfun(&
l,n,ispin,epar(l,n,ispin),vr(1,0,n,ispin),atoms,& l,n,ispin,enpara%el0(l,n,ispin),vr(1,0,n,ispin),atoms,&
f(1,1,l,ispin),g(1,1,l,ispin),usdus,& f(1,1,l,ispin),g(1,1,l,ispin),usdus,&
nodeu,noded,wronk) nodeu,noded,wronk)
IF (input%cdinf.AND.mpi%irank==0) WRITE (6,FMT=8002) l,& IF (input%cdinf.AND.mpi%irank==0) WRITE (6,FMT=8002) l,&
epar(l,n,ispin),usdus%us(l,n,ispin),usdus%dus(l,n,ispin),nodeu,& enpara%el0(l,n,ispin),usdus%us(l,n,ispin),usdus%dus(l,n,ispin),nodeu,&
usdus%uds(l,n,ispin),usdus%duds(l,n,ispin),noded,usdus%ddn(l,n,ispin),& usdus%uds(l,n,ispin),usdus%duds(l,n,ispin),noded,usdus%ddn(l,n,ispin),&
wronk wronk
END DO END DO
...@@ -408,7 +406,7 @@ CONTAINS ...@@ -408,7 +406,7 @@ CONTAINS
! !
IF ( atoms%nlo(n) > 0 ) THEN IF ( atoms%nlo(n) > 0 ) THEN
DO ispin = jsp_start,jsp_end DO ispin = jsp_start,jsp_end
CALL radflo(atoms,n,ispin, ello(1,1,ispin),vr(:,0,n,ispin), f(1,1,0,ispin),& CALL radflo(atoms,n,ispin, enpara%ello0(1,1,ispin),vr(:,0,n,ispin), f(1,1,0,ispin),&
g(1,1,0,ispin),mpi, usdus, uuilon,duilon,ulouilopn, flo(:,:,:,ispin)) g(1,1,0,ispin),mpi, usdus, uuilon,duilon,ulouilopn, flo(:,:,:,ispin))
END DO END DO
END IF END IF
...@@ -561,8 +559,7 @@ CONTAINS ...@@ -561,8 +559,7 @@ CONTAINS
eig_id,dimension%nvd,dimension%jspd,mpi%irank,mpi%isize,& eig_id,dimension%nvd,dimension%jspd,mpi%irank,mpi%isize,&
ikpt,jspin,zmat%nbasfcn,noco%l_ss,noco%l_noco,& ikpt,jspin,zmat%nbasfcn,noco%l_ss,noco%l_noco,&
noccbd,n_start,n_end,& noccbd,n_start,n_end,&
ello,evdu,epar,& nbands,eig,zMat)
wk,nbands,eig,zMat)
#ifdef CPP_MPI #ifdef CPP_MPI
! Sinchronizes the RMA operations ! Sinchronizes the RMA operations
if (l_evp) CALL MPI_BARRIER(mpi%mpi_comm,ie) if (l_evp) CALL MPI_BARRIER(mpi%mpi_comm,ie)
...@@ -575,8 +572,8 @@ CONTAINS ...@@ -575,8 +572,8 @@ CONTAINS
CALL nstm3(& CALL nstm3(&
sym,atoms,vacuum,stars,ikpt,lapw%nv(jspin),& sym,atoms,vacuum,stars,ikpt,lapw%nv(jspin),&
input,jspin,kpts,& input,jspin,kpts,&
cell,wk,lapw%k1(:,jspin),lapw%k2(:,jspin),& cell,kpts%wtkpt(ikpt),lapw%k1(:,jspin),lapw%k2(:,jspin),&
evac(1,jspin),vz,vz0,& enpara%evac0(1,jspin),vz,vz0,&
gvac1d,gvac2d) gvac1d,gvac2d)
END IF END IF
...@@ -591,7 +588,7 @@ CONTAINS ...@@ -591,7 +588,7 @@ CONTAINS
IF (mpi%irank==0) WRITE (16,FMT=*) 'NNNE',sliceplot%nnne IF (mpi%irank==0) WRITE (16,FMT=*) 'NNNE',sliceplot%nnne
IF (mpi%irank==0) WRITE (16,FMT=*) 'sliceplot%kk',sliceplot%kk IF (mpi%irank==0) WRITE (16,FMT=*) 'sliceplot%kk',sliceplot%kk
nslibd = 0 nslibd = 0
IF (input%pallst) we(:nbands) = wk IF (input%pallst) we(:nbands) = kpts%wtkpt(ikpt)
IF (sliceplot%kk.EQ.0) THEN IF (sliceplot%kk.EQ.0) THEN
IF (mpi%irank==0) THEN IF (mpi%irank==0) THEN
WRITE (16,FMT='(a)') 'ALL K-POINTS ARE TAKEN IN SLICE' WRITE (16,FMT='(a)') 'ALL K-POINTS ARE TAKEN IN SLICE'
...@@ -680,7 +677,7 @@ CONTAINS ...@@ -680,7 +677,7 @@ CONTAINS
IF (.NOT.((jspin.EQ.2) .AND. noco%l_noco)) THEN IF (.NOT.((jspin.EQ.2) .AND. noco%l_noco)) THEN
CALL timestart("cdnval: vacden") CALL timestart("cdnval: vacden")
CALL vacden(vacuum,dimension,stars,oneD, kpts,input, cell,atoms,noco,banddos,& CALL vacden(vacuum,dimension,stars,oneD, kpts,input, cell,atoms,noco,banddos,&
gvac1d,gvac2d, we,ikpt,jspin,vz,vz0, noccbd,lapw, evac,eig,& gvac1d,gvac2d, we,ikpt,jspin,vz,vz0, noccbd,lapw, enpara%evac0,eig,&
den,qvac,qvlay, qstars,zMat) den,qvac,qvlay, qstars,zMat)
CALL timestop("cdnval: vacden") CALL timestop("cdnval: vacden")
END IF END IF
...@@ -821,7 +818,7 @@ CONTAINS ...@@ -821,7 +818,7 @@ CONTAINS
bcof(:,0:,:,ispin),e1cof,e2cof, acoflo,bcoflo, results,f_a12) bcof(:,0:,:,ispin),e1cof,e2cof, acoflo,bcoflo, results,f_a12)
ENDIF ENDIF
CALL force_a21(input,atoms,dimension,noccbd,sym,& CALL force_a21(input,atoms,dimension,noccbd,sym,&
oneD,cell,we,ispin,epar(0:,:,ispin),noccbd,eig,usdus,acof(:,0:,:,ispin),& oneD,cell,we,ispin,enpara%el0(0:,:,ispin),noccbd,eig,usdus,acof(:,0:,:,ispin),&
bcof(:,0:,:,ispin),ccof(-atoms%llod:,:,:,:,ispin), aveccof,bveccof,cveccof,& bcof(:,0:,:,ispin),ccof(-atoms%llod:,:,:,:,ispin), aveccof,bveccof,cveccof,&
results,f_a21,f_b4) results,f_a21,f_b4)
...@@ -943,7 +940,7 @@ CONTAINS ...@@ -943,7 +940,7 @@ CONTAINS
CALL cdnmt(& CALL cdnmt(&
dimension%jspd,atoms,sphhar,llpd,& dimension%jspd,atoms,sphhar,llpd,&
noco,l_fmpl,jsp_start,jsp_end,& noco,l_fmpl,jsp_start,jsp_end,&
epar,ello,vr(:,0,:,:),uu,du,dd,uunmt,udnmt,dunmt,ddnmt,& enpara%el0,enpara%ello0,vr(:,0,:,:),uu,du,dd,uunmt,udnmt,dunmt,ddnmt,&
usdus,usdus%uloulopn,aclo,bclo,cclo,acnmt,bcnmt,ccnmt,& usdus,usdus%uloulopn,aclo,bclo,cclo,acnmt,bcnmt,ccnmt,&
orb,orbl,orblo,mt21,lo21,uloulopn21,uloulop21,& orb,orbl,orblo,mt21,lo21,uloulopn21,uloulop21,&
uunmt21,ddnmt21,udnmt21,dunmt21,& uunmt21,ddnmt21,udnmt21,dunmt21,&
......
...@@ -32,7 +32,7 @@ CONTAINS ...@@ -32,7 +32,7 @@ CONTAINS
! .. ! ..
! .. Local Arrays ! .. Local Arrays
INTEGER norb(23),iqsl(nsld),iqvacpc(2) INTEGER norb(23),iqsl(nsld),iqvacpc(2)
REAL bkpt(3),qvact(2) REAL qvact(2)
REAL, ALLOCATABLE :: eig(:),qvac(:,:,:,:),orbcomp(:,:,:,:,:) REAL, ALLOCATABLE :: eig(:),qvac(:,:,:,:),orbcomp(:,:,:,:,:)
REAL, ALLOCATABLE :: qal(:,:,:),qis(:),qvlay(:,:,:) REAL, ALLOCATABLE :: qal(:,:,:),qis(:),qvlay(:,:,:)
COMPLEX,ALLOCATABLE::qstars(:,:,:,:) COMPLEX,ALLOCATABLE::qstars(:,:,:,:)
...@@ -84,12 +84,12 @@ CONTAINS ...@@ -84,12 +84,12 @@ CONTAINS
!============================================================== !==============================================================
DO ikpt=1,kpts%nkpt DO ikpt=1,kpts%nkpt
! !
call read_eig(eig_id,ikpt,kspin,bk=bkpt,neig=nbands,eig=eig) call read_eig(eig_id,ikpt,kspin,neig=nbands,eig=eig)
call read_dos(eig_id,ikpt,kspin,qal,qvac(:,:,ikpt,kspin),qis,qvlay,qstars,ksym,jsym,& call read_dos(eig_id,ikpt,kspin,qal,qvac(:,:,ikpt,kspin),qis,qvlay,qstars,ksym,jsym,&
qintsl=qintsl(:,:,ikpt,kspin),qmtsl= qmtsl(:,:,ikpt,kspin),qmtp=qmtp(:,:,ikpt,kspin),orbcomp=orbcomp(:,:,:,ikpt,kspin)) qintsl=qintsl(:,:,ikpt,kspin),qmtsl= qmtsl(:,:,ikpt,kspin),qmtp=qmtp(:,:,ikpt,kspin),orbcomp=orbcomp(:,:,:,ikpt,kspin))
! write(*,*) kspin,nkpt,qmtp(1,:,ikpt,kspin) ! write(*,*) kspin,nkpt,qmtp(1,:,ikpt,kspin)
! !
WRITE (130,FMT=8000) (bkpt(i),i=1,3) WRITE (130,FMT=8000) (kpts%bk(i,ikpt),i=1,3)
8000 FORMAT (/,3x,' k =',3f10.5,/) 8000 FORMAT (/,3x,' k =',3f10.5,/)
! !
DO iband = 1,nbands DO iband = 1,nbands
......
...@@ -106,7 +106,7 @@ CONTAINS ...@@ -106,7 +106,7 @@ CONTAINS
DO ikpt=1,kpts%nkpt DO ikpt=1,kpts%nkpt
call read_eig(eig_id,ikpt,kspin,& call read_eig(eig_id,ikpt,kspin,&
bk=bkpt,wk=wk,neig=ne,eig=eig) neig=ne,eig=eig)
call read_dos(eig_id,ikpt,kspin,& call read_dos(eig_id,ikpt,kspin,&
& qal(:,:,:,kspin),qvac(:,:,ikpt,kspin),& & qal(:,:,:,kspin),qvac(:,:,ikpt,kspin),&
& qis(:,ikpt,kspin),& & qis(:,ikpt,kspin),&
...@@ -114,8 +114,8 @@ CONTAINS ...@@ -114,8 +114,8 @@ CONTAINS
CALL cdninf(& CALL cdninf(&
& input,sym,noco,kspin,atoms,& & input,sym,noco,kspin,atoms,&
& vacuum,sliceplot,banddos,ikpt,bkpt,& & vacuum,sliceplot,banddos,ikpt,kpts%bk(:,ikpt),&
& wk,cell,kpts,& & kpts%wtkpt(ikpt),cell,kpts,&
& ne,eig,qal(0:,:,:,kspin),qis,qvac,& & ne,eig,qal(0:,:,:,kspin),qis,qvac,&
& qvlay(:,:,:),& & qvlay(:,:,:),&
& qstars,ksym,jsym) & qstars,ksym,jsym)
......
...@@ -164,7 +164,7 @@ ...@@ -164,7 +164,7 @@
ALLOCATE( orbcomp(dimension%neigd,23,atoms%nat),qintsl(nsld,dimension%neigd)) ALLOCATE( orbcomp(dimension%neigd,23,atoms%nat),qintsl(nsld,dimension%neigd))
ALLOCATE( qmtsl(nsld,dimension%neigd),qmtp(dimension%neigd,atoms%nat),qvac(dimension%neigd,2)) ALLOCATE( qmtsl(nsld,dimension%neigd),qmtp(dimension%neigd,atoms%nat),qvac(dimension%neigd,2))
ALLOCATE( qis(dimension%neigd),qvlay(dimension%neigd,vacuum%layerd,2)) ALLOCATE( qis(dimension%neigd),qvlay(dimension%neigd,vacuum%layerd,2))
CALL read_eig(eig_id,k,jspin,wk=wt(k),neig=nevk(k),eig=ev(:,k)) CALL read_eig(eig_id,k,jspin,neig=nevk(k),eig=ev(:,k))
CALL read_dos(eig_id,k,jspin,qal_tmp,qvac,qis,qvlay,qstars,ksym,jsym,mcd,qintsl,qmtsl,qmtp,orbcomp) CALL read_dos(eig_id,k,jspin,qal_tmp,qvac,qis,qvlay,qstars,ksym,jsym,mcd,qintsl,qmtsl,qmtp,orbcomp)
IF (.NOT.l_orbcomp) THEN IF (.NOT.l_orbcomp) THEN
qal(1:lmax*atoms%ntype,:,k)=reshape(qal_tmp,(/lmax*atoms%ntype,size(qal_tmp,3)/)) qal(1:lmax*atoms%ntype,:,k)=reshape(qal_tmp,(/lmax*atoms%ntype,size(qal_tmp,3)/))
...@@ -337,7 +337,7 @@ ...@@ -337,7 +337,7 @@
nevk,wt,ev,qal, g) nevk,wt,ev,qal, g)
ELSE ELSE
CALL dos_bin(input%jspins,3*atoms%ntype*ncored,ned,emin,emax,ntb,kpts%nkpt,& CALL dos_bin(input%jspins,3*atoms%ntype*ncored,ned,emin,emax,ntb,kpts%nkpt,&
nevk(1:kpts%nkpt),wt(1:kpts%nkpt),ev(1:ntb,1:kpts%nkpt), mcd(1:3*atoms%ntype*ncored,1:ntb,1:kpts%nkpt), g) nevk(1:kpts%nkpt),kpts%wtkpt(1:kpts%nkpt),ev(1:ntb,1:kpts%nkpt), mcd(1:3*atoms%ntype*ncored,1:ntb,1:kpts%nkpt), g)
ENDIF ENDIF
ENDIF ENDIF
! !
......
...@@ -199,14 +199,8 @@ CONTAINS ...@@ -199,14 +199,8 @@ CONTAINS
zMat%data_c(:lapw%nmat,:ne_found) = CMPLX(0.0,0.0) zMat%data_c(:lapw%nmat,:ne_found) = CMPLX(0.0,0.0)
ENDIF ENDIF
ENDIF ENDIF
CALL write_eig(eig_id, nk,jsp,ne_found,ne_all,lapw%nv(jsp),lapw%nmat,& CALL write_eig(eig_id, nk,jsp,ne_found,ne_all,&
bkpt, kpts%wtkpt(nk),eig(:ne_found),el=enpara%el0(0:,:,jsp),ello=enpara%ello0(:,:,jsp),evac=enpara%evac0(:,jsp),& eig(:ne_found),n_start=mpi%n_size,n_end=mpi%n_rank,zmat=zMat)
nlotot=atoms%nlotot,n_start=mpi%n_size,n_end=mpi%n_rank,zmat=zMat)
IF (noco%l_noco) THEN
CALL write_eig(eig_id, nk,2,ne_found,ne_all,lapw%nv(2),lapw%nmat,&
bkpt, kpts%wtkpt(nk),eig(:ne_found),el=enpara%el0(0:,:,2),ello= enpara%ello0(:,:,2),evac=enpara%evac0(:,2),&
nlotot=atoms%nlotot)
ENDIF
#if defined(CPP_MPI) #if defined(CPP_MPI)
!RMA synchronization !RMA synchronization
CALL MPI_BARRIER(mpi%MPI_COMM,ierr) CALL MPI_BARRIER(mpi%MPI_COMM,ierr)
......
...@@ -8,7 +8,7 @@ MODULE m_aline ...@@ -8,7 +8,7 @@ MODULE m_aline
USE m_juDFT USE m_juDFT
CONTAINS CONTAINS
SUBROUTINE aline(eig_id, nk,atoms,DIMENSION,sym,& SUBROUTINE aline(eig_id, nk,atoms,DIMENSION,sym,&
cell,input, jsp,el,usdus,lapw,tlmplm, noco, oneD, bkpt,eig,ne,zMat,hmat,smat) cell,input, jsp,el,usdus,lapw,tlmplm, noco, oneD,eig,ne,zMat,hmat,smat)
!************************************************************************ !************************************************************************
!* * !* *
!* eigensystem-solver for moderatly-well converged potentials * !* eigensystem-solver for moderatly-well converged potentials *
...@@ -54,7 +54,7 @@ CONTAINS ...@@ -54,7 +54,7 @@ CONTAINS
! .. ! ..
! .. Array Arguments .. ! .. Array Arguments ..
REAL, INTENT (IN) :: el(0:atoms%lmaxd,atoms%ntype,DIMENSION%jspd) REAL, INTENT (IN) :: el(0:atoms%lmaxd,atoms%ntype,DIMENSION%jspd)
REAL, INTENT (OUT) :: eig(DIMENSION%neigd),bkpt(3) REAL, INTENT (OUT) :: eig(DIMENSION%neigd)
TYPE(t_mat),INTENT(IN):: hmat,smat TYPE(t_mat),INTENT(IN):: hmat,smat
! .. ! ..
...@@ -80,7 +80,7 @@ CONTAINS ...@@ -80,7 +80,7 @@ CONTAINS
lhelp= MAX(lapw%nmat,(DIMENSION%neigd+2)*DIMENSION%neigd) lhelp= MAX(lapw%nmat,(DIMENSION%neigd+2)*DIMENSION%neigd)
CALL read_eig(eig_id,nk,jsp,bk=bkpt,neig=ne,nv=lapw%nv(jsp),nmat=lapw%nmat, eig=eig,zmat=zmat) CALL read_eig(eig_id,nk,jsp,neig=ne, eig=eig,zmat=zmat)
IF (l_real) THEN IF (l_real) THEN
ALLOCATE ( h_r(DIMENSION%neigd,DIMENSION%neigd),s_r(DIMENSION%neigd,DIMENSION%neigd) ) ALLOCATE ( h_r(DIMENSION%neigd,DIMENSION%neigd),s_r(DIMENSION%neigd,DIMENSION%neigd) )
h_r = 0.0 ; s_r=0.0 h_r = 0.0 ; s_r=0.0
......
...@@ -12,7 +12,7 @@ CONTAINS ...@@ -12,7 +12,7 @@ CONTAINS
rsopp,rsoppd,rsopdp,rsopdpd,nk,& rsopp,rsoppd,rsopdp,rsopdpd,nk,&
rsoplop,rsoplopd,rsopdplo,rsopplo,rsoploplop,& rsoplop,rsoplopd,rsopdplo,rsopplo,rsoploplop,&
usdus,soangl,& usdus,soangl,&
ello,nsize,nmat,& nsize,nmat,&
eig_so,zso) eig_so,zso)
#include"cpp_double.h" #include"cpp_double.h"
...@@ -50,7 +50,7 @@ CONTAINS ...@@ -50,7 +50,7 @@ CONTAINS
REAL, INTENT (IN) :: rsoploplop(atoms%ntype,atoms%nlod,atoms%nlod,2,2) REAL, INTENT (IN) :: rsoploplop(atoms%ntype,atoms%nlod,atoms%nlod,2,2)
COMPLEX, INTENT (IN) :: soangl(atoms%lmaxd,-atoms%lmaxd:atoms%lmaxd,2,atoms%lmaxd,-atoms%lmaxd:atoms%lmaxd,2) COMPLEX, INTENT (IN) :: soangl(atoms%lmaxd,-atoms%lmaxd:atoms%lmaxd,2,atoms%lmaxd,-atoms%lmaxd:atoms%lmaxd,2)
COMPLEX, INTENT (OUT) :: zso(:,:,:)!(dimension%nbasfcn,2*dimension%neigd,wannierspin) COMPLEX, INTENT (OUT) :: zso(:,:,:)!(dimension%nbasfcn,2*dimension%neigd,wannierspin)
REAL, INTENT (OUT) :: eig_so(2*DIMENSION%neigd),ello(atoms%nlod,atoms%ntype,DIMENSION%jspd) REAL, INTENT (OUT) :: eig_so(2*DIMENSION%neigd)
!-odim !-odim
!+odim !+odim
! .. ! ..
...@@ -65,8 +65,7 @@ CONTAINS ...@@ -65,8 +65,7 @@ CONTAINS
! .. ! ..
! .. Local Arrays .. ! .. Local Arrays ..
INTEGER :: nsz(2) INTEGER :: nsz(2)
REAL :: eig(DIMENSION%neigd,DIMENSION%jspd),s(3),bkpt(3) REAL :: eig(DIMENSION%neigd,DIMENSION%jspd),s(3)
REAL :: epar(0:atoms%lmaxd,atoms%ntype),evac(2)
REAL, ALLOCATABLE :: rwork(:) REAL, ALLOCATABLE :: rwork(:)
COMPLEX,ALLOCATABLE :: cwork(:),chelp(:,:,:,:,:) COMPLEX,ALLOCATABLE :: cwork(:),chelp(:,:,:,:,:)
COMPLEX,ALLOCATABLE :: ahelp(:,:,:,:,:),bhelp(:,:,:,:,:) COMPLEX,ALLOCATABLE :: ahelp(:,:,:,:,:),bhelp(:,:,:,:,:)
...@@ -113,9 +112,7 @@ CONTAINS ...@@ -113,9 +112,7 @@ CONTAINS
DO jsp = 1,input%jspins DO jsp = 1,input%jspins
CALL read_eig(& CALL read_eig(&
eig_id,nk,jsp,& eig_id,nk,jsp, neig=ne,eig=eig(:,jsp))
el=epar,ello=ello(:,:,jsp),&
evac=evac,neig=ne,eig=eig(:,jsp))
CALL read_eig(& CALL read_eig(&
eig_id,nk,jsp,& eig_id,nk,jsp,&
n_start=1,n_end=ne,& n_start=1,n_end=ne,&
......
...@@ -21,7 +21,7 @@ MODULE m_eigenso ...@@ -21,7 +21,7 @@ MODULE m_eigenso
! !
CONTAINS CONTAINS
SUBROUTINE eigenso(eig_id,mpi,DIMENSION,stars,vacuum,atoms,sphhar,& SUBROUTINE eigenso(eig_id,mpi,DIMENSION,stars,vacuum,atoms,sphhar,&
obsolete,sym,cell,noco,input,kpts,oneD,vTot) obsolete,sym,cell,noco,input,kpts,oneD,vTot,enpara)
USE m_eig66_io, ONLY : read_eig,write_eig USE m_eig66_io, ONLY : read_eig,write_eig
USE m_spnorb USE m_spnorb
...@@ -46,6 +46,7 @@ CONTAINS ...@@ -46,6 +46,7 @@ CONTAINS
TYPE(t_sphhar),INTENT(IN) :: sphhar TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_atoms),INTENT(IN) :: atoms TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_potden),INTENT(IN) :: vTot TYPE(t_potden),INTENT(IN) :: vTot
TYPE(t_enpara),INTENT(IN) :: enpara
! .. ! ..
! .. Scalar Arguments .. ! .. Scalar Arguments ..
INTEGER, INTENT (IN) :: eig_id INTEGER, INTENT (IN) :: eig_id
...@@ -56,7 +57,6 @@ CONTAINS ...@@ -56,7 +57,6 @@ CONTAINS
INTEGER n_loc,n_plus,i_plus,n_end,nsz,nmat INTEGER n_loc,n_plus,i_plus,n_end,nsz,nmat
LOGICAL l_socvec !,l_all LOGICAL l_socvec !,l_all
INTEGER wannierspin INTEGER wannierspin
TYPE(t_enpara) :: enpara
TYPE(t_usdus):: usdus TYPE(t_usdus):: usdus
! .. ! ..
! .. Local Arrays.. ! .. Local Arrays..
...@@ -89,10 +89,8 @@ CONTAINS ...@@ -89,10 +89,8 @@ CONTAINS
usdus%uds(0:atoms%lmaxd,atoms%ntype,DIMENSION%jspd),usdus%duds(0:atoms%lmaxd,atoms%ntype,DIMENSION%jspd),& usdus%uds(0:atoms%lmaxd,atoms%ntype,DIMENSION%jspd),usdus%duds(0:atoms%lmaxd,atoms%ntype,DIMENSION%jspd),&
usdus%ddn(0:atoms%lmaxd,atoms%ntype,DIMENSION%jspd),& usdus%ddn(0:atoms%lmaxd,atoms%ntype,DIMENSION%jspd),&
usdus%ulos(atoms%nlod,atoms%ntype,DIMENSION%jspd),usdus%dulos(atoms%nlod,atoms%ntype,DIMENSION%jspd),& usdus%ulos(atoms%nlod,atoms%ntype,DIMENSION%jspd),usdus%dulos(atoms%nlod,atoms%ntype,DIMENSION%jspd),&
usdus%uulon(atoms%nlod,atoms%ntype,DIMENSION%jspd),usdus%dulon(atoms%nlod,atoms%ntype,DIMENSION%jspd),& usdus%uulon(atoms%nlod,atoms%ntype,DIMENSION%jspd),usdus%dulon(atoms%nlod,atoms%ntype,DIMENSION%jspd))
enpara%evac0(2,DIMENSION%jspd),enpara%ello0(atoms%nlod,atoms%ntype,DIMENSION%jspd),&
enpara%el0(0:atoms%lmaxd,atoms%ntype,DIMENSION%jspd))
IF (input%l_wann.OR.l_socvec) THEN IF (input%l_wann.OR.l_socvec) THEN
wannierspin = 2 wannierspin = 2
ELSE ELSE
...@@ -101,15 +99,8 @@ CONTAINS ...@@ -101,15 +99,8 @@ CONTAINS
! !
!---> set up and solve the eigenvalue problem !---> set up and solve the eigenvalue problem
! ---> radial k-idp s-o matrix elements calc. and storage
! !
!---> radial k-idp s-o matrix elements calc. and storage
!
DO jspin = 1, input%jspins
CALL read_eig(eig_id,&
1,jspin,&
el=enpara%el0(:,:,jspin),&
ello=enpara%ello0(:,:,jspin),evac=enpara%evac0(:,jspin))
ENDDO
#if defined(CPP_MPI) #if defined(CPP_MPI)
!RMA synchronization !RMA synchronization
CALL MPI_BARRIER(mpi%MPI_COMM,ierr) CALL MPI_BARRIER(mpi%MPI_COMM,ierr)
...@@ -215,14 +206,10 @@ CONTAINS ...@@ -215,14 +206,10 @@ CONTAINS
ALLOCATE( zso(lapw%nv(1)+atoms%nlotot,2*DIMENSION%neigd,wannierspin)) ALLOCATE( zso(lapw%nv(1)+atoms%nlotot,2*DIMENSION%neigd,wannierspin))
zso(:,:,:) = CMPLX(0.0,0.0) zso(:,:,:) = CMPLX(0.0,0.0)
CALL timestart("eigenso: alineso") CALL timestart("eigenso: alineso")
CALL alineso(eig_id,lapw,& CALL alineso(eig_id,lapw, mpi,DIMENSION,atoms,sym,kpts,&
mpi,DIMENSION,atoms,sym,kpts,& input,noco,cell,oneD, rsopp,rsoppd,rsopdp,rsopdpd,nk,&
input,noco,cell,oneD,&
rsopp,rsoppd,rsopdp,rsopdpd,nk,&
rsoplop,rsoplopd,rsopdplo,rsopplo,rsoploplop,& rsoplop,rsoplopd,rsopdplo,rsopplo,rsoploplop,&
usdus,soangl,& usdus,soangl, nsz,nmat, eig_so,zso)
enpara%ello0,nsz,nmat,&
eig_so,zso)
CALL timestop("eigenso: alineso") CALL timestop("eigenso: alineso")
IF (mpi%irank.EQ.0) THEN IF (mpi%irank.EQ.0) THEN
WRITE (16,FMT=8010) nk,nsz WRITE (16,FMT=8010) nk,nsz
...@@ -233,18 +220,14 @@ CONTAINS ...@@ -233,18 +220,14 @@ CONTAINS
8020 FORMAT (5x,5f12.6) 8020 FORMAT (5x,5f12.6)
IF (input%eonly) THEN IF (input%eonly) THEN
CALL write_eig(eig_id,& CALL write_eig(eig_id, nk,jspin,neig=nsz,neig_total=nsz, eig=eig_so(:nsz))
nk,jspin,neig=nsz,neig_total=nsz,nmat=SIZE(zso,1),&
eig=eig_so(:nsz))
ELSE ELSE
CALL zmat%alloc(.FALSE.,SIZE(zso,1),nsz) CALL zmat%alloc(.FALSE.,SIZE(zso,1),nsz)
DO jspin = 1,wannierspin DO jspin = 1,wannierspin
CALL timestart("eigenso: write_eig") CALL timestart("eigenso: write_eig")
zmat%data_c=zso(:,:nsz,jspin) zmat%data_c=zso(:,:nsz,jspin)
CALL write_eig(eig_id,& CALL write_eig(eig_id, nk,jspin,neig=nsz,neig_total=nsz, eig=eig_so(:nsz),zmat=zmat)
nk,jspin,neig=nsz,neig_total=nsz,nmat=nmat,&
eig=eig_so(:nsz),zmat=zmat)
CALL timestop("eigenso: write_eig") CALL timestop("eigenso: write_eig")
ENDDO ENDDO
......
...@@ -76,15 +76,16 @@ CONTAINS ...@@ -76,15 +76,16 @@ CONTAINS
nrec1 = kpts%nkpt*(jsp-1) + nk nrec1 = kpts%nkpt*(jsp-1) + nk
zmat(nk)%nbasfcn=dimension%nbasfcn zmat(nk)%nbasfcn=dimension%nbasfcn
zmat(nk)%nbands=dimension%neigd2 zmat(nk)%nbands=dimension%neigd2
if (l_real) THEN IF (l_real) THEN
ALLOCATE(zmat(nk)%z_r(dimension%nbasfcn,dimension%neigd2)) ALLOCATE(zmat(nk)%z_r(dimension%nbasfcn,dimension%neigd2))
ALLOCATE(zmat(nk)%z_c(0,0)) ALLOCATE(zmat(nk)%z_c(0,0))
else else
ALLOCATE(zmat(nk)%z_c(dimension%nbasfcn,dimension%neigd2)) ALLOCATE(zmat(nk)%z_c(dimension%nbasfcn,dimension%neigd2))
ALLOCATE(zmat(nk)%z_r(0,0)) ALLOCATE(zmat(nk)%z_r(0,0))
endif ENDIF
CALL read_eig(eig_id_hf,nk,jsp,el=el_eig,ello=ello_eig, neig=hybrid%ne_eig(nk),eig=eig_irr(:,nk), w_iks=results%w_iks(:,nk,jsp),&!kveclo=hybdat%kveclo_eig(:,nk), CALL judft_error("TODO,hs_setup")
zmat=zmat(nk)) !CALL read_eig(eig_id_hf,nk,jsp,el=el_eig,ello=ello_eig, neig=hybrid%ne_eig(nk),eig=eig_irr(:,nk), w_iks=results%w_iks(:,nk,jsp),&!kveclo=hybdat%kveclo_eig(:,nk),
! zmat=zmat(nk))
END DO END DO
!Allocate further space !Allocate further space
...@@ -301,7 +302,8 @@ CONTAINS ...@@ -301,7 +302,8 @@ CONTAINS
! Reading the eig file ! Reading the eig file
!DO nk = n_start,kpts%nkpt,n_stride !DO nk = n_start,kpts%nkpt,n_stride
DO nk = 1,kpts%nkpt,1 DO nk = 1,kpts%nkpt,1
CALL read_eig(eig_id_hf,nk,jsp,el=el_eig, ello=ello_eig,neig=hybrid%ne_eig(nk),w_iks=results%w_iks(:,nk,jsp)) CALL judft_error("TODO,hs_setup")
! CALL read_eig(eig_id_hf,nk,jsp,el=el_eig, ello=ello_eig,neig=hybrid%ne_eig(nk),w_iks=results%w_iks(:,nk,jsp))
hybrid%nobd(nk) = COUNT(results%w_iks(:hybrid%ne_eig(nk),nk,jsp) > 0.0 ) hybrid%nobd(nk) = COUNT(results%w_iks(:hybrid%ne_eig(nk),nk,jsp) > 0.0 )
END DO END DO
......
...@@ -198,7 +198,8 @@ CONTAINS ...@@ -198,7 +198,8 @@ CONTAINS
DO jsp=1,DIMENSION%jspd DO jsp=1,DIMENSION%jspd
CALL read_eig(eig_id,1,jsp,el=el(:,:,jsp),ello=ello(:,:,jsp)) CALL judft_error("TODO,mixedbasis")
! CALL read_eig(eig_id,1,jsp,el=el(:,:,jsp),ello=ello(:,:,jsp))
ENDDO ENDDO
ALLOCATE ( vr0(atoms%jmtd,atoms%ntype,DIMENSION%jspd) ) ALLOCATE ( vr0(atoms%jmtd,atoms%ntype,DIMENSION%jspd) )
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
> eig_id, > eig_id,
> irank,isize,jspin,jspins, > irank,isize,jspin,jspins,
> l_noco, > l_noco,
< ello,evac,epar,wk,n_bands,n_size) < n_bands,n_size)
USE m_eig66_io, ONLY : read_eig USE m_eig66_io, ONLY : read_eig
IMPLICIT NONE IMPLICIT NONE
! !
...@@ -29,27 +29,17 @@ ...@@ -29,27 +29,17 @@
INTEGER, INTENT (OUT) :: n_size INTEGER, INTENT (OUT) :: n_size
REAL, INTENT (INOUT) :: wk
INTEGER, INTENT (OUT) :: n_bands(0:) !n_bands(0:neigd) INTEGER, INTENT (OUT) :: n_bands(0:) !n_bands(0:neigd)
REAL, INTENT (INOUT) :: ello(:,:,:),evac(:,:) !ello(nlod,ntypd,jspd),evac(2,jspd)
REAL, INTENT (INOUT) :: epar(0:,:,:) !epar(0:lmaxd,ntypd,jspd)
INTEGER isp INTEGER isp
IF (l_noco) THEN IF (l_noco) THEN
CALL read_eig(eig_id,1,1, CALL read_eig(eig_id,1,1,
< neig=n_bands(1)) < neig=n_bands(1))
DO isp = 1, jspins
CALL read_eig(eig_id,1,isp,
< el=epar(:,:,isp),ello=ello(:,:,isp),evac=evac(:,isp))
ENDDO
ELSE ELSE
CALL read_eig(eig_id,1,jspin, CALL read_eig(eig_id,1,jspin,
< neig=n_bands(1),el=epar(:,:,jspin), < neig=n_bands(1))
< ello=ello(:,:,jspin),evac=evac(:,jspin))
ENDIF ENDIF
c c
c n_size is the number of records per k-point, c n_size is the number of records per k-point,
...@@ -67,8 +57,7 @@ c ...@@ -67,8 +57,7 @@ c
> eig_id,nvd,jspd,irank,isize, > eig_id,nvd,jspd,irank,isize,
> ikpt,jspin,nbasfcn,l_ss,l_noco, > ikpt,jspin,nbasfcn,l_ss,l_noco,
> noccbd,n_start,n_end, > noccbd,n_start,n_end,
< ello,evdu,epar, < nbands,eig,zmat)
< wk,nbands,eig,zmat)
USE m_eig66_io, ONLY : read_eig USE m_eig66_io, ONLY : read_eig
USE m_types USE m_types
...@@ -82,12 +71,9 @@ c ...@@ -82,12 +71,9 @@ c
INTEGER, INTENT (IN) :: noccbd,n_start,n_end INTEGER, INTENT (IN) :: noccbd,n_start,n_end
LOGICAL, INTENT (IN) :: l_ss,l_noco LOGICAL, INTENT (IN) :: l_ss,l_noco
INTEGER, INTENT (OUT) :: nbands INTEGER, INTENT (OUT) :: nbands
REAL, INTENT (OUT) :: wk
REAL, INTENT (OUT) :: eig(:) !bkpt(3),eig(neigd) REAL, INTENT (OUT) :: eig(:) !bkpt(3),eig(neigd)
REAL, INTENT (INOUT) :: ello(:,:,:),evdu(:,:) !ello(nlod,ntypd,jspd),evdu(2,jspd)
REAL, INTENT (INOUT) :: epar(0:,:,:) !epar(0:lmaxd,ntypd,jspd)
TYPE(t_zmat), INTENT (INOUT) :: zmat !z(nbasfcn,noccbd) !can be real/complex TYPE(t_zmat), INTENT (INOUT) :: zmat !z(nbasfcn,noccbd) !can be real/complex
! !
! Local variables ... ! Local variables ...
...@@ -103,34 +89,23 @@ c ...@@ -103,34 +89,23 @@ c
! !
CALL timestart("cdn_read") CALL timestart("cdn_read")
IF (l_ss) THEN IF (l_ss) THEN
CALL read_eig(eig_id,ikpt,1, CALL read_eig(eig_id,ikpt,1, neig=nbands)
< wk=wk,neig=nbands) CALL read_eig(eig_id,ikpt,1,n_start=n_start,n_end=n_end,
DO isp = jspd,1,-1 < eig=eig,zmat=zmat)
CALL read_eig(eig_id,ikpt,isp,
< nmat=nmat)
! write(*,*) kveclo
ENDDO
CALL read_eig(
> eig_id,ikpt,1,n_start=n_start,n_end=n_end,
< eig=eig,nmat=nmat,zmat=zmat)
!