Commit 6873045e authored by Matthias Redies's avatar Matthias Redies

LibXC controll now possible by name or number

parent 65ec9ddd
......@@ -36,7 +36,7 @@ SUBROUTINE r_inpXML(&
USE m_inpeig
USE m_sort
USE m_types_xcpot_inbuild
! USE m_types_xcpot_libxc
USE xc_f03_lib_m
IMPLICIT NONE
TYPE(t_input),INTENT(INOUT) :: input
......@@ -1108,8 +1108,28 @@ SUBROUTINE r_inpXML(&
!!! Start of XC functional section
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Read in xc functional parameters
!Read in libxc parameters if present
if( xmlGetNumberOfNodes('/fleurInput/xcFunctional/LibXCID') == 1 &
.and. xmlGetNumberOfNodes('/fleurInput/xcFunctional/LibXCName') == 1) then
call judft_error("LibXC is given both by Name and ID and is therefore overdetermined", calledby="r_inpXML")
endif
IF (xmlGetNumberOfNodes('/fleurInput/xcFunctional/LibXCID') == 1) THEN
id_x=evaluateFirstOnly(xmlGetAttributeValue('/fleurInput/xcFunctional/LibXCID/@exchange'))
id_c=evaluateFirstOnly(xmlGetAttributeValue('/fleurInput/xcFunctional/LibXCID/@correlation'))
ELSEIF (xmlGetNumberOfNodes('/fleurInput/xcFunctional/LibXCName') == 1) THEN
valueString = TRIM(ADJUSTL(xmlGetAttributeValue(TRIM(ADJUSTL('/fleurInput/xcFunctional/LibXCName/@exchange')))))
id_x = xc_f03_functional_get_number(TRIM(valueString))
valueString = TRIM(ADJUSTL(xmlGetAttributeValue(TRIM(ADJUSTL('/fleurInput/xcFunctional/LibXCName/@correlation')))))
id_c = xc_f03_functional_get_number(TRIM(valueString))
ELSE
id_x=0;id_c=0
ENDIF
write (*,*) "id_x = ", id_x, "id_c = ", id_c
! Read in xc functional parameters
valueString = TRIM(ADJUSTL(xmlGetAttributeValue(TRIM(ADJUSTL('/fleurInput/xcFunctional/@name')))))
namex(1:4) = valueString(1:4)
l_relcor = evaluateFirstBoolOnly(xmlGetAttributeValue('/fleurInput/xcFunctional/@relativisticCorrections'))
......@@ -1119,15 +1139,6 @@ SUBROUTINE r_inpXML(&
relcor = 'relativistic'
END IF
!Read in libxc parameters if present
xPathA = '/fleurInput/xcFunctional/libXC'
numberNodes = xmlGetNumberOfNodes(xPathA)
IF (numberNodes==1) THEN
id_x=evaluateFirstOnly(xmlGetAttributeValue('/fleurInput/xcFunctional/libXC/@exchange'))
id_c=evaluateFirstOnly(xmlGetAttributeValue('/fleurInput/xcFunctional/libXC/@correlation'))
ELSE
id_x=0;id_c=0
ENDIF
!now initialize the xcpot variable
CALL setXCParameters(atoms,valueString,l_relcor,input%jspins,id_x,id_c,xcpot)
......@@ -2051,7 +2062,7 @@ SUBROUTINE setXCParameters(atoms,namex,relcor,jspins,id_x,id_c,xcpot)
INTEGER, INTENT(IN) :: jspins,id_c,id_x
CLASS(t_xcpot),INTENT(OUT),ALLOCATABLE :: xcpot
IF (namex(1:5)=='libxc') THEN
IF (namex(1:5)=='LibXC') THEN
ALLOCATE(t_xcpot_libxc::xcpot)
ELSE
ALLOCATE(t_xcpot_inbuild::xcpot)
......
......@@ -267,7 +267,8 @@
<xsd:complexType name="XCFunctionalType">
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" name="libXC" type="XCLibXCType"/>
<xsd:element maxOccurs="1" minOccurs="0" name="LibXCID" type="XCLibXCIDType"/>
<xsd:element maxOccurs="1" minOccurs="0" name="LibXCName" type="XCLibXCNameType"/>
<xsd:element maxOccurs="1" minOccurs="0" name="xcParams" type="XCParamsType"/>
<xsd:element maxOccurs="1" minOccurs="0" name="ggaPrinting" type="GGAPrintingType"/>
</xsd:sequence>
......@@ -305,13 +306,17 @@
<xsd:enumeration value="vhse"/>
<xsd:enumeration value="lhse"/>
<xsd:enumeration value="hf"/>
<xsd:enumeration value="libxc"/>
<xsd:enumeration value="LibXC"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="XCLibXCType">
<xsd:complexType name="XCLibXCIDType">
<xsd:attribute name="exchange" type="xsd:integer" use="required"/>
<xsd:attribute name="correlation" type="xsd:integer" use="required"/>
</xsd:complexType>
<xsd:complexType name="XCLibXCNameType">
<xsd:attribute name="exchange" type="xsd:string" use="required"/>
<xsd:attribute name="correlation" type="xsd:string" use="required"/>
</xsd:complexType>
<xsd:complexType name="XCParamsType">
<xsd:attribute name="igrd" type="xsd:integer" use="required"/>
<xsd:attribute name="lwb" type="FleurBool" use="required"/>
......
......@@ -23,8 +23,8 @@
<c>6.81</c>
</bulkLattice>
</cell>
<xcFunctional name="libxc" relativisticCorrections="F">
<libXC exchange="1" correlation="9" />
<xcFunctional name="LibXC" relativisticCorrections="F">
<LibXCID exchange="1" correlation="9" />
</xcFunctional>
<atomSpecies>
<species name="Cu-1" element="Cu" atomicNumber="29" coreStates="7" magMom=".00000000" flipSpin="T">
......
......@@ -26,8 +26,8 @@
<c>6.82000000</c>
</bulkLattice>
</cell>
<xcFunctional name="libxc" relativisticCorrections="F">
<libXC exchange="101" correlation="130" />
<xcFunctional name="LibXC" relativisticCorrections="F">
<LibXCName exchange="gga_x_pbe" correlation="gga_c_pbe" />
</xcFunctional>
<atomSpecies>
<species name="Fe-1" element="Fe" atomicNumber="26" coreStates="7" magMom="2.20000000" flipSpin="T">
......
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