LCOV - code coverage report
Current view: top level - wannier - wann_w90kpointgen.f (source / functions) Hit Total Coverage
Test: combined.info Lines: 0 64 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_w90kpointgen
       8             :       use m_juDFT
       9             :       private
      10             :       public :: wann_w90kpointgen
      11             :       contains
      12           0 :       subroutine wann_w90kpointgen()
      13             : c***********************************************************
      14             : c     Generate the k-point file 'w90kpts' 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     the w90kpts file is needed. The 'kpts' file is then
      18             : c     generated from the 'w90kpts' using the symmetries.
      19             : c     This is done by the subroutine wann_kptsreduc inside the
      20             : c     Fleur-code.
      21             : c     Frank Freimuth, June 2007
      22             : c***********************************************************
      23             :       implicit none
      24             :       integer num,dim
      25             :       integer c1,c2,c3
      26             :       real i1,i2,i3
      27             :       logical l_shift
      28             :       integer Nx,Ny,Nz
      29             :       integer nnx,nny,nnz
      30             :       real ilen1,ilen2,ilen3
      31             :       integer limit1, limit2, limit3
      32             :       real scale,shift1,shift2,shift3
      33             :       
      34           0 :       print*,"specify dimension"
      35           0 :       read(*,*)dim
      36           0 :       print*,"symmetric to origin?"
      37           0 :       read(*,*)l_shift
      38           0 :       Nx=1;Ny=1;Nz=1
      39           0 :       if(dim==3)then
      40           0 :          print*,"Creates three dimensional k-point set."
      41           0 :       elseif(dim==2)then
      42           0 :          print*,"Create two-dimensional k-point set."
      43           0 :       elseif(dim==1)then
      44           0 :          print*,"Create one-dimensional k-point set."
      45             :       else
      46             :          CALL juDFT_error("unknown dimension",calledby
      47           0 :      +        ="wann_w90kpointgen")
      48             :       endif
      49           0 :       print*,"Specify the number of k-point steps"
      50           0 :       print*,"for each direction."
      51           0 :       if(.not.dim==2)then
      52           0 :          print*,"Nz="
      53           0 :          read(*,*)Nz
      54             :       endif
      55           0 :       if(.not.dim==1)then
      56           0 :          print*,"Ny="
      57           0 :          read(*,*)Ny
      58           0 :          print*,"Nx="
      59           0 :          read(*,*)Nx
      60             :       endif   
      61           0 :       num=Nx*Ny*Nz
      62           0 :       print*,"Number of k-points: ",num
      63           0 :       call findkgt(Nx,nnx)
      64           0 :       call findkgt(ny,nny)
      65           0 :       call findkgt(nz,nnz)
      66           0 :       scale=nnx
      67           0 :       if(nny.ne.nnx)scale=scale*nny
      68           0 :       if(nnz.ne.nny .and. nnz.ne.nnx)
      69           0 :      &      scale=scale*nnz
      70           0 :       print*,"scale=",scale
      71           0 :       ilen1=1.0/nx; ilen2=1.0/ny; ilen3=1.0/nz
      72           0 :       limit1=nx-1; limit2=ny-1; limit3=nz-1   
      73           0 :       if(l_shift)then
      74           0 :          shift1=limit1*ilen1/2.0
      75           0 :          shift2=limit2*ilen2/2.0
      76           0 :          shift3=limit3*ilen3/2.0
      77             :       endif
      78             :       open(100,file='w90kpts',form='formatted',
      79           0 :      &                  status='unknown',recl=1000)
      80           0 :       write(100,*)num,scale
      81           0 :       do c1=0,limit1
      82           0 :          do c2=0,limit2
      83           0 :             do c3=0,limit3
      84           0 :                i1=(ilen1*c1-shift1)*scale
      85           0 :                i2=(ilen2*c2-shift2)*scale
      86           0 :                i3=(ilen3*c3-shift3)*scale
      87           0 :                write(100,*)i1,i2,i3,1.0
      88             :             enddo
      89             :          enddo
      90             :       enddo
      91           0 :       close(100)
      92           0 :       end subroutine wann_w90kpointgen
      93             : 
      94           0 :       subroutine findkgt(nu,sc)
      95             :       implicit none
      96             :       integer,intent(out)::sc
      97             :       integer,intent(in)::nu
      98             :       integer k,nnu
      99           0 :       nnu=nu
     100           0 :       IF(nnu==0)  CALL juDFT_error("nnu.eq.0",calledby
     101           0 :      +     ="wann_w90kpointgen")
     102           0 :       do k=1,3
     103           0 :          if(nnu.eq.1)exit
     104           0 :          if(mod(nnu,5).ne.0)exit
     105           0 :          nnu=nnu/5
     106             :       enddo
     107           0 :       do k=1,3
     108           0 :          if(nnu.eq.1)exit
     109           0 :          if(mod(nnu,2).ne.0)exit
     110           0 :          nnu=nnu/2
     111             :       enddo
     112           0 :       sc=nnu
     113           0 :       end subroutine findkgt
     114             : 
     115             : 
     116             :       end module m_wann_w90kpointgen

Generated by: LCOV version 1.13