LCOV - code coverage report
Current view: top level - wannier - wann_dipole_takehome.f (source / functions) Hit Total Coverage
Test: combined.info Lines: 0 20 0.0 %
Date: 2019-09-08 04:53:50 Functions: 0 1 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_dipole_takehome
       8             :       contains
       9           0 :       subroutine wann_dipole_takehome(
      10             :      >               jspins,l_absolute,
      11             :      >               amat,bmat,omtil,
      12             :      <               electronic_moment)
      13             : c***********************************************************
      14             : c-----Check if the polarization may be reduced by adding 
      15             : c-----contributions due to electrons shifted by primitive
      16             : c-----lattice translations. This is the solution to the 
      17             : c-----problem of Wannier functions being pulled away from 
      18             : c-----their host atom to a mirror host atom during the
      19             : c-----Wannierization process.
      20             : c                            Frank Freimuth
      21             : c***********************************************************
      22             :       use m_constants, only: pimach
      23             :       implicit none
      24             : 
      25             :       integer, intent(in) :: jspins
      26             :       logical, intent(in) :: l_absolute
      27             :       real, intent(in)    :: amat(3,3),bmat(3,3),omtil
      28             :       real, intent(inout) :: electronic_moment(3,2)
      29             : 
      30             :       real,parameter      :: elemchargmu=1.60217646e-13
      31             :       real,parameter      :: bohrtocm=0.529177e-8
      32             :       real                :: electronic_polarization(3,2)
      33             :       integer             :: jspin,k
      34             :       real                :: int_electronic_moment(3,2)
      35             :       real                :: tpi
      36             : 
      37           0 :       tpi=2.0*pimach()
      38             : 
      39           0 :       write(666,*)"*********************************"
      40           0 :       write(666,*)" Try to minimize electronic term "
      41           0 :       write(666,*)"*********************************"
      42           0 :       write(*,*)  "*********************************"
      43           0 :       write(*,*)  " Try to minimize electronic term "
      44           0 :       write(*,*)  "*********************************"
      45             : 
      46           0 :       do jspin=1,jspins
      47             :         int_electronic_moment(:,jspin)=
      48           0 :      =      matmul( bmat,electronic_moment(:,jspin) )/tpi
      49           0 :         do k=1,3
      50             :            int_electronic_moment(k,jspin)=
      51             :      =       int_electronic_moment(k,jspin) -
      52           0 :      -       nint( int_electronic_moment(k,jspin) )  
      53             :         enddo
      54             :         electronic_moment(:,jspin) =
      55           0 :      =         matmul(amat,int_electronic_moment(:,jspin))
      56           0 :         write(*,  fmt=555)jspin,electronic_moment(:,jspin)
      57           0 :         write(666,fmt=555)jspin,electronic_moment(:,jspin)
      58           0 :         if(.not.l_absolute)then
      59             :            electronic_polarization=
      60           0 :      &            electronic_moment/omtil*elemchargmu/((bohrtocm)**2)
      61           0 :            write(*,  fmt=777)jspin,electronic_polarization(:,jspin)
      62           0 :            write(666,fmt=777)jspin,electronic_polarization(:,jspin)
      63             :         endif
      64             :       enddo  
      65             : 
      66             :  555  format("spin ",i1.1," electronic moment = (",3f12.6,") a.u.")
      67             :  777  format("spin ",i1.1,
      68             :      &          " electronic polarization = (",3f12.6,") uC/cm**2")
      69             : 
      70           0 :       end subroutine wann_dipole_takehome
      71             :       end module m_wann_dipole_takehome
      72             :       

Generated by: LCOV version 1.13