wann_plot_symm.f 2.56 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 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
      MODULE m_wann_plot_symm
      CONTAINS
      SUBROUTINE wann_plot_symm(jspin,mrot,ikpt,kplot,l_conjugate)

      implicit none
      integer,intent(in)::jspin,ikpt,kplot
      logical,intent(in)::l_conjugate
      integer,intent(in)::mrot(3,3)
      character(len=10)::vandernameold
      character(len=10)::vandernamenew
      integer::grid(3),nslibd,ikpt_copy,nbnd
      integer::ix,iy,iz,ixx,iyy,izz
      complex::xdnout
      real,allocatable::xdnreal(:,:,:,:),xdnimag(:,:,:,:)
      real::point(3)
      real::rotpoint(3)
      integer::opoint1,opoint2,opoint3

      WRITE (vandernameold,201) ikpt,jspin
      write (vandernamenew,201) kplot,jspin
 201  FORMAT ('UNK',i5.5,'.',i1)      
      open(55,file=vandernameold)
      read(55,*)grid(1),grid(2),grid(3),ikpt_copy,nslibd
      allocate(xdnreal(0:grid(1)-1,0:grid(2)-1,0:grid(3)-1,nslibd))
      allocate(xdnimag(0:grid(1)-1,0:grid(2)-1,0:grid(3)-1,nslibd))
      do nbnd=1,nslibd
       do iz=0,grid(3)-1
        do iy=0,grid(2)-1
         do ix=0,grid(1)-1
            read(55,*)xdnreal(ix,iy,iz,nbnd),xdnimag(ix,iy,iz,nbnd)
         enddo
        enddo
       enddo
      enddo
      close(55)
      open(666,file=vandernamenew,form='formatted')
      write(666,'(5i4)')grid(1),grid(2),grid(3),kplot,nslibd
      do nbnd=1,nslibd
       do iz=0,grid(3)-1
        do iy=0,grid(2)-1
         do ix=0,grid(1)-1
          point(1)=real(ix)/grid(1)
          point(2)=real(iy)/grid(2)
          point(3)=real(iz)/grid(3)
          rotpoint(:)=matmul(point(1:3),1.0*mrot(1:3,1:3))
          where(rotpoint.lt.0)
             rotpoint=rotpoint+1.0
          endwhere
          opoint1=int(grid(1)*rotpoint(1)+0.01)
          opoint2=int(grid(2)*rotpoint(2)+0.01)
          opoint3=int(grid(3)*rotpoint(3)+0.01)
          if(l_conjugate)then
            write(666,*)xdnreal(opoint1,opoint2,opoint3,nbnd),
     &               -xdnimag(opoint1,opoint2,opoint3,nbnd)
          else
            write(666,*)xdnreal(opoint1,opoint2,opoint3,nbnd),
     &               xdnimag(opoint1,opoint2,opoint3,nbnd)
          endif
         enddo
        enddo
       enddo
      enddo
      close(666)

      END SUBROUTINE wann_plot_symm
      END MODULE m_wann_plot_symm