Commit b6bed186 authored by Gregor Michalicek's avatar Gregor Michalicek

Added a few tests and corrected some bugs in XML codepath

Tests added: CuBandXML, CuDOSXML.

CuDOSXML does not yet pass.
parent 6c461756
......@@ -28,7 +28,7 @@ endif ()
#The Fortran compile flags
set(CMAKE_Fortran_FLAGS "${HDF5_INCL} -mkl -warn nousage -assume byterecl -r8 " )
set(CMAKE_Fortran_FLAGS_RELEASE " -O3 -xHost -openmp" )
set(CMAKE_Fortran_FLAGS_DEBUG " -traceback -ftrapuv -CB -openmp -O0 -g" )
set(CMAKE_Fortran_FLAGS_DEBUG " -check uninit -check pointers -traceback -ftrapuv -CB -openmp -O0 -g" )
set(LAPACK_LIBS "-lxml2 -mkl -lmatmul -openmp -lpthread")
......
......@@ -215,7 +215,7 @@ CONTAINS
IF (input%gauss) THEN
CALL fergwt(kpts,input,mpi,ne, eig,results)
ELSE IF (input%tria) THEN
CALL fertri(mpi%irank, ne,kpts%nkpt,nspins,zc,eig,kpts%bk,spindg,&
CALL fertri(input,kpts,mpi%irank, ne,kpts%nkpt,nspins,zc,eig,kpts%bk,spindg,&
results%ef,results%seigv,results%w_iks)
ELSE
nspins = input%jspins
......
......@@ -5,7 +5,7 @@
!
CONTAINS
SUBROUTINE fertri(
> irank,
> input,kpts,irank,
> ne,nkpt,jspins,zc,eig,bk,sfac,
X ef,
< seigv,w)
......@@ -16,9 +16,13 @@
USE m_dosef
USE m_dosint
USE m_doswt
USE m_types
! USE m_bzints
IMPLICIT NONE
TYPE(t_input),INTENT(IN):: input
TYPE(t_kpts), INTENT(IN):: kpts
! ..
! .. Scalar Arguments ..
INTEGER, INTENT (IN) :: nkpt,jspins,irank
......@@ -81,30 +85,38 @@ c
! sfac = 2.0/real(jspins)
c
c---> write results of triang
c
IF (.not.film) THEN
IF ( irank == 0 ) THEN
WRITE (6,*) 'reading tetrahedrons from file kpts'
WRITE (16,*) 'reading tetrahedrons from file kpts'
END IF
OPEN (41,file='kpts',FORM='formatted',STATUS='old')
DO i = 1, nkpt+1
READ (41,*)
ENDDO
READ (41,'(i5)',ERR=66,END=66) ntetra
IF (ntetra>6*nkpt) CALL juDFT_error("ntetra > 6 nkpt"
+ ,calledby ="fertri")
READ (41,'(4(4i6,4x))') ((itetra(i,j),i=1,4),j=1,ntetra)
READ (41,'(4f20.13)') (voltet(j),j=1,ntetra)
voltet(1:ntetra) = voltet(1:ntetra) / ntetra
GOTO 67
66 CONTINUE ! no tetrahedron-information of file
CALL make_tetra(
> nkpt,bk,ntria,itria,atr,
< ntetra,itetra,voltet)!keep
IF(input%l_inpXML) THEN
ntetra = kpts%ntet
DO j = 1, ntetra
itetra(1:4,j) = kpts%ntetra(1:4,j)
voltet(j) = kpts%voltet(j) / ntetra
END DO
ELSE
IF ( irank == 0 ) THEN
WRITE (6,*) 'reading tetrahedrons from file kpts'
WRITE (16,*) 'reading tetrahedrons from file kpts'
END IF
OPEN (41,file='kpts',FORM='formatted',STATUS='old')
DO i = 1, nkpt+1
READ (41,*)
ENDDO
READ (41,'(i5)',ERR=66,END=66) ntetra
IF (ntetra>6*nkpt) CALL juDFT_error("ntetra > 6 nkpt"
+ ,calledby ="fertri")
READ (41,'(4(4i6,4x))') ((itetra(i,j),i=1,4),j=1,ntetra)
READ (41,'(4f20.13)') (voltet(j),j=1,ntetra)
voltet(1:ntetra) = voltet(1:ntetra) / ntetra
GOTO 67
66 CONTINUE ! no tetrahedron-information of file
CALL make_tetra(
> nkpt,bk,ntria,itria,atr,
< ntetra,itetra,voltet)!keep
67 CONTINUE ! tetrahedron-information read or created
CLOSE(41)
67 CONTINUE ! tetrahedron-information read or created
CLOSE(41)
END IF
lb = MINVAL(eig(:,:,:)) - 0.01
ub = ef + 0.2
CALL tetra_ef(
......
......@@ -263,6 +263,7 @@
INTEGER :: nkpts
INTEGER :: nkpt
INTEGER :: nkptd
INTEGER :: ntet
REAL :: posScale
LOGICAL :: l_gamma
INTEGER :: nmop(3) !<number of k-points in 3 directions
......@@ -281,6 +282,8 @@
INTEGER :: numSpecialPoints
CHARACTER(LEN=50),ALLOCATABLE :: specialPointNames(:)
REAL ,ALLOCATABLE :: specialPoints(:,:)
INTEGER,ALLOCATABLE :: ntetra(:,:)
REAL ,ALLOCATABLE :: voltet(:)
ENDTYPE
......
......@@ -84,6 +84,7 @@ SUBROUTINE initParallelProcesses(atoms,vacuum,input,stars,sliceplot,banddos,&
CALL MPI_BCAST(kpts%nkpts,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(kpts%nkptd,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(kpts%nkpt,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(kpts%ntet,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(input%jspins,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(vacuum%layerd,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(vacuum%nmzxyd,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
......@@ -131,6 +132,8 @@ SUBROUTINE initParallelProcesses(atoms,vacuum,input,stars,sliceplot,banddos,&
ALLOCATE(kpts%bk(3,kpts%nkpts))
ALLOCATE(kpts%weight(kpts%nkpts))
ALLOCATE(kpts%wtkpt(kpts%nkpt))
ALLOCATE(kpts%ntetra(4,kpts%ntet))
ALLOCATE(kpts%voltet(kpts%ntet))
ALLOCATE(enpara%evac0(2,input%jspins))
ALLOCATE(enpara%lchg_v(2,input%jspins),enpara%skiplo(atoms%ntypd,input%jspins))
......
......@@ -360,6 +360,23 @@
kpts%bk(3,j) = vkxyz(3,j)
kpts%weight(j) = wghtkp(j)
END DO
IF (input%tria.AND.random) THEN
kpts%ntet = ntet
IF (ALLOCATED(kpts%ntetra)) THEN
DEALLOCATE(kpts%ntetra)
END IF
IF (ALLOCATED(kpts%voltet)) THEN
DEALLOCATE(kpts%voltet)
END IF
ALLOCATE(kpts%ntetra(4,kpts%ntet))
ALLOCATE(kpts%voltet(kpts%ntet))
DO j = 1, ntet
DO i = 1, 4
kpts%ntetra(i,j) = ntetra(i,j)
END DO
kpts%voltet(j) = ABS(voltet(j))
END DO
END IF
ELSE
OPEN (41,file='kpts',form='formatted',status='new')
IF (input%film) THEN
......
......@@ -282,6 +282,8 @@ SUBROUTINE r_inpXML(&
xmlPrintCoreStates = .FALSE.
xmlCoreOccs = 0.0
ALLOCATE (kpts%ntetra(4,kpts%ntet),kpts%voltet(kpts%ntet))
WRITE(*,*) 'Note: core states output (from input) into out.xml file has to be implemented!'
! Read in constants
......
......@@ -100,6 +100,7 @@
input%l_inpXML = .FALSE.
kpts%numSpecialPoints = 1
kpts%ntet = 1
INQUIRE (file='inp.xml',exist=input%l_inpXML)
IF(.NOT.juDFT_was_argument("-xmlInput")) THEN
input%l_inpXML = .FALSE.
......@@ -207,6 +208,7 @@
ALLOCATE ( atoms%ulo_der(atoms%nlod,atoms%ntypd) )
ALLOCATE ( noco%soc_opt(atoms%ntypd+2) )
ALLOCATE ( atoms%numStatesProvided(atoms%ntypd))
ALLOCATE ( kpts%ntetra(4,kpts%ntet), kpts%voltet(kpts%ntet))
!+odim
ALLOCATE ( oneD%ig1(-oneD%odd%k3:oneD%odd%k3,-oneD%odd%M:oneD%odd%M) )
ALLOCATE ( oneD%kv1(2,oneD%odd%n2d),oneD%nstr1(oneD%odd%n2d) )
......
......@@ -172,6 +172,8 @@ CONTAINS
CALL MPI_BCAST(kpts%nkpt,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(kpts%bk,3*kpts%nkptd,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(kpts%wtkpt,kpts%nkptd,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(kpts%ntetra,kpts%ntet,MPI_INTEGER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(kpts%voltet,kpts%ntet,MPI_DOUBLE_PRECISION,0,mpi%mpi_comm,ierr)
!
n = atoms%natd*sym%nop
......
enable_testing()
set(Testdirs CuBulk CuBulkXML Fe_1l Fe-Atom CuBand CuDOS Fe_bct_LO Fe_bct NiO_ldau PTO Fe_fcc)
set(Testdirs_INVS CuBulk CuBulkXML Fe_1l Fe-Atom CuBand CuDOS)
set(Testdirs CuBulk CuBulkXML Fe_1l Fe-Atom CuBand CuBandXML CuDOS CuDOSXML Fe_bct_LO Fe_bct NiO_ldau PTO Fe_fcc)
set(Testdirs_INVS CuBulk CuBulkXML Fe_1l Fe-Atom CuBand CuBandXML CuDOS CuDOSXML)
set(Testdirs_SOC Bi2Te3 Fe_1l_SOC PTO-SOC Fe_bct_SOC)
#The serial tests
......
energy parameters for window 1 spin 1 mix= 1.000000
atom s p d f
--> 1 0.22652 0.22652 0.21267 0.22652 change: TTTT skiplo: 0
--> 2 0.22652 0.22652 0.21267 0.22652 change: TTTT skiplo: 0
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<fleurInput fleurInputVersion="0.27">
<comment>
Cu bulk
</comment>
<calculationSetup>
<cutoffs Kmax="3.50000000" Gmax="15.00000000" GmaxXC="10.00000000" numbands="0"/>
<scfLoop itmax="1" maxIterBroyd="99" imix="Anderson" alpha=".05000000" spinf="2.00000000"/>
<coreElectrons ctail="T" frcor="F" kcrel="0"/>
<magnetism jspins="1" l_noco="F" l_J="F" swsp="F" lflip="F"/>
<soc theta=".00000000" phi=".00000000" l_soc="F" spav="F" off="F" soc66="T"/>
<expertModes gw="0" pot8="F" eig66="F" lpr="0" isec1="99" secvar="F"/>
<geometryOptimization l_f="F" xa="2.00000000" thetad="330.00000000" epsdisp=".00001000" epsforce=".00001000"/>
<bzIntegration valenceElectrons="22.00000000" mode="hist" fermiSmearingEnergy=".00100000">
<kPointCount count="20" gamma="F">
<specialPoint name="G">0.0 0.0 0.0</specialPoint>
<specialPoint name="A">0.475 0.0 0.0</specialPoint>
</kPointCount>
</bzIntegration>
<energyParameterLimits ellow="-0.80000000" elup="0.50000000"/>
</calculationSetup>
<cell>
<symmetry spgrp="p4m" invs="T" zrfs="T"/>
<bulkLattice scale="0.970000000000" latnam="squ">
<a1>4.815397</a1>
<c>6.81</c>
</bulkLattice>
</cell>
<xcFunctional name="pz" relativisticCorrections="F"/>
<atomSpecies>
<species name="Cu-1" element="Cu" atomicNumber="29" coreStates="7" magMom=".00000000" flipSpin="T">
<mtSphere radius="2.20000000" gridPoints="935" logIncrement=".01300000"/>
<atomicCutoffs lmax="12" lnonsphr="8"/>
<energyParameters s="4" p="4" d="3" f="4"/>
</species>
</atomSpecies>
<atomGroups>
<atomGroup species="Cu-1">
<relPos>0.0 0.0 1.0/2.0</relPos>
<force calculate="T" relaxXYZ="TTT"/>
</atomGroup>
<atomGroup species="Cu-1">
<relPos>1.0/2.0 1.0/2.0 0.0</relPos>
<force calculate="T" relaxXYZ="TTT"/>
</atomGroup>
</atomGroups>
<output dos="F" band="T" vacdos="F" slice="F">
<checks vchk="F" cdinf="F" disp="F"/>
<densityOfStates ndir="0" minEnergy="-.50000000" maxEnergy=".50000000" sigma=".01500000"/>
<vacuumDOS layers="0" integ="F" star="F" nstars="0" locx1=".00000000" locy1=".00000000" locx2=".00000000" locy2=".00000000" nstm="0" tworkf=".00000000"/>
<plotting iplot="F" score="F" plplot="F"/>
<chargeDensitySlicing numkpt="0" minEigenval=".00000000" maxEigenval=".00000000" nnne="0" pallst="F"/>
<specialOutput form66="F" eonly="F" bmt="F"/>
</output>
</fleurInput>
$test_name="Fleur Cu Bulk - XML";
$test_code="Fleur";
%test_requirements=("SOC",0);
$test_stages=1;
$test_desc=<<EOF
Simple test of Fleur band structure calculation with XML input with one step:
1.Generate a starting density, run 1 iteration, and generate band structure. Ensure that the files are created.
EOF
;
#juDFT Testscript
jt::copyfile("files/inp.xml",$workdir);
jt::copyfile("files/enpara",$workdir);
jt::testrun("$executable -xmlInput",$workdir);
#now test output
$result=jt::test_fileexists("$workdir/band.1");
$result=jt::test_fileexists("$workdir/DOS.1");
$result+=jt::test_grepnumber("$workdir/DOS.1","9.40276","9.40276 (.....)",0.290,0.0001);
jt::stageresult($workdir,$result,"1");
energy parameters for window 1 spin 1 mix= 1.000000
atom s p d f
--> 1 0.22652 0.22652 0.21267 0.22652 change: TTTT skiplo: 0
--> 2 0.22652 0.22652 0.21267 0.22652 change: TTTT skiplo: 0
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<fleurInput fleurInputVersion="0.27">
<comment>
Cu bulk
</comment>
<calculationSetup>
<cutoffs Kmax="3.50000000" Gmax="15.00000000" GmaxXC="10.00000000" numbands="0"/>
<scfLoop itmax="1" maxIterBroyd="99" imix="Anderson" alpha=".05000000" spinf="2.00000000"/>
<coreElectrons ctail="T" frcor="F" kcrel="0"/>
<magnetism jspins="1" l_noco="F" l_J="F" swsp="F" lflip="F"/>
<soc theta=".00000000" phi=".00000000" l_soc="F" spav="F" off="F" soc66="T"/>
<expertModes gw="0" pot8="F" eig66="F" lpr="0" isec1="99" secvar="F"/>
<geometryOptimization l_f="F" xa="2.00000000" thetad="330.00000000" epsdisp=".00001000" epsforce=".00001000"/>
<bzIntegration valenceElectrons="22.00000000" mode="tria" fermiSmearingEnergy=".00100000">
<kPointCount count="20" gamma="F"/>
</bzIntegration>
<energyParameterLimits ellow="-0.80000000" elup="0.50000000"/>
</calculationSetup>
<cell>
<symmetry spgrp="p4m" invs="T" zrfs="T"/>
<bulkLattice scale="0.970000000000" latnam="squ">
<a1>4.815397</a1>
<c>6.81</c>
</bulkLattice>
</cell>
<xcFunctional name="pz" relativisticCorrections="F"/>
<atomSpecies>
<species name="Cu-1" element="Cu" atomicNumber="29" coreStates="7" magMom=".00000000" flipSpin="T">
<mtSphere radius="2.20000000" gridPoints="935" logIncrement=".01300000"/>
<atomicCutoffs lmax="12" lnonsphr="8"/>
<energyParameters s="4" p="4" d="3" f="4"/>
</species>
</atomSpecies>
<atomGroups>
<atomGroup species="Cu-1">
<relPos>0.0 0.0 1.0/2.0</relPos>
<force calculate="T" relaxXYZ="TTT"/>
</atomGroup>
<atomGroup species="Cu-1">
<relPos>1.0/2.0 1.0/2.0 0.0</relPos>
<force calculate="T" relaxXYZ="TTT"/>
</atomGroup>
</atomGroups>
<output dos="T" band="F" vacdos="F" slice="F">
<checks vchk="F" cdinf="F" disp="F"/>
<densityOfStates ndir="-1" minEnergy="-.50000000" maxEnergy=".50000000" sigma=".01500000"/>
<vacuumDOS layers="0" integ="F" star="F" nstars="0" locx1=".00000000" locy1=".00000000" locx2=".00000000" locy2=".00000000" nstm="0" tworkf=".00000000"/>
<plotting iplot="F" score="F" plplot="F"/>
<chargeDensitySlicing numkpt="0" minEigenval=".00000000" maxEigenval=".00000000" nnne="0" pallst="F"/>
<specialOutput form66="F" eonly="F" bmt="F"/>
</output>
</fleurInput>
$test_name="Fleur Cu Bulk - XML";
$test_code="Fleur";
%test_requirements=("SOC",0);
$test_stages=1;
$test_desc=<<EOF
Simple test of Fleur DOS calculation with XML input with one step:
1.Generate a starting density, run 1 iteration, and generate DOS. Ensure that the files are created.
EOF
;
#juDFT Testscript
jt::copyfile("files/inp.xml",$workdir);
jt::copyfile("files/enpara",$workdir);
jt::testrun("$executable -xmlInput",$workdir);
#now test output
$result=jt::test_fileexists("$workdir/DOS.1");
$result+=jt::test_grepnumber("$workdir/DOS.1","10.88235","10.88235 (.....)",0.105,0.0001);
jt::stageresult($workdir,$result,"1");
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