Commit 38ee135e authored by Daniel Wortmann's avatar Daniel Wortmann

Merge branch 'develop' of iffgit.fz-juelich.de:fleur/fleur into develop

parents 49d5f493 e4779da8
......@@ -562,7 +562,7 @@ CONTAINS
nbands,eig,zMat)
#ifdef CPP_MPI
! Sinchronizes the RMA operations
if (l_evp) CALL MPI_BARRIER(mpi%mpi_comm,ie)
CALL MPI_BARRIER(mpi%mpi_comm,ie)
#endif
!IF (l_evp.AND.(isize.GT.1)) THEN
! eig(1:noccbd) = eig(n_start:n_end)
......
......@@ -8,6 +8,7 @@
!More description at end of file
MODULE m_eigen
USE m_juDFT
IMPLICIT NONE
CONTAINS
!>The eigenvalue problem is constructed and solved in this routine. The following steps are performed:
!> 1. Preparation: generate energy parameters, open eig-file
......
......@@ -68,7 +68,7 @@ CONTAINS
!This is for collinear calculations: the (1,1) element of the matrices is all
!that is needed and allocated
CALL hsmt_sph(n,atoms,mpi,ispin,input,noco,cell,1,1,chi_one,lapw,enpara%el0,&
td%e_shift,usdus,fj(:,0:,ispin,:),gj(:,0:,ispin,:),smat(1,1),hmat(1,1))
td%e_shift(n,ispin),usdus,fj(:,0:,ispin,:),gj(:,0:,ispin,:),smat(1,1),hmat(1,1))
CALL hsmt_nonsph(n,mpi,sym,atoms,ispin,1,1,chi_one,noco,cell,lapw,td,&
fj(:,0:,ispin,:),gj(:,0:,ispin,:),hmat(1,1))
CALL hsmt_lo(input,atoms,sym,cell,mpi,noco,lapw,usdus,td,fj(:,0:,ispin,:),gj(:,0:,ispin,:),&
......@@ -79,7 +79,7 @@ CONTAINS
!stored in tmp-variables. Then these are distributed (rotated) into the 2x2
!global spin-matrices.
CALL hmat_tmp%clear();CALL smat_tmp%clear()
CALL hsmt_sph(n,atoms,mpi,ispin,input,noco,cell,1,1,chi_one,lapw,enpara%el0,td%e_shift,&
CALL hsmt_sph(n,atoms,mpi,ispin,input,noco,cell,1,1,chi_one,lapw,enpara%el0,td%e_shift(n,ispin),&
usdus,fj(:,0:,ispin,:),gj(:,0:,ispin,:),smat_tmp,hmat_tmp)
CALL hsmt_nonsph(n,mpi,sym,atoms,ispin,1,1,chi_one,noco,cell,lapw,td,&
fj(:,0:,ispin,:),gj(:,0:,ispin,:),hmat_tmp)
......@@ -100,7 +100,7 @@ CONTAINS
DO iintsp=1,2
DO jintsp=1,2
CALL hsmt_sph(n,atoms,mpi,ispin,input,noco,cell,iintsp,jintsp,chi(iintsp,jintsp),&
lapw,enpara%el0,td%e_shift,usdus,fj(:,0:,ispin,:),gj(:,0:,ispin,:),&
lapw,enpara%el0,td%e_shift(n,ispin),usdus,fj(:,0:,ispin,:),gj(:,0:,ispin,:),&
smat(iintsp,jintsp),hmat(iintsp,jintsp))
CALL hsmt_nonsph(n,mpi,sym,atoms,ispin,iintsp,jintsp,chi(iintsp,jintsp),noco,cell,&
lapw,td,fj(:,0:,ispin,:),gj(:,0:,ispin,:),hmat(iintsp,jintsp))
......
......@@ -64,6 +64,10 @@ CONTAINS
gkrot(:,k) = MATMUL(TRANSPOSE(bmrot),v)
END DO
END IF
!$OMP PARALLEL DO DEFAULT(none) &
!$OMP& SHARED(lapw,gkrot,lmax,c_ph,iintsp,ab,fj,gj,abclo,cell,atoms) &
!$OMP& SHARED(alo1,blo1,clo1,ab_size,na,n) &
!$OMP& PRIVATE(k,vmult,ylm,l,ll1,m,lm,term,invsfct,lo,nkvec)
DO k = 1,lapw%nv(1)
!--> generate spherical harmonics
vmult(:) = gkrot(:,k)
......@@ -98,6 +102,7 @@ CONTAINS
ENDIF
ENDDO !k-loop
!$OMP END PARALLEL DO
IF (.NOT.l_apw) ab_size=ab_size*2
END SUBROUTINE hsmt_ab
......
......@@ -27,7 +27,7 @@ CONTAINS
! ..
! .. Array Arguments ..
REAL, INTENT (IN) :: el(0:atoms%lmaxd,atoms%ntype,input%jspins)
REAL, INTENT (IN) :: e_shift(input%jspins)
REAL, INTENT (IN) :: e_shift!(atoms%ntype,input%jspins)
REAL, INTENT (IN) :: fj(:,0:,:),gj(:,0:,:)
! ..
! .. Local Scalars ..
......@@ -103,7 +103,7 @@ CONTAINS
ENDIF
ddnln = usdus%ddn(l,n,isp)
elall = el(l,n,isp)
IF (l<=atoms%lnonsph(n)) elall=elall-e_shift(isp)
IF (l<=atoms%lnonsph(n)) elall=elall-e_shift!(isp)
IF (smat%l_real) THEN
DO kj = 1,ki
fct = plegend(kj,l)*fl2p1(l)*&
......
......@@ -40,7 +40,7 @@ MODULE m_tlmplm_cholesky
REAL temp,wronk
INTEGER i,l,l2,lamda,lh,lm,lmin,lmin0,lmp,lmpl,lmplm,lmx,lmxx,lp,info,in
INTEGER lp1,lpl ,mem,mems,mp,mu,n,nh,noded,nodeu ,na,m,nsym,s,i_u
LOGICAL l_write,ok
LOGICAL l_write,OK
! ..
! .. Local Arrays ..
REAL vr0(size(v%mt,1),0:size(v%mt,2)-1,size(v%mt,3))
......@@ -58,14 +58,13 @@ MODULE m_tlmplm_cholesky
REAL, ALLOCATABLE :: uun21(:,:),udn21(:,:),dun21(:,:),ddn21(:,:)
COMPLEX :: c
REAL,PARAMETER:: e_shift_min=0.2
REAL,PARAMETER:: e_shift_min=0.02
REAL,PARAMETER:: e_shift_max=65.0
vr0=v%mt(:,:,:,jsp)
vr0(:,0,:)=0.0
! ..e_shift
td%e_shift(jsp)=e_shift_min
OK=.FALSE.
td%e_shift(:,jsp)=e_shift_min
IF (noco%l_constr) THEN
......@@ -74,29 +73,32 @@ MODULE m_tlmplm_cholesky
CALL rad_ovlp(atoms,ud,input,v%mt,enpara%el0, uun21,udn21,dun21,ddn21)
ENDIF
cholesky_loop:DO WHILE(.NOT.OK)
td%h_loc(:,:,:,jsp)=0.0
td%h_off=0.0
OK=.true.
td%tdulo(:,:,:,jsp) = cmplx(0.0,0.0)
td%tuulo(:,:,:,jsp) = cmplx(0.0,0.0)
td%tuloulo(:,:,:,jsp) = cmplx(0.0,0.0)
l_write = mpi%irank==0
!
!---> generate the wavefunctions for each l
!
l_write=mpi%irank==0
!!$ l_write=.false.
!!$ call gaunt2(atoms%lmaxd)
!!$OMP PARALLEL DO DEFAULT(NONE)&
!!$OMP PRIVATE(indt,dvd,dvu,uvd,uvu,f,g,x,flo,uuilon,duilon,ulouilopn)&
!!$OMP PRIVATE(cil,temp,wronk,i,l,l2,lamda,lh,lm,lmin,lmin0,lmp,lmpl)&
!!$OMP PRIVATE(lmplm,lmx,lmxx,lp,lp1,lpl,m,mem,mems,mp,mu,n,nh,noded)&
!!$OMP PRIVATE(nodeu,nsym,na)&
!!$OMP SHARED(atoms,jspin,jsp,sphhar,enpara,td,ud,l_write,ci,v,mpi,input)
DO n = 1,atoms%ntype
na=sum(atoms%neq(:n-1))+1
td%tdulo(:,:,:,jsp) = cmplx(0.0,0.0)
td%tuulo(:,:,:,jsp) = cmplx(0.0,0.0)
td%tuloulo(:,:,:,jsp) = cmplx(0.0,0.0)
td%h_off=0.0
!$ l_write=.false.
!$ call gaunt2(atoms%lmaxd)
!$OMP PARALLEL DO DEFAULT(NONE)&
!$OMP PRIVATE(indt,dvd,dvu,uvd,uvu,f,g,x,flo,uuilon,duilon,ulouilopn)&
!$OMP PRIVATE(cil,temp,wronk,i,l,l2,lamda,lh,lm,lmin,lmin0,lmp,lmpl)&
!$OMP PRIVATE(lmplm,lmx,lmxx,lp,lp1,lpl,m,mem,mems,mp,mu,n,nh,noded)&
!$OMP PRIVATE(nodeu,nsym,na,OK,s,in,info,c)&
!$OMP SHARED(atoms,jspin,jsp,sphhar,enpara,td,ud,l_write,v,mpi,input,vr0)&
!$OMP SHARED(noco,uun21,udn21,dun21,ddn21)
DO n = 1,atoms%ntype
na=sum(atoms%neq(:n-1))+1
OK=.FALSE.
cholesky_loop:DO WHILE(.NOT.OK)
td%h_loc(:,:,n,jsp)=0.0
OK=.TRUE.
!
!---> generate the wavefunctions for each l
!
IF (l_write) WRITE (6,FMT=8000) n
DO l = 0,atoms%lmax(n)
CALL radfun(l,n,jspin,enpara%el0(l,n,jspin),v%mt(:,0,n,jsp),atoms,&
......@@ -123,7 +125,7 @@ MODULE m_tlmplm_cholesky
nh = sphhar%nlh(nsym)
!
!---> generate the irreducible integrals (u(l'):v(lamda,nu:u(l))
!---> for l' .ge. l, but only thos that will contribute
!---> for l' .ge. l, but only those that will contribute
!
DO lp = 0,atoms%lmax(n)
lp1 = (lp* (lp+1))/2
......@@ -299,8 +301,8 @@ MODULE m_tlmplm_cholesky
DO lp = 0,atoms%lnonsph(n)
DO mp = -lp,lp
lmp = lp* (lp+1) + mp
td%h_loc(lmp,lmp,n,jsp)=td%e_shift(jsp)+td%h_loc(lmp,lmp,n,jsp)
td%h_loc(lmp+s,lmp+s,n,jsp)=td%e_shift(jsp)*ud%ddn(lp,n,jsp)+td%h_loc(lmp+s,lmp+s,n,jsp)
td%h_loc(lmp,lmp,n,jsp)=td%e_shift(n,jsp)+td%h_loc(lmp,lmp,n,jsp)
td%h_loc(lmp+s,lmp+s,n,jsp)=td%e_shift(n,jsp)*ud%ddn(lp,n,jsp)+td%h_loc(lmp+s,lmp+s,n,jsp)
END DO
END DO
IF (lmp+1.ne.s) call judft_error("BUG in tlmpln_cholesky")
......@@ -316,13 +318,13 @@ MODULE m_tlmplm_cholesky
ENDDO
IF (info.NE.0) THEN
td%e_shift(jsp)=td%e_shift(jsp)*2.0
PRINT *,"Potential shift to small, increasing the value to:",td%e_shift(jsp)
IF (td%e_shift(jsp)>e_shift_max) THEN
td%e_shift(n,jsp)=td%e_shift(n,jsp)*2.0
PRINT *,"Potential shift to small, increasing the value to:",td%e_shift(n,jsp)
IF (td%e_shift(n,jsp)>e_shift_max) THEN
CALL judft_error("Potential shift at maximum")
ENDIF
OK=.FALSE.
CYCLE cholesky_loop
ENDIF
OK=.FALSE.
CYCLE cholesky_loop
ENDIF
!
......@@ -361,9 +363,10 @@ MODULE m_tlmplm_cholesky
ENDIF
ENDDO
!!$OMP END PARALLEL DO
ENDDO cholesky_loop
ENDDO cholesky_loop
ENDDO
!$OMP END PARALLEL DO
END SUBROUTINE tlmplm_cholesky
......
......@@ -399,7 +399,7 @@ CONTAINS
ENDDO
vCoul%iter = vTot%iter
vCoul%mt = vTot%mt
vCoul%pw = vpw_w
vCoul%pw(:,1:2) = vpw_w(:,1:2)
vCoul%vacz = vTot%vacz
vCoul%vacxy = vTot%vacxy
......
......@@ -30,7 +30,7 @@ MODULE m_types_tlmplm
!(-llod:llod,-llod:llod,mlolotot,tspin)
COMPLEX,ALLOCATABLE :: h_loc(:,:,:,:)
COMPLEX,ALLOCATABLE :: h_off(:,:,:,:)
REAL,ALLOCATABLE :: e_shift(:)
REAL,ALLOCATABLE :: e_shift(:,:)
TYPE(t_rsoc) :: rsoc
CONTAINS
PROCEDURE,PASS :: init => tlmplm_init
......@@ -56,7 +56,7 @@ CONTAINS
ALLOCATE(td%tuloulo(-llod:llod,-llod:llod,MAX(mlolotot,1),jspins), stat=err)
ALLOCATE(td%ind(0:lmd,0:lmd,ntype,jspins),stat=err )
ALLOCATE(td%h_loc(0:2*lmaxd*(lmaxd+2)+1,0:2*lmaxd*(lmaxd+2)+1,ntype,jspins))
ALLOCATE(td%e_shift(jspins))
ALLOCATE(td%e_shift(ntype,jspins))
IF (l_offdiag) THEN
ALLOCATE(td%h_off(0:2*lmaxd+1,0:2*lmaxd+1,ntype,2))
ELSE
......
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