Commit 475f56f6 authored by Gregor Michalicek's avatar Gregor Michalicek

Implemented the generation of simple band structures when using inp.xml

Note: self-defined k-point paths in inp.xml are not yet implemented.
parent 2dbc999c
...@@ -4,18 +4,23 @@ ...@@ -4,18 +4,23 @@
!---------------------------------------------------------------------- !----------------------------------------------------------------------
CONTAINS CONTAINS
SUBROUTINE bandstr1( SUBROUTINE bandstr1(
> idsyst,idtype,bmat,nkpt,jspins,film) > idsyst,idtype,bmat,kpts,input,l_fillArrays)
USE m_types
IMPLICIT NONE IMPLICIT NONE
INTEGER, INTENT (IN) :: idsyst,idtype,nkpt,jspins TYPE(t_input),INTENT(INOUT) :: input
TYPE(t_kpts),INTENT(INOUT) :: kpts
INTEGER, INTENT (IN) :: idsyst,idtype
REAL, INTENT (IN) :: bmat(3,3) REAL, INTENT (IN) :: bmat(3,3)
LOGICAL, INTENT (IN) :: film LOGICAL, INTENT (IN) :: l_fillArrays
REAL, POINTER :: kpts(:,:)
REAL, POINTER :: syp(:,:) REAL, POINTER :: syp(:,:)
CHARACTER(len=1), POINTER :: ssy(:) CHARACTER(len=1), POINTER :: ssy(:)
REAL, ALLOCATABLE :: rsyp(:,:),del(:),d(:) REAL, ALLOCATABLE :: rsyp(:,:),del(:),d(:)
REAL, ALLOCATABLE :: bkTemp(:,:)
INTEGER, ALLOCATABLE :: nk(:) INTEGER, ALLOCATABLE :: nk(:)
INTEGER nosyp,i,j,n,ntot INTEGER nosyp,i,j,n,ntot
REAL dk(3),syp1(3),rsyp1(3) REAL dk(3),syp1(3),rsyp1(3)
...@@ -49,10 +54,12 @@ ...@@ -49,10 +54,12 @@
! !
ntot = nosyp ntot = nosyp
DO i = 2,nosyp DO i = 2,nosyp
nk(i) = NINT ( (nkpt-nosyp)*( del(i) / d(nosyp) ) ) nk(i) = NINT ( (kpts%nkpt-nosyp)*( del(i) / d(nosyp) ) )
ntot = ntot + nk(i) ntot = ntot + nk(i)
ENDDO ENDDO
ALLOCATE ( kpts(3,ntot) ) kpts%nkpt = ntot
ALLOCATE (bkTemp(3,kpts%nkpt))
! !
! --> generate k-points mesh ! --> generate k-points mesh
! !
...@@ -61,33 +68,47 @@ ...@@ -61,33 +68,47 @@
dk(1) = ( syp(1,i) - syp(1,i-1) ) / (nk(i)+1) dk(1) = ( syp(1,i) - syp(1,i-1) ) / (nk(i)+1)
dk(2) = ( syp(2,i) - syp(2,i-1) ) / (nk(i)+1) dk(2) = ( syp(2,i) - syp(2,i-1) ) / (nk(i)+1)
dk(3) = ( syp(3,i) - syp(3,i-1) ) / (nk(i)+1) dk(3) = ( syp(3,i) - syp(3,i-1) ) / (nk(i)+1)
kpts(:,n) = syp(:,i-1) bkTemp(:,n) = syp(:,i-1)
n = n + 1 n = n + 1
DO j = 1, nk(i) DO j = 1, nk(i)
kpts(:,n) = kpts(:,n-1) + dk(:) bkTemp(:,n) = bkTemp(:,n-1) + dk(:)
n = n + 1 n = n + 1
ENDDO ENDDO
ENDDO ENDDO
kpts(:,n) = syp(:,nosyp) bkTemp(:,n) = syp(:,nosyp)
kpts%nkpts = kpts%nkpt
kpts%posScale = 1.0
OPEN (41,file='kpts',form='formatted',status='new') IF(l_fillArrays) THEN
IF (.NOT.film) THEN IF(ALLOCATED(kpts%bk)) THEN
WRITE(41,'(i5,f20.10)') ntot,1.0 DEALLOCATE(kpts%bk)
DO n = 1,ntot END IF
WRITE (41,'(4f10.5)') kpts(:,n),1.0 IF(ALLOCATED(kpts%weight)) THEN
ENDDO DEALLOCATE(kpts%weight)
END IF
ALLOCATE (kpts%bk(3,kpts%nkpt), kpts%weight(kpts%nkpt))
kpts%bk(:,:) = bkTemp(:,:)
kpts%weight = 1.0
ELSE ELSE
WRITE(41,'(i5,f20.10,3x,l1)') ntot,1.0,.false. OPEN (41,file='kpts',form='formatted',status='new')
DO n = 1,ntot IF (.NOT.input%film) THEN
WRITE (41,'(3f10.5)') kpts(1:2,n),1.0 WRITE(41,'(i5,f20.10)') kpts%nkpt,kpts%posScale
ENDDO DO n = 1, kpts%nkpt
WRITE (41,'(4f10.5)') bkTemp(:,n),1.0
ENDDO
ELSE
WRITE(41,'(i5,f20.10,3x,l1)') kpts%nkpt,kpts%posScale,.false.
DO n = 1, kpts%nkpt
WRITE (41,'(3f10.5)') bkTemp(1:2,n),1.0
ENDDO
END IF
CLOSE (41)
END IF END IF
CLOSE (41)
CALL write_gnu( CALL write_gnu(
> nosyp,d,ssy,jspins) > nosyp,d,ssy,input%jspins)
DEALLOCATE ( rsyp,syp,del,nk,ssy,d ) DEALLOCATE ( rsyp,syp,del,nk,ssy,d,bkTemp )
END SUBROUTINE bandstr1 END SUBROUTINE bandstr1
!---------------------------------------------------------------------- !----------------------------------------------------------------------
......
...@@ -146,9 +146,8 @@ ...@@ -146,9 +146,8 @@
!-------------------- Want to make a Bandstructure ? -------- !-------------------- Want to make a Bandstructure ? --------
! !
IF (banddos%ndir == -4) THEN IF (banddos%ndir == -4) THEN
CALL bandstr1(& CALL bandstr1(idsyst,idtype,cell%bmat,kpts,input,l_fillArrays)
& idsyst,idtype,cell%bmat,kpts%nkpt,input%jspins,input%film) RETURN
RETURN
ENDIF ENDIF
! !
!-------------------- Some variables we do not use ---------- !-------------------- Some variables we do not use ----------
...@@ -348,7 +347,7 @@ ...@@ -348,7 +347,7 @@
DEALLOCATE(kpts%weight) DEALLOCATE(kpts%weight)
END IF END IF
ALLOCATE(kpts%bk(3,kpts%nkpt),kpts%weight(kpts%nkpt)) ALLOCATE(kpts%bk(3,kpts%nkpt),kpts%weight(kpts%nkpt))
kpts%posScale = REAL(idiv) IF (idiv.NE.0) kpts%posScale = REAL(idiv)
DO j = 1, kpts%nkpt DO j = 1, kpts%nkpt
kpts%bk(1,j) = vkxyz(1,j) kpts%bk(1,j) = vkxyz(1,j)
kpts%bk(2,j) = vkxyz(2,j) kpts%bk(2,j) = vkxyz(2,j)
......
...@@ -446,6 +446,13 @@ SUBROUTINE r_inpXML(& ...@@ -446,6 +446,13 @@ SUBROUTINE r_inpXML(&
l_kpts = .FALSE. l_kpts = .FALSE.
kpts%nkpt = evaluateFirstIntOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@count')) kpts%nkpt = evaluateFirstIntOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@count'))
kpts%l_gamma = evaluateFirstBoolOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@gamma')) kpts%l_gamma = evaluateFirstBoolOnly(xmlGetAttributeValue(TRIM(ADJUSTL(xPathA))//'/@gamma'))
kpts%nkpts = kpts%nkpt
ALLOCATE(kpts%bk(3,kpts%nkpts))
ALLOCATE(kpts%weight(kpts%nkpts))
kpts%bk = 0.0
kpts%weight = 0.0
kpts%posScale = 1.0
numberNodes = xmlGetNumberOfNodes('/fleurInput/calculationSetup/bzIntegration/kPointCount/specialPoint') numberNodes = xmlGetNumberOfNodes('/fleurInput/calculationSetup/bzIntegration/kPointCount/specialPoint')
IF(numberNodes.EQ.1) THEN IF(numberNodes.EQ.1) THEN
......
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