Commit 44c7de67 authored by Daniel Wortmann's avatar Daniel Wortmann

Added n_mmp_rot feature to inp.xml

parent 6a55d7a3
......@@ -42,7 +42,8 @@
REAL dmat(3,3),dmati(3,3)
IF (ALL(ABS(alpha)<1E-10).AND.ALL(ABS(beta)<1E-10)
+ .AND.ALL(ABS(gamma)<1E-10)) RETURN
DO n = 1, n_u
......
......@@ -127,6 +127,7 @@ CONTAINS
LOGICAL :: coreConfigPresent, l_enpara, l_orbcomp, tempBool, l_nocoinp
REAL :: magMom, radius, logIncrement, qsc(3), latticeScale, dr
REAL :: aTemp, zp, rmtmax, sumWeight, ldau_u(4), ldau_j(4), tempReal
REAL :: ldau_phi(4),ldau_theta(4)
REAL :: weightScale, eParamUp, eParamDown
LOGICAL :: l_amf(4)
REAL, PARAMETER :: boltzmannConst = 3.1668114e-6 ! value is given in Hartree/Kelvin
......@@ -1366,7 +1367,9 @@ input%preconditioning_param = evaluateFirstOnly(xmlGetAttributeValue('/fleurInpu
ldau_l(i) = evaluateFirstIntOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/ldaU['//TRIM(ADJUSTL(xPathB))//']/@l'))
ldau_u(i) = evaluateFirstOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/ldaU['//TRIM(ADJUSTL(xPathB))//']/@U'))
ldau_j(i) = evaluateFirstOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/ldaU['//TRIM(ADJUSTL(xPathB))//']/@J'))
l_amf(i) = evaluateFirstBoolOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/ldaU['//TRIM(ADJUSTL(xPathB))//']/@l_amf'))
ldau_phi(i) = evaluateFirstOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/ldaU['//TRIM(ADJUSTL(xPathB))//']/@phi'))
ldau_theta(i) = evaluateFirstOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/ldaU['//TRIM(ADJUSTL(xPathB))//']/@theta'))
l_amf(i) = evaluateFirstBoolOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/ldaU['//TRIM(ADJUSTL(xPathB))//']/@l_amf'))
END DO
speciesNLO(iSpecies) = 0
......@@ -1424,6 +1427,8 @@ input%preconditioning_param = evaluateFirstOnly(xmlGetAttributeValue('/fleurInpu
atoms%lda_u(atoms%n_u)%l = ldau_l(i)
atoms%lda_u(atoms%n_u)%u = ldau_u(i)
atoms%lda_u(atoms%n_u)%j = ldau_j(i)
atoms%lda_u(atoms%n_u)%phi = ldau_phi(i)
atoms%lda_u(atoms%n_u)%theta = ldau_theta(i)
atoms%lda_u(atoms%n_u)%l_amf = l_amf(i)
atoms%lda_u(atoms%n_u)%atomType = iType
END DO
......
......@@ -465,6 +465,8 @@
<xsd:attribute name="l" type="xsd:nonNegativeInteger" use="required"/>
<xsd:attribute name="U" type="xsd:string" use="required"/>
<xsd:attribute name="J" type="xsd:string" use="required"/>
<xsd:attribute name="phi" type="xsd:string" use="optional" default="0.0"/>
<xsd:attribute name="theta" type="xsd:string" use="optional" default="0.0"/>
<xsd:attribute name="l_amf" type="FleurBool" use="required"/>
</xsd:complexType>
......
......@@ -38,11 +38,10 @@ CONTAINS
REAL, INTENT(IN) :: el(0:,:,:) !(0:atoms%lmaxd,ntype,jspd)
! ... Local Variables ...
INTEGER itype,ispin,j,k,l,jspin,urec,i_u
INTEGER noded,nodeu,ios,lty(atoms%n_u)
INTEGER noded,nodeu,ios
REAL wronk
LOGICAL n_exist
CHARACTER*8 l_type*2,l_form*9
REAL f(atoms%jmtd,2),g(atoms%jmtd,2),theta(atoms%n_u),phi(atoms%n_u),zero(atoms%n_u)
REAL f(atoms%jmtd,2),g(atoms%jmtd,2),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(:,:,:,:)
......@@ -69,26 +68,9 @@ CONTAINS
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')
DO i_u = 1, atoms%n_u
itype = atoms%lda_u(i_u)%atomType
l = atoms%lda_u(i_u)%l
READ(68,*,iostat=ios) theta(i_u),phi(i_u)
IF (ios == 0) THEN
lty(i_u) = l
ELSE
IF (i_u == 1) CALL juDFT_error("ERROR reading n_mmp_rot",calledby ="u_setup")
theta(i_u) = theta(i_u-1) ; phi(i_u) = phi(i_u-1)
lty(i_u) = lty(i_u-1)
END IF
END DO
CLOSE (68)
zero = 0.0
CALL nmat_rot(phi,theta,zero,3,atoms%n_u,input%jspins,lty,n_mmp)
ENDIF
zero = 0.0
CALL nmat_rot(atoms%lda_u(:)%phi,Atoms%lda_u(:)%theta,zero,3,atoms%n_u,input%jspins,atoms%lda_u%l,n_mmp)
! calculate potential matrix and total energy correction
CALL v_mmp(sym,atoms,input%jspins,n_mmp,u,f0,f2,pot%mmpMat,results)
......
......@@ -28,33 +28,16 @@ CONTAINS
COMPLEX, INTENT (INOUT) :: n_mmp_in (-3:3,-3:3,atoms%n_u,input%jspins)
!
! ... Locals ...
INTEGER j,k,iofl,l,itype,ios,i_u,jsp,lty(atoms%n_u)
INTEGER j,k,iofl,l,itype,ios,i_u,jsp
REAL alpha,spinf,gam,del,sum1,sum2,mix_u, uParam, jParam
REAL theta(atoms%n_u),phi(atoms%n_u),zero(atoms%n_u)
LOGICAL n_exist
REAL zero(atoms%n_u)
CHARACTER(LEN=20) :: attributes(6)
COMPLEX,ALLOCATABLE :: n_mmp(:,:,:,:)
!
! 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')
DO i_u = 1, atoms%n_u
l = atoms%lda_u(i_u)%l
READ(68,*,iostat=ios) theta(i_u),phi(i_u)
IF (ios == 0) THEN
lty(i_u) = l
ELSE
IF (i_u == 1) CALL juDFT_error("ERROR reading n_mmp_rot", calledby ="u_mix")
theta(i_u) = theta(i_u-1) ; phi(i_u) = phi(i_u-1)
lty(i_u) = lty(i_u-1)
END IF
END DO
CLOSE (68)
zero = 0.0
CALL nmat_rot(zero,-theta,-phi,3,atoms%n_u,input%jspins,lty,n_mmp_out)
END IF
zero=0.0
CALL nmat_rot(zero,-atoms%lda_u%theta,-atoms%lda_u%phi,3,atoms%n_u,input%jspins,atoms%lda_u%l,n_mmp_out)
! Write out n_mmp_out to out.xml file
......
......@@ -61,9 +61,10 @@ MODULE m_types_setup
!
TYPE t_utype
SEQUENCE
REAL u, j ! the actual U and J parameters
INTEGER l ! the l quantum number to which this U parameter belongs
INTEGER atomType ! The atom type to which this U parameter belongs
REAL :: u, j ! the actual U and J parameters
REAL :: theta,phi !the rotation angles by which the density metrics is rotated
INTEGER :: l ! the l quantum number to which this U parameter belongs
INTEGER :: atomType ! The atom type to which this U parameter belongs
LOGICAL :: l_amf ! logical switch to choose the "around mean field" LDA+U limit
END TYPE t_utype
......
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