Commit 18f6d202 authored by Gregor Michalicek's avatar Gregor Michalicek

Make inDen INTENT(IN) in eigen/eigen.F90

parent d809e852
......@@ -62,8 +62,8 @@ CONTAINS
TYPE(t_kpts),INTENT(IN) :: kpts
TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_potden),INTENT(IN) :: inDen
TYPE(t_potden),INTENT(INOUT) :: v,vx
TYPE(t_potden),INTENT(INOUT) :: inDen ! inDen%mmpMat is modified in u_setup
#ifdef CPP_MPI
INCLUDE 'mpif.h'
#endif
......
......@@ -32,7 +32,7 @@ CONTAINS
TYPE(t_input),INTENT(IN) :: input
TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_potden),INTENT(INOUT) :: inDen
TYPE(t_potden),INTENT(IN) :: inDen
TYPE(t_potden),INTENT(INOUT) :: pot
REAL, INTENT(IN) :: el(0:,:,:) !(0:atoms%lmaxd,ntype,jspd)
......@@ -40,38 +40,36 @@ CONTAINS
INTEGER itype,ispin,j,k,l,jspin,urec,i_u
INTEGER noded,nodeu,ios,lty(atoms%n_u)
REAL wronk
LOGICAL n_mmp_exist,n_exist
LOGICAL n_exist
CHARACTER*8 l_type*2,l_form*9
CHARACTER*12 ::filename
REAL f(atoms%jmtd,2),g(atoms%jmtd,2),theta(atoms%n_u),phi(atoms%n_u),zero(atoms%n_u)
REAL f0(atoms%n_u,input%jspins),f2(atoms%n_u,input%jspins),f4(atoms%n_u,input%jspins),f6(atoms%n_u,input%jspins)
REAL, ALLOCATABLE :: u(:,:,:,:,:,:)
COMPLEX, ALLOCATABLE :: n_mmp(:,:,:,:)
!
! look, whether density matrix exists already:
!
IF (isDensityMatrixPresent().AND.atoms%n_u>0) THEN
!
! calculate slater integrals from u and j
!
CALL uj2f(input%jspins,atoms,&
f0,f2,f4,f6)
!
CALL uj2f(input%jspins,atoms,f0,f2,f4,f6)
! set up e-e- interaction matrix
!
ALLOCATE (u(-lmaxU_const:lmaxU_const,-lmaxU_const:lmaxU_const,&
-lmaxU_const:lmaxU_const,-lmaxU_const:lmaxU_const,atoms%n_u,input%jspins))
ALLOCATE (n_mmp(-lmaxU_const:lmaxU_const,-lmaxU_const:lmaxU_const,atoms%n_u,input%jspins))
n_mmp(:,:,:,:) = inDen%mmpMat(:,:,:,:)
DO ispin = 1, 1 ! input%jspins
f0(:,1) = (f0(:,1) + f0(:,input%jspins) ) / 2
f2(:,1) = (f2(:,1) + f2(:,input%jspins) ) / 2
f4(:,1) = (f4(:,1) + f4(:,input%jspins) ) / 2
f6(:,1) = (f6(:,1) + f6(:,input%jspins) ) / 2
CALL umtx(atoms,f0(1,ispin),&
f2(1,ispin),f4(1,ispin),f6(1,ispin),&
u(-lmaxU_const,-lmaxU_const,-lmaxU_const,-lmaxU_const,1,ispin) )
CALL umtx(atoms,f0(1,ispin),f2(1,ispin),f4(1,ispin),f6(1,ispin),&
u(-lmaxU_const,-lmaxU_const,-lmaxU_const,-lmaxU_const,1,ispin))
END DO
!
! check for possible rotation of n_mmp
!
INQUIRE (file='n_mmp_rot',exist=n_exist)
IF (n_exist) THEN
OPEN (68,file='n_mmp_rot',status='old',form='formatted')
......@@ -89,13 +87,12 @@ CONTAINS
END DO
CLOSE (68)
zero = 0.0
CALL nmat_rot(phi,theta,zero,3,atoms%n_u,input%jspins,lty,inDen%mmpMat)
CALL nmat_rot(phi,theta,zero,3,atoms%n_u,input%jspins,lty,n_mmp)
ENDIF
!
! calculate potential matrix and total energy correction
!
CALL v_mmp(sym,atoms,input%jspins,inDen%mmpMat,u,f0,f2,&
pot%mmpMat,results)
CALL v_mmp(sym,atoms,input%jspins,n_mmp,u,f0,f2,pot%mmpMat,results)
IF (mpi%irank.EQ.0) THEN
DO jspin = 1,input%jspins
WRITE (6,'(a7,i3)') 'spin #',jspin
......@@ -105,7 +102,7 @@ CONTAINS
WRITE (l_type,'(i2)') 2*(2*l+1)
l_form = '('//l_type//'f12.7)'
WRITE (6,'(a20,i3)') 'n-matrix for atom # ',itype
WRITE (6,l_form) ((inDen%mmpMat(k,j,i_u,jspin),k=-l,l),j=-l,l)
WRITE (6,l_form) ((n_mmp(k,j,i_u,jspin),k=-l,l),j=-l,l)
WRITE (6,'(a20,i3)') 'V-matrix for atom # ',itype
IF (atoms%lda_u(i_u)%l_amf) THEN
WRITE (6,*) 'using the around-mean-field limit '
......@@ -117,7 +114,7 @@ CONTAINS
END DO
WRITE (6,*) results%e_ldau
ENDIF
DEALLOCATE (u)
DEALLOCATE (u,n_mmp)
ELSE
IF (mpi%irank.EQ.0) THEN
WRITE (*,*) 'no density matrix found ... skipping LDA+U'
......
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