LCOV - code coverage report
Current view: top level - wannier - wann_kpointgen.f (source / functions) Hit Total Coverage
Test: combined.info Lines: 0 71 0.0 %
Date: 2019-09-08 04:53:50 Functions: 0 2 0.0 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------
       2             : ! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
       3             : ! This file is part of FLEUR and available as free software under the conditions
       4             : ! of the MIT license as expressed in the LICENSE file in more detail.
       5             : !--------------------------------------------------------------------------------
       6             : 
       7             :       module m_wann_kpointgen
       8             :       use m_juDFT
       9             :       private
      10             :       public::wann_kpointgen
      11             :       contains
      12           0 :       subroutine wann_kpointgen()
      13             : c***********************************************************
      14             : c     Generate the k-point file 'kpts' appropriate for the 
      15             : c     calculation of Wannier Functions with the Fleur-code.
      16             : c     In order to use the symmetry of the Brillouin zone,
      17             : c     use the program w90kpointgen instead.
      18             : c     Frank Freimuth, June 2007
      19             : c***********************************************************
      20             :       implicit none
      21             :       integer num,dim
      22             :       integer c1,c2,c3
      23             :       real i1,i2,i3
      24             :       logical l_shift
      25             :       integer Nx,Ny,Nz
      26             :       integer nnx,nny,nnz
      27             :       real ilen1,ilen2,ilen3
      28             :       integer limit1, limit2, limit3
      29             :       real scale,shift1,shift2,shift3
      30             :       
      31           0 :       print*,"specify dimension"
      32           0 :       read(*,*)dim
      33           0 :       print*,"symmetric to origin?"
      34           0 :       read(*,*)l_shift
      35           0 :       Nx=1;Ny=1;Nz=1
      36           0 :       if(dim==3)then
      37           0 :          print*,"Creates three dimensional k-point set."
      38           0 :       elseif(dim==2)then
      39           0 :          print*,"Create two-dimensional k-point set."
      40           0 :       elseif(dim==1)then
      41           0 :          print*,"Create one-dimensional k-point set."
      42             :       else
      43           0 :          CALL juDFT_error("unknown dimension",calledby="wann_kpointgen")
      44             :       endif
      45           0 :       print*,"Specify the number of k-point steps"
      46           0 :       print*,"for each direction."
      47           0 :       if(.not.dim==2)then
      48           0 :          print*,"Nz="
      49           0 :          read(*,*)Nz
      50             :       endif
      51           0 :       if(.not.dim==1)then
      52           0 :          print*,"Ny="
      53           0 :          read(*,*)Ny
      54           0 :          print*,"Nx="
      55           0 :          read(*,*)Nx
      56             :       endif   
      57           0 :       num=Nx*Ny*Nz
      58           0 :       print*,"Number of k-points: ",num
      59           0 :       call findkgt(Nx,nnx)
      60           0 :       call findkgt(ny,nny)
      61           0 :       call findkgt(nz,nnz)
      62           0 :       scale=nnx
      63           0 :       if(nny.ne.nnx)scale=scale*nny
      64           0 :       if(nnz.ne.nny .and. nnz.ne.nnx)
      65           0 :      &      scale=scale*nnz
      66           0 :       print*,"scale=",scale
      67           0 :       ilen1=1.0/nx; ilen2=1.0/ny; ilen3=1.0/nz
      68           0 :       limit1=nx-1; limit2=ny-1; limit3=nz-1   
      69           0 :       if(l_shift)then
      70           0 :          shift1=limit1*ilen1/2.0
      71           0 :          shift2=limit2*ilen2/2.0
      72           0 :          shift3=limit3*ilen3/2.0
      73             :       endif
      74           0 :       open(100,file='kpts',form='formatted',status='unknown')
      75           0 :       if(dim.ne.2)then !not the film-format of kpts
      76           0 :        write(100,'(i5,f20.10)')num,scale
      77           0 :        do c1=0,limit1
      78           0 :          do c2=0,limit2
      79           0 :             do c3=0,limit3
      80           0 :                i1=(ilen1*c1-shift1)*scale
      81           0 :                i2=(ilen2*c2-shift2)*scale
      82           0 :                i3=(ilen3*c3-shift3)*scale
      83           0 :                write(100,'(4f10.5)')i1,i2,i3,1.0
      84             :             enddo
      85             :          enddo
      86             :        enddo
      87             :       else !film-format
      88           0 :          write(100,'(i5,f20.10,3x,l1)')num,scale,.false.
      89           0 :          do c1=0,limit1
      90           0 :            do c2=0,limit2
      91           0 :                i1=(ilen1*c1-shift1)*scale
      92           0 :                i2=(ilen2*c2-shift2)*scale
      93           0 :                i3=(ilen3*c3-shift3)*scale
      94           0 :                write(100,'(3f10.5)')i1,i2,1.0
      95             :            enddo
      96             :          enddo
      97             :       endif
      98           0 :       close(100)
      99           0 :       end subroutine wann_kpointgen
     100             : 
     101           0 :       subroutine findkgt(nu,sc)
     102             :       implicit none
     103             :       integer,intent(out)::sc
     104             :       integer,intent(in)::nu
     105             :       integer k,nnu
     106           0 :       nnu=nu
     107           0 :       IF(nnu==0)  CALL juDFT_error("nnu.eq.0",calledby="wann_kpointgen")
     108           0 :       do k=1,3
     109           0 :          if(nnu.eq.1)exit
     110           0 :          if(mod(nnu,5).ne.0)exit
     111           0 :          nnu=nnu/5
     112             :       enddo
     113           0 :       do k=1,3
     114           0 :          if(nnu.eq.1)exit
     115           0 :          if(mod(nnu,2).ne.0)exit
     116           0 :          nnu=nnu/2
     117             :       enddo
     118           0 :       sc=nnu
     119           0 :       end subroutine findkgt
     120             : 
     121             :       end module m_wann_kpointgen

Generated by: LCOV version 1.13