LCOV - code coverage report
Current view: top level - wannier - wann_postproc_setup2.F (source / functions) Coverage Total Hit
Test: FLEUR test coverage Lines: 100.0 % 37 37
Test Date: 2025-06-17 04:26:29 Functions: 100.0 % 1 1

            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_postproc_setup2
       8              :         use m_juDFT
       9              : #ifdef CPP_WANN
      10              :       CONTAINS
      11            1 :       SUBROUTINE wann_postproc_setup2(
      12            1 :      >           natd,nkpts,kpoints,amat,bmat,
      13            1 :      >           num,num_bands,ntype,neq,
      14            2 :      >           zatom,taual,namat,seed,bkpts_filename)
      15              : c******************************************************
      16              : c     Call the Wannier90 setup routine.
      17              : c     interface corresponding to wannier version 2.0
      18              : c     Purpose: get the file of nearest-neighbor kpoints
      19              : c     Frank Freimuth
      20              : c******************************************************
      21              :       IMPLICIT NONE
      22              : 
      23              :       integer, intent(in)         :: natd
      24              :       integer, intent(in)         :: nkpts
      25              :       real,    intent(in)         :: kpoints(3,nkpts)
      26              :       real,    intent(in)         :: amat(3,3)
      27              :       real,    intent(in)         :: bmat(3,3)
      28              :       integer, intent(in)         :: num(3)
      29              :       integer, intent(in)         :: num_bands
      30              :       integer, intent(in)         :: ntype
      31              :       integer, intent(in)         :: neq(ntype)
      32              :       real,    intent(in)         :: zatom(ntype)
      33              :       real,    intent(in)         :: taual(:,:)
      34              :       character(len=2),intent(in) :: namat(0:103)
      35              :       character(len=*),intent(in) :: seed    ! QPOINTS
      36              :       character(len=*),intent(in) :: bkpts_filename ! QPOINTS
      37              : 
      38              :       integer             :: i,j,at
      39              :       character(len=50)   :: seedname
      40              :       integer             :: num_atoms
      41            1 :       character(len=2)    :: atom_symbols(natd)
      42              :       logical             :: gamma_only
      43              :       logical             :: spinors
      44              :       integer,parameter   :: num_nnmax=12
      45              :       integer             :: nntot
      46            1 :       integer             :: nnlist(nkpts,num_nnmax)
      47            1 :       integer             :: nncell(3,nkpts,num_nnmax)
      48              :       integer             :: num_bands2
      49              :       integer             :: num_wann2
      50            1 :       real                :: proj_site(3,num_bands)
      51            1 :       integer             :: proj_l(num_bands)
      52            1 :       integer             :: proj_m(num_bands)
      53            1 :       integer             :: proj_radial(num_bands)
      54            1 :       real                :: proj_z(3,num_bands)
      55            1 :       real                :: proj_x(3,num_bands)
      56            1 :       real                :: proj_zona(num_bands)
      57            1 :       integer             :: exclude_bands(num_bands)
      58              :       integer             :: nn,ikpt
      59            1 :       real                :: pos(3,natd)
      60              : 
      61              : 
      62              :       ! Taken from wannier90-2.0/src/wannier_lib.F90
      63              :       interface
      64              :         subroutine wannier_setup(seed__name, mp_grid_loc, num_kpts_loc,
      65              :      +    real_lattice_loc, recip_lattice_loc, kpt_latt_loc,
      66              :      +    num_bands_tot, num_atoms_loc, atom_symbols_loc,
      67              :      +    atoms_cart_loc, gamma_only_loc, spinors_loc, nntot_loc,
      68              :      +    nnlist_loc, nncell_loc, num_bands_loc, num_wann_loc,
      69              :      +    proj_site_loc, proj_l_loc, proj_m_loc, proj_radial_loc,
      70              :      +    proj_z_loc, proj_x_loc, proj_zona_loc, exclude_bands_loc,
      71              :      +    proj_s_loc,proj_s_qaxis_loc)
      72              : 
      73              :          implicit none
      74              :          integer, parameter :: dp = selected_real_kind(15,300)
      75              :          integer, parameter :: num_nnmax=12
      76              :          character(len=*), intent(in) :: seed__name
      77              :          integer, dimension(3), intent(in) :: mp_grid_loc
      78              :          integer, intent(in) :: num_kpts_loc
      79              :          real(kind=dp), dimension(3,3), intent(in) :: real_lattice_loc
      80              :          real(kind=dp), dimension(3,3), intent(in) :: recip_lattice_loc
      81              :          real(kind=dp), dimension(3,num_kpts_loc), intent(in) ::
      82              :      +      kpt_latt_loc
      83              :          integer, intent(in) :: num_bands_tot
      84              :          integer, intent(in) :: num_atoms_loc
      85              :          character(len=*), dimension(num_atoms_loc), intent(in) ::
      86              :      +      atom_symbols_loc
      87              :          real(kind=dp), dimension(3,num_atoms_loc), intent(in) ::
      88              :      +      atoms_cart_loc
      89              :          logical, intent(in) :: gamma_only_loc
      90              :          logical, intent(in) :: spinors_loc
      91              : 
      92              :          integer, intent(out) :: nntot_loc
      93              :          integer, dimension(num_kpts_loc,num_nnmax), intent(out) ::
      94              :      +      nnlist_loc
      95              :          integer,dimension(3,num_kpts_loc,num_nnmax), intent(out) ::
      96              :      +      nncell_loc
      97              :          integer, intent(out) :: num_bands_loc
      98              :          integer, intent(out) :: num_wann_loc
      99              :          real(kind=dp), dimension(3,num_bands_tot), intent(out) ::
     100              :      +      proj_site_loc
     101              :          integer, dimension(num_bands_tot), intent(out) :: proj_l_loc
     102              :          integer, dimension(num_bands_tot), intent(out) :: proj_m_loc
     103              :          integer, dimension(num_bands_tot), intent(out) ::
     104              :      +      proj_radial_loc
     105              :          real(kind=dp), dimension(3,num_bands_tot), intent(out) ::
     106              :      +      proj_z_loc
     107              :          real(kind=dp), dimension(3,num_bands_tot), intent(out) ::
     108              :      +      proj_x_loc
     109              :          real(kind=dp), dimension(num_bands_tot), intent(out) ::
     110              :      +      proj_zona_loc
     111              :          integer, dimension(num_bands_tot), intent(out) ::
     112              :      +      exclude_bands_loc
     113              :          integer, dimension(num_bands_tot), optional, intent(out) ::
     114              :      +      proj_s_loc
     115              :          real(kind=dp), dimension(3,num_bands_tot), optional,
     116              :      +      intent(out) :: proj_s_qaxis_loc
     117              :         end subroutine wannier_setup
     118              :       end interface
     119              : 
     120            1 :       call timestart("wann_postproc_setup2")
     121              : 
     122            3 :       do j=1,natd
     123           33 :          pos(:,j)=matmul(amat(:,:),taual(:,j))
     124              :       enddo
     125              : 
     126              :       !seedname='WF1'
     127            1 :       seedname=seed
     128            1 :       gamma_only=.false.
     129            1 :       spinors=.false.
     130              : 
     131            1 :       num_atoms=0
     132            2 :       do i=1,ntype
     133            1 :          at=nint(zatom(i))
     134            4 :          do j=1,neq(i)
     135            2 :             num_atoms=num_atoms+1
     136            3 :             atom_symbols(num_atoms)=namat(at)
     137              :          enddo !j
     138              :       enddo !i
     139              : 
     140              : c**********************************************************
     141              : c     Call Wannier90 routine for preparation.
     142              : c**********************************************************
     143              :       call wannier_setup(
     144              :      >     seedname,num,
     145              :      >     nkpts,
     146              :      >     transpose(amat),bmat,
     147              :      >     kpoints,num_bands, 
     148              :      >     num_atoms,atom_symbols,pos, 
     149              :      >     gamma_only,spinors, 
     150              :      >     nntot,nnlist,nncell,num_bands2,
     151              :      >     num_wann2,
     152              :      >     proj_site,proj_l,proj_m,
     153              :      >     proj_radial,proj_z, 
     154            1 :      >     proj_x,proj_zona,exclude_bands)
     155              : 
     156              : c******************************************************
     157              : c           write bkpts
     158              : c******************************************************
     159            1 :       open(202,file=bkpts_filename,form='formatted')
     160            1 :       write (202,'(i4)') nntot
     161            9 :       do ikpt=1,nkpts
     162           73 :         do nn=1,nntot
     163              :           write (202,'(2i6,3x,3i4)') 
     164              : c     &     ikpt,bpt(nn,ikpt),(gb(i,nn,ikpt),i=1,3)
     165           72 :      &     ikpt,nnlist(ikpt,nn),(nncell(i,ikpt,nn),i=1,3)
     166              :         enddo
     167              :       enddo
     168            1 :       close(202)
     169              : 
     170              : 
     171            1 :       call timestop("wann_postproc_setup2")
     172            1 :       END SUBROUTINE wann_postproc_setup2
     173              : #endif
     174              :       END MODULE m_wann_postproc_setup2
        

Generated by: LCOV version 2.0-1