od_kptsgen.f 1.33 KB
Newer Older
1 2 3 4 5 6
!--------------------------------------------------------------------------------
! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
! This file is part of FLEUR and available as free software under the conditions
! of the MIT license as expressed in the LICENSE file in more detail.
!--------------------------------------------------------------------------------

7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
      MODULE m_od_kptsgen
      CONTAINS 
      SUBROUTINE od_kptsgen (nkpt)

!          generates a kpts file in a half of the 
!       one-dimensional Brillouin zone, uniform distribution
!                      Y. Mokrousov Dec 2005 

      IMPLICIT NONE

      INTEGER, INTENT(IN) :: nkpt

!  local
      INTEGER i,j
      REAL   , ALLOCATABLE :: kpts(:,:)
      REAL    scale

      scale = 1.0   

      ALLOCATE ( kpts(3,nkpt) )

      OPEN (41,file='kpts',form='formatted',status='new')
      WRITE (41,FMT=8110) nkpt,scale,.false.

      DO i = 1,nkpt

         kpts(1,i) = 0.
         kpts(2,i) = 0.
         IF (nkpt.EQ.1) THEN
            kpts(3,i) = 0.0
         ELSE
            kpts(3,i) = scale*(i-1)/(2.*(nkpt-1))
         ENDIF

         WRITE (41,FMT=8040) (kpts(j,i),j=1,3)

      END DO

 8110 FORMAT (i5,f20.10,3x,l1)
 8040 FORMAT (4f10.5)

      CLOSE (41)

      DEALLOCATE ( kpts )

      END SUBROUTINE od_kptsgen
      END MODULE m_od_kptsgen