LCOV - code coverage report
Current view: top level - wannier - wann_optional.f90 (source / functions) Hit Total Coverage
Test: combined.info Lines: 0 33 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_optional
       8             :   USE m_juDFT
       9             : CONTAINS
      10           0 :   SUBROUTINE wann_optional(input,kpts,atoms,sym,cell,oneD,noco,wann)
      11             :     !**************************************************
      12             :     !     Make preparations for the calculation of 
      13             :     !     Wannier functions.
      14             :     !     Frank Freimuth
      15             :     !**************************************************
      16             :     USE m_types
      17             :     USE m_wann_read_inp
      18             :     USE m_wann_projgen
      19             :     USE m_wann_kpointgen
      20             :     USE m_wann_w90kpointgen
      21             :     USE m_wann_kptsreduc
      22             :     USE m_wann_kptsreduc2
      23             :     USE m_wann_wan90prep
      24             :     USE m_wann_dipole3
      25             :     USE m_wann_dipole
      26             :     USE m_wann_convert_fleur_w90
      27             : 
      28             :     IMPLICIT NONE
      29             : 
      30             :     TYPE(t_input),     INTENT(IN)    :: input
      31             :     TYPE(t_kpts),      INTENT(IN)    :: kpts
      32             :     TYPE(t_atoms),     INTENT(IN)    :: atoms
      33             :     TYPE(t_sym),       INTENT(IN)    :: sym
      34             :     TYPE(t_cell),      INTENT(IN)    :: cell
      35             :     TYPE(t_oneD),      INTENT(IN)    :: oneD
      36             :     TYPE(t_noco),      INTENT(IN)    :: noco
      37             :     TYPE(t_wann),      INTENT(INOUT) :: wann
      38             : 
      39             :     INTEGER       :: num_wann(2)
      40             :     LOGICAL       :: l_nocosoc
      41             : 
      42           0 :     l_nocosoc=noco%l_noco.OR.noco%l_soc
      43             : 
      44             :     !-----read the input file to determine what to do
      45           0 :     CALL wann_read_inp(input,.TRUE.,wann)
      46             : 
      47             :     !-----generate projection-definition-file
      48           0 :     IF(wann%l_projgen) THEN
      49           0 :        CALL wann_projgen(atoms%ntype,atoms%neq,atoms%nat,atoms%zatom,l_nocosoc,wann)
      50           0 :        wann%l_stopopt=.TRUE.
      51             :     ENDIF
      52             : 
      53             :     !-----generate k-point-files
      54           0 :     IF(wann%l_kpointgen) THEN
      55           0 :        CALL wann_kpointgen()
      56           0 :        wann%l_stopopt=.TRUE.
      57             :     ENDIF
      58           0 :     IF(wann%l_w90kpointgen) THEN
      59           0 :        CALL wann_w90kpointgen()
      60           0 :        wann%l_stopopt=.TRUE.
      61             :     ENDIF
      62             : 
      63             :     !-----find Wannier-irreducible part of BZ
      64           0 :     IF(wann%l_kptsreduc)THEN
      65           0 :        CALL wann_kptsreduc(sym%nop,sym%mrot,cell%bmat,sym%tau,input%film, oneD%odi%d1,l_nocosoc)
      66           0 :        wann%l_stopopt=.TRUE.
      67             :     ENDIF
      68             : 
      69             :     !-----find Wannier-irreducible part of BZ
      70           0 :     IF(wann%l_kptsreduc2)THEN
      71           0 :        CALL wann_kptsreduc2(wann%mhp, sym%nop,sym%mrot,cell%bmat,sym%tau,input%film, oneD%odi%d1,l_nocosoc)
      72           0 :        wann%l_stopopt=.TRUE.
      73             :     ENDIF
      74             : 
      75             :     !-----generate WF1.win and bkpts
      76           0 :     IF(wann%l_prepwan90)THEN
      77             :        CALL wann_wan90prep(input,kpts, input%jspins,cell%amat,cell%bmat, atoms%nat,atoms%taual,&
      78             :             atoms%zatom,atoms%ntype, atoms%ntype,atoms%neq,wann%l_bzsym,input%film, oneD%odi%d1,&
      79             :             wann%l_ms,wann%l_sgwf,wann%l_socgwf, wann%aux_latt_const,wann%param_file,wann%l_dim, &
      80           0 :             wann%wan90version)
      81             :     ENDIF
      82             : 
      83             :     !-----calculate polarization, if not wannierize
      84             :     !-----if wannierize, then calculate polarization later (after wannierize)
      85           0 :     IF(wann%l_dipole3.AND..NOT.wann%l_wannierize)THEN
      86           0 :        num_wann(1)=wann%band_max(1)-wann%band_min(1)+1
      87           0 :        num_wann(2)=wann%band_max(2)-wann%band_min(2)+1
      88             :        CALL wann_dipole3(input%jspins,cell%omtil,atoms%nat,atoms%pos, cell%amat,cell%bmat,atoms%taual,&
      89           0 :             num_wann, atoms%ntype,atoms%neq,atoms%zatom,l_nocosoc)
      90           0 :        wann%l_stopopt=.TRUE.
      91             :     ENDIF
      92             : 
      93             :     !-----calculate polarization, if not wannierize
      94             :     !-----if wannierize, then calculate polarization later (after wannierize)
      95           0 :     IF(wann%l_dipole.AND..NOT.wann%l_wannierize)THEN
      96             :        CALL wann_dipole(input%jspins,cell%omtil,atoms%nat,atoms%pos, cell%amat,atoms%ntype,&
      97           0 :             atoms%neq,atoms%zatom)
      98           0 :        wann%l_stopopt=.TRUE.
      99             :     ENDIF
     100             : 
     101             : 
     102             :     !---- convert files from fleur-format to wannier90 format
     103             :       IF(wann%l_mmn0_unf_to_spn_unf.or. &
     104             :        wann%l_mmn0_to_spn_unf.or. &
     105             :        wann%l_mmn0_to_spn.or. &
     106             :        wann%l_mmn0_to_spn2.or. &
     107             :        wann%l_mmn0_unf_to_spn.or. &
     108             : 
     109             :        wann%l_perpmag_unf_to_tor_unf.or. &
     110             :        wann%l_perpmag_to_tor_unf.or. &
     111             :        wann%l_perpmag_to_tor.or. &
     112             :        wann%l_perpmag_unf_to_tor.or. &
     113             : 
     114             :       wann%l_hsomtxvec_unf_to_lmpzsoc_unf.or. &
     115             :       wann%l_hsomtxvec_to_lmpzsoc_unf.or. &
     116           0 :       wann%l_hsomtxvec_to_lmpzsoc.or. &
     117             :       wann%l_hsomtxvec_unf_to_lmpzsoc)then
     118             : 
     119           0 :          call wann_convert_fleur_w90(input%jspins,l_nocosoc,wann)
     120             : 
     121           0 :          wann%l_stopopt=.true.
     122             :     ENDIF
     123             : 
     124             : 
     125           0 :     IF(wann%l_stopopt)  CALL juDFT_end("wann_optional done",1) ! The 1 is temporarily. Should be mpi%irank.
     126             : 
     127           0 :   END SUBROUTINE wann_optional
     128             : END MODULE m_wann_optional

Generated by: LCOV version 1.13