Commit 2893221a authored by Gregor Michalicek's avatar Gregor Michalicek

Read in evac0 from inp.xml file

Also in this commit: Set the default vacuum energy parameter
to -0.25 Htr. It was -0.1 Htr at some places. The default value
is now stored in constants.f.
parent c2c4484c
......@@ -9,6 +9,7 @@
REAL, PARAMETER :: fpi_const=4.*3.1415926535897932
REAL, PARAMETER :: sfp_const=sqrt(4.*3.1415926535897932)
REAL, PARAMETER :: hartree_to_ev_const=27.21138602 ! value from 2014 CODATA recommended values. Uncertainty is 0.00000017
REAL, PARAMETER :: eVac0Default_const = -0.25
CHARACTER(len=9), PARAMETER :: version_const = 'fleur 27'
CHARACTER(2),DIMENSION(0:103),PARAMETER:: namat_const=(/
......
MODULE m_enpara
use m_juDFT
USE m_constants
! *************************************************************
! Module containing three subroutines
! r_enpara: read enpara file
......@@ -92,7 +93,7 @@
!use defaults
enpara%lchange(:,:,jsp)=.false.
enpara%llochg(:,:,jsp)=.false.
enpara%evac0(:,jsp)=-0.1
enpara%evac0(:,jsp) = eVac0Default_const
enpara%skiplo(:,jsp) = 0
enpara%enmix(jsp) = 0.0
enpara%lchg_v(:,jsp)=.false.
......
......@@ -64,7 +64,7 @@
enpara%el0(:,:,2)=enpara%el0(:,:,1)
enpara%ello0(:,:,2)=enpara%ello0(:,:,1)
ENDIF
IF (input%film) enpara%evac0=-0.25
IF (input%film) enpara%evac0 = eVac0Default_const
END IF
!
!---> read k-points from file 41='kpts'
......
......@@ -341,7 +341,7 @@
nel = 0
enpara%el0 = -9999.9
enpara%ello0 = -9999.9
enpara%evac0 = -0.1
enpara%evac0 = eVac0Default_const
DO n = 1, atoms%ntype
CALL setcore_bystr(
......
......@@ -368,7 +368,7 @@
ENDIF
ENDIF
! set vacuum%nvac and vacuum energy parameters
! set vacuum%nvac
vacuum%nvac = 2
IF (sym%zrfs.OR.sym%invs) vacuum%nvac = 1
IF (oneD%odd%d1) vacuum%nvac = 1
......
......@@ -145,7 +145,7 @@ SUBROUTINE r_inpXML(&
INTEGER :: latticeDef, symmetryDef, nop48, firstAtomOfType, errorStatus
INTEGER :: loEDeriv, ntp1, ios, ntst, jrc, minNeigd, providedCoreStates, providedStates
INTEGER :: nv, nv2, kq1, kq2, kq3, nprncTemp, kappaTemp
INTEGER :: ldau_l
INTEGER :: ldau_l, numVac
INTEGER :: speciesEParams(0:3)
INTEGER :: mrotTemp(3,3,48)
REAL :: tauTemp(3,48)
......@@ -154,7 +154,7 @@ SUBROUTINE r_inpXML(&
LOGICAL :: l_vca, coreConfigPresent, l_enpara
REAL :: magMom, radius, logIncrement, qsc(3), latticeScale, dr
REAL :: aTemp, zp, rmtmax, sumWeight, ldau_u, ldau_j, tempReal
REAL :: weightScale
REAL :: weightScale, eParamUp, eParamDown
LOGICAL :: l_amf
REAL, PARAMETER :: boltzmannConst = 3.1668114e-6 ! value is given in Hartree/Kelvin
REAL, PARAMETER :: htr_eV = 27.21138386 ! eV
......@@ -735,7 +735,27 @@ SUBROUTINE r_inpXML(&
dtild = evaluateFirstOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@dTilda'))
vacuum%dvac = cell%z1
a3(3) = dtild
WRITE(*,*) 'Ignoring vacuum energy parameters in inp.xml for the moment!'
enpara%evac0 = eVac0Default_const
xPathB = TRIM(ADJUSTL(xPathA))//'vacuumEnergyParameters'
numberNodes = xmlGetNumberOfNodes(xPathB)
IF(numberNodes.GE.1) THEN
DO i = 1, numberNodes
xPathC = ''
WRITE(xPathC,'(a,i0,a)') TRIM(ADJUSTL(xPathB))//'[',i,']'
numVac = evaluateFirstIntOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathC))//'/@vacuum'))
eParamUp = evaluateFirstOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathC))//'/@spinUp'))
eParamDown = eParamUp
IF (xmlGetNumberOfNodes(TRIM(ADJUSTL(xPathC))//'/@spinDown').GE.1) THEN
eParamDown = evaluateFirstOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathC))//'/@spinDown'))
END IF
enpara%evac0(numVac,1) = eParamUp
IF(input%jspins.GT.1) enpara%evac0(numVac,2) = eParamDown
IF(i.EQ.1) THEN
enpara%evac0(3-numVac,1) = eParamUp
IF(input%jspins.GT.1) enpara%evac0(3-numVac,2) = eParamDown
END IF
END DO
END IF
END IF
numberNodes = xmlGetNumberOfNodes(TRIM(ADJUSTL(xPathA))//'/a1')
......
......@@ -331,7 +331,7 @@ SUBROUTINE w_inpXML(&
END IF
END IF
268 FORMAT(' <vacuumEnergyParameters vacuum="',i0,'" spinUp="',f0.8,'" spinDown="',f0.8,'">')
268 FORMAT(' <vacuumEnergyParameters vacuum="',i0,'" spinUp="',f0.8,'" spinDown="',f0.8,'"/>')
DO i = 1, vacuum%nvac
WRITE(fileNum,268) i, enpara%evac0(i,1), enpara%evac0(i,input%jspins)
END DO
......
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