Commit 681a9ed7 authored by Daniel Wortmann's avatar Daniel Wortmann

More changes to types with read_xml

parent dd70dfa7
This diff is collapsed.
......@@ -24,6 +24,63 @@ MODULE m_types_banddos
INTEGER :: s_cell_y
INTEGER :: s_cell_z
REAL :: alpha,beta,gamma !For orbital decomp. (was orbcomprot)
contains
procedure :: read_xml
END TYPE t_banddos
subroutine read_xml(banddos,xml)
use m_types_xml
class(t_banddos),INTENT(OUT)::banddos
type(t_xml),INTENT(IN)::xml
integer::numberNodes
banddos%band = evaluateFirstBoolOnly(xml%GetAttributeValue('/fleurInput/output/@band'))
banddos%dos = evaluateFirstBoolOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@dos'))
banddos%vacdos = evaluateFirstBoolOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@vacdos'))
banddos%l_mcd = evaluateFirstBoolOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@mcd'))
numberNodes = xmlGetNumberOfNodes('/fleurInput/output/densityOfStates')
IF ((banddos%dos).AND.(numberNodes.EQ.0)) THEN
CALL juDFT_error("dos is true but densityOfStates parameters are not set!", calledby = "r_inpXML")
END IF
IF (numberNodes.EQ.1) THEN
banddos%ndir = evaluateFirstIntOnly(xml%GetAttributeValue('/fleurInput/output/densityOfStates/@ndir'))
banddos%e2_dos = evaluateFirstOnly(xml%GetAttributeValue('/fleurInput/output/densityOfStates/@minEnergy'))
banddos%e1_dos = evaluateFirstOnly(xml%GetAttributeValue('/fleurInput/output/densityOfStates/@maxEnergy'))
banddos%sig_dos = evaluateFirstOnly(xml%GetAttributeValue('/fleurInput/output/densityOfStates/@sigma'))
END IF
IF (banddos%band) THEN
banddos%dos=.TRUE.
banddos%ndir = -4
WRITE(*,*) 'band="T" --> Overriding "dos" and "ndir"!'
ENDIF
! Read in optional magnetic circular dichroism parameters
numberNodes = xml%GetNumberOfNodes('/fleurInput/output/magneticCircularDichroism')
IF ((banddos%l_mcd).AND.(numberNodes.EQ.0)) THEN
CALL juDFT_error("mcd is true but magneticCircularDichroism parameters are not set!", calledby = "r_inpXML")
END IF
IF (numberNodes.EQ.1) THEN
banddos%e_mcd_lo = evaluateFirstOnly(xml%GetAttributeValue('/fleurInput/output/magneticCircularDichroism/@energyLo'))
banddos%e_mcd_up = evaluateFirstOnly(xml%GetAttributeValue('/fleurInput/output/magneticCircularDichroism/@energyUp'))
END IF
! Read in optional parameter for unfolding bandstructure of supercell
numberNodes = xml%GetNumberOfNodes('/fleurInput/output/unfoldingBand')
IF (numberNodes.EQ.1) THEN
banddos%unfoldband = evaluateFirstBoolOnly(xml%GetAttributeValue('/fleurInput/output/unfoldingBand/@unfoldband'))
banddos%s_cell_x = evaluateFirstOnly(xml%GetAttributeValue('/fleurInput/output/unfoldingBand/@supercellX'))
banddos%s_cell_y = evaluateFirstOnly(xml%GetAttributeValue('/fleurInput/output/unfoldingBand/@supercellY'))
banddos%s_cell_z = evaluateFirstOnly(xml%GetAttributeValue('/fleurInput/output/unfoldingBand/@supercellZ'))
END IF
end subroutine read_xml
END MODULE m_types_banddos
......@@ -59,4 +59,41 @@ MODULE m_types_cell
cell%bbmat=matmul(cell%bmat,transpose(cell%bmat))
cell%aamat=matmul(transpose(cell%amat),cell%amat)
END SUBROUTINE init
subroutine read_xml(cell,xml)
use m_types_xml
class(t_cell),intent(out)::cell
type(t_xml),intent(in) ::xml
! Read in lattice parameters
character(len=200)::valueString,path
real:: scale,dvac
if (xml%GetNumberOfNodes('')==1) then
path= '/fleurInput/cell/filmLattice'
dvac=evaluateFirstOnly(xml%GetAttributeValue(trim(path)//'/@dvac')
else
path = '/fleurInput/cell/bulkLattice'
endif
scale=evaluateFirstOnly(xml%GetAttributeValue(trim(path)//'/@scale')
path=trim(path)//'/bravaisMatrix'
valueString = TRIM(ADJUSTL(xml%GetAttributeValue(TRIM(ADJUSTL(path))//'/row-1')))
cell%amat(1,1) = evaluateFirst(valueString)
cell%amat(2,1) = evaluateFirst(valueString)
cell%amat(3,1) = evaluateFirst(valueString)
valueString = TRIM(ADJUSTL(xml%GetAttributeValue(TRIM(ADJUSTL(path))//'/row-2')))
cell%amat(1,2) = evaluateFirst(valueString)
cell%amat(2,2) = evaluateFirst(valueString)
cell%amat(3,2) = evaluateFirst(valueString)
valueString = TRIM(ADJUSTL(xml%GetAttributeValue(TRIM(ADJUSTL(path))//'/row-2')))
cell%amat(1,3) = evaluateFirst(valueString)
cell%amat(2,3) = evaluateFirst(valueString)
cell%amat(3,4) = evaluateFirst(valueString)
cell%amat=cell%amat*scale
call cell%init(dvac)
end subroutine read_xml
END MODULE m_types_cell
......@@ -72,5 +72,36 @@ MODULE m_types_oneD
REAL, POINTER :: pgft1xx(:)
REAL, POINTER :: pgft1yy(:)
REAL, POINTER :: pgft1xy(:)
contains
procedure :: read_xml
END TYPE t_oneD
contains
subroutine read_xml(oneD,xml)
use m_types_xml
class(t_oned),intent(out)::oneD
type(t_xml),intent(in) ::xml
! Read in optional 1D parameters if present
character(len=100):: xpathA
integer :: numberNodes
xPathA = '/fleurInput/calculationSetup/oneDParams'
numberNodes = xml%GetNumberOfNodes(xPathA)
oneD%odd%d1 = .FALSE.
IF (numberNodes.EQ.1) THEN
oneD%odd%d1 = evaluateFirstBoolOnly(xml%GetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@d1'))
oneD%odd%M = evaluateFirstIntOnly(xml%GetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@MM'))
oneD%odd%mb = evaluateFirstIntOnly(xml%GetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@vM'))
oneD%odd%m_cyl = evaluateFirstIntOnly(xml%GetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@m_cyl'))
oneD%odd%chi = evaluateFirstIntOnly(xml%GetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@chi'))
oneD%odd%rot = evaluateFirstIntOnly(xml%GetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@rot'))
oneD%odd%invs = evaluateFirstBoolOnly(xml%GetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@invs1'))
oneD%odd%zrfs = evaluateFirstBoolOnly(xml%GetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@zrfs1'))
END IF
end subroutine read_xml
END MODULE m_types_oneD
......@@ -13,5 +13,46 @@ MODULE m_types_sliceplot
INTEGER :: nnne=0
REAL :: e1s=0.
REAL :: e2s=0.
contains
procedure :: read_xml
END TYPE t_sliceplot
contains
subroutine read_xml(slicelplot,xml)
use m_types_xml
class(t_sliceplot),INTENT(OUT)::sliceplot
type(t_xml),INTENT(IN)::xml
character(len=200)::xpatha
integer::numberNodes
xPathA = '/fleurInput/output'
numberNodes = xml%GetNumberOfNodes(xPathA)
IF (numberNodes.EQ.1) THEN
siceplot%slice = evaluateFirstBoolOnly(xml%GetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@slice'))
endif
xPathA = '/fleurInput/output/plotting'
numberNodes = xml%GetNumberOfNodes(xPathA)
IF (numberNodes.EQ.1) THEN
sliceplot%iplot = evaluateFirstBoolOnly(xml%GetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@iplot'))
sliceplot%plpot = evaluateFirstBoolOnly(xml%GetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@plplot'))
END IF
xPathA = '/fleurInput/output/chargeDensitySlicing'
numberNodes = xmlGetNumberOfNodes(xPathA)
IF ((sliceplot%slice).AND.(numberNodes.EQ.0)) THEN
CALL juDFT_error("slice is true but chargeDensitySlicing parameters are not set!", calledby = "r_inpXML")
END IF
IF (numberNodes.EQ.1) THEN
sliceplot%kk = evaluateFirstIntOnly(xml%GetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@numkpt'))
sliceplot%e1s = evaluateFirstOnly(xml%GetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@minEigenval'))
sliceplot%e2s = evaluateFirstOnly(xml%GetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@maxEigenval'))
sliceplot%nnne = evaluateFirstIntOnly(xml%GetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@nnne'))
END IF
end subroutine read_xml
END MODULE m_types_sliceplot
......@@ -73,6 +73,20 @@ MODULE m_types_stars
REAL, ALLOCATABLE :: ft2_gfx(:), ft2_gfy(:)
COMPLEX, ALLOCATABLE :: ustep(:)
REAL, ALLOCATABLE :: ufft(:)
END TYPE t_stars
contains
procedure :: read_xml
END TYPE t_stars
contains
subroutine read_xml(stars,xml)
use m_types_xml
class(t_stars),INTENT(OUT)::stars
type(t_xml),INTENT(IN)::xml
stars%gmax = evaluateFirstOnly(xml%GetAttributeValue('/fleurInput/calculationSetup/cutoffs/@Gmax'))
stars%gmaxInit = stars%gmax
end subroutine read_xml
END MODULE m_types_stars
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