Commit 9321c827 authored by Daniel Wortmann's avatar Daniel Wortmann

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

parents 62689124 5becb3ef
......@@ -7,7 +7,7 @@
MODULE m_mt_setup
CONTAINS
SUBROUTINE mt_setup(atoms,sym,sphhar,input,noco,enpara,inden,v,mpi,results,DIMENSION,td,ud)
SUBROUTINE mt_setup(atoms,sym,sphhar,input,noco,enpara,inden,vTot,mpi,results,DIMENSION,td,ud)
USE m_usetup
USE m_tlmplm_cholesky
USE m_tlmplm_store
......@@ -24,21 +24,15 @@ CONTAINS
TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_potden),INTENT(IN) :: inDen
TYPE(t_potden),INTENT(INOUT) :: v
TYPE(t_potden),INTENT(INOUT) :: vTot
TYPE(t_tlmplm),INTENT(INOUT) :: td
TYPE(t_usdus),INTENT(INOUT) :: ud
COMPLEX,ALLOCATABLE:: vs_mmp(:,:,:,:)
INTEGER:: jsp
INTEGER, PARAMETER :: lmaxb=3
IF ((atoms%n_u.GT.0)) THEN
ALLOCATE( vs_mmp(-lmaxb:lmaxb,-lmaxb:lmaxb,atoms%n_u,input%jspins) )
CALL u_setup(sym,atoms,sphhar,input, enpara%el0(0:,:,:),inDen,v,mpi,results)
ELSE
ALLOCATE( vs_mmp(-lmaxb:-lmaxb,-lmaxb:-lmaxb,1,2) )
ENDIF
CALL u_setup(sym,atoms,sphhar,input,enpara%el0(0:,:,:),inDen,vTot,mpi,results)
END IF
CALL timestart("tlmplm")
CALL td%init(DIMENSION%lmplmd,DIMENSION%lmd,atoms%ntype,atoms%lmaxd,atoms%llod,SUM(atoms%nlo),&
......@@ -46,17 +40,16 @@ CONTAINS
(noco%l_noco.AND.noco%l_soc.AND..NOT.noco%l_ss).OR.noco%l_constr)!l_offdiag
DO jsp=1,input%jspins
!CALL tlmplm_cholesky(sphhar,atoms,DIMENSION,enpara, jsp,1,mpi,v%mt(:,0,1,jsp),input,vs_mmp, td,ud)
CALL tlmplm_cholesky(sphhar,atoms,noco,enpara, jsp,jsp,mpi,v,input, td,ud)
IF (input%l_f) CALL write_tlmplm(td,vs_mmp,atoms%n_u>0,1,jsp,input%jspins)
!CALL tlmplm_cholesky(sphhar,atoms,DIMENSION,enpara, jsp,1,mpi,vTot%mt(:,0,1,jsp),input,vTot%mmpMat, td,ud)
CALL tlmplm_cholesky(sphhar,atoms,noco,enpara,jsp,jsp,mpi,vTot,input,td,ud)
IF (input%l_f) CALL write_tlmplm(td,vTot%mmpMat,atoms%n_u>0,1,jsp,input%jspins)
END DO
CALL timestop("tlmplm")
!Setup of soc parameters for first-variation SOC
IF (noco%l_soc.AND.noco%l_noco.AND..NOT.noco%l_ss) &
CALL socinit(mpi,atoms,sphhar,enpara,input,v%mt,noco,ud,td%rsoc)
IF (noco%l_soc.AND.noco%l_noco.AND..NOT.noco%l_ss) THEN
CALL socinit(mpi,atoms,sphhar,enpara,input,vTot%mt,noco,ud,td%rsoc)
END IF
END SUBROUTINE mt_setup
END MODULE m_mt_setup
......@@ -43,6 +43,7 @@ CONTAINS
! ..
! .. Local Arrays ..
COMPLEX vtl(0:sphhar%nlhd,atoms%ntype)
!$ COMPLEX vtl_loc(0:sphhar%nlhd,atoms%ntype)
COMPLEX pylm( (atoms%lmaxd+1)**2 ,atoms%ntype )
REAL f1r(atoms%jmtd),f2r(atoms%jmtd),x1r(atoms%jmtd),x2r(atoms%jmtd)
REAL sbf(0:atoms%lmaxd),rrl(atoms%jmtd),rrl1(atoms%jmtd)
......@@ -54,6 +55,7 @@ CONTAINS
! .. External Subroutines
EXTERNAL MPI_REDUCE
#endif
integer :: OMP_GET_NUM_THREADS, OMP_GET_THREAD_NUM
! ..
! ..
! ----> calculate lattice harmonics expansion coefficients of the
......@@ -78,10 +80,12 @@ CONTAINS
ENDDO
ENDIF
! ----> g.ne.0 components
! I commented out the OMP parallelization for the following loop since
! it produced wrong results with the ifort 18 compiler.
!!$OMP PARALLEL DO DEFAULT(SHARED) PRIVATE(cp,pylm,nat,n,sbf,nd,lh,&
!!$OMP& sm,jm,m,lm,l) REDUCTION(+:vtl)
!$OMP PARALLEL DEFAULT(NONE) &
!$OMP& SHARED(mpi,stars,vpw,oneD,atoms,sym,cell,sphhar,vtl) &
!$OMP& PRIVATE(k,cp,pylm,nat,n,sbf,nd,lh,sm,jm,m,lm,l)&
!$OMP& PRIVATE(vtl_loc)
!$ vtl_loc(:,:) = CMPLX(0.d0,0.d0)
!$OMP DO
DO k = mpi%irank+2, stars%ng3, mpi%isize
cp = vpw(k,1)*stars%nstr(k)
IF (.NOT.oneD%odi%d1) THEN
......@@ -91,13 +95,13 @@ CONTAINS
& pylm)
ELSE
!-odim
CALL od_phasy(&
CALL od_phasy(&
& atoms%ntype,stars%ng3,atoms%nat,atoms%lmaxd,atoms%ntype,atoms%neq,atoms%lmax,&
& atoms%taual,cell%bmat,stars%kv3,k,oneD%odi,oneD%ods,&
& pylm)
!+odim
END IF
!
nat = 1
DO n = 1,atoms%ntype
CALL sphbes(atoms%lmax(n),stars%sk3(k)*atoms%rmt(n),sbf)
......@@ -110,12 +114,20 @@ CALL od_phasy(&
lm = l*(l+1) + m + 1
sm = sm + CONJG(sphhar%clnu(jm,lh,nd))*pylm(lm,n)
ENDDO
!$ IF (.false.) THEN
vtl(lh,n) = vtl(lh,n) + cp*sbf(l)*sm
!$ ENDIF
vtl_loc(lh,n) = vtl_loc(lh,n) + cp*sbf(l)*sm
ENDDO
nat = nat + atoms%neq(n)
ENDDO
ENDDO
!!$OMP END PARALLEL DO
!$OMP END DO
!$OMP CRITICAL
!$ vtl = vtl + vtl_loc
!$OMP END CRITICAL
!$OMP END PARALLEL
#ifdef CPP_MPI
n1 = (sphhar%nlhd+1)*atoms%ntype
ALLOCATE(c_b(n1))
......
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