LCOV - code coverage report
Current view: top level - init - make_sym.f90 (source / functions) Hit Total Coverage
Test: FLEUR test coverage Lines: 18 19 94.7 %
Date: 2024-04-27 04:44:07 Functions: 1 1 100.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             : MODULE m_make_sym
       7             :    USE m_judft
       8             :    IMPLICIT NONE
       9             :    PRIVATE
      10             :    PUBLIC make_sym
      11             : CONTAINS
      12          80 :    SUBROUTINE make_sym(sym, cell, atoms, noco,   input, gfinp)
      13             :       !Generates missing symmetry info.
      14             :       !tau,mrot and nop have to be specified alread
      15             :       USE m_dwigner
      16             :       USE m_angles !Phase factors for spin-offdiagonal lda+u
      17             :       USE m_constants
      18             :       USE m_mapatom
      19             :       use m_ptsym
      20             :       USE m_types_sym
      21             :       USE m_types_cell
      22             :       USE m_types_atoms
      23             :       USE m_types_noco
      24             :        
      25             :       use m_types_input
      26             :       USE m_types_gfinp
      27             :       use m_types_fleurinput_base, only: REAL_NOT_INITALIZED, CMPLX_NOT_INITALIZED
      28             :       TYPE(t_sym), INTENT(INOUT) :: sym
      29             :       TYPE(t_cell), INTENT(IN)   :: cell
      30             :       TYPE(t_atoms), INTENT(IN)  :: atoms
      31             :       TYPE(t_noco), INTENT(IN)   :: noco
      32             :        
      33             :       TYPE(t_input), INTENT(IN)  :: input
      34             :       TYPE(t_gfinp), INTENT(IN)  :: gfinp
      35             : 
      36             :       integer :: nsymt
      37          80 :       integer, allocatable::nrot(:), locops(:, :)
      38             : 
      39             :       !Check for additional time-reversal symmetry
      40          80 :       IF (sym%invs .OR. noco%l_soc) THEN
      41          54 :          sym%nsym = sym%nop
      42             :       ELSE
      43             :          ! combine time reversal symmetry with the spatial symmetry opera
      44             :          ! thus the symmetry operations are doubled
      45          26 :          sym%nsym = 2*sym%nop
      46             :       END IF
      47             : 
      48             :       !Generated wigner symbols for LDA+U (includes DFT+HubbardI)
      49          80 :       IF (ALLOCATED(sym%d_wgn)) DEALLOCATE (sym%d_wgn)
      50           0 :       ALLOCATE (sym%d_wgn(-lmaxU_const:lmaxU_const, -lmaxU_const:lmaxU_const, lmaxU_const, sym%nop), &
      51      207672 :                source=CMPLX_NOT_INITALIZED)
      52          80 :       IF (atoms%n_denmat + gfinp%n .GT. 0) THEN !replace with atoms%n_u+gfinp%n
      53             : 
      54          23 :          CALL d_wigner(sym%nop, sym%mrot, cell%bmat, lmaxU_const, sym%d_wgn, write=.TRUE.)
      55             :          !For spin-offdiagonal parts, we need additional phase factors
      56          23 :          IF (noco%l_mperp) THEN
      57           2 :             IF (ALLOCATED(sym%phase)) DEALLOCATE (sym%phase)
      58          10 :             ALLOCATE (sym%phase(sym%nop), source=REAL_NOT_INITALIZED)
      59           2 :             CALL angles(sym)
      60             :          ENDIF
      61             :       END IF
      62             : 
      63             :       !Atom specific symmetries
      64             : 
      65         480 :       allocate (locops(sym%nop, atoms%nat), nrot(atoms%nat))
      66         160 :       if(.not. allocated(sym%ntypsy)) allocate (sym%ntypsy(atoms%nat))
      67             :       call ptsym(atoms%ntype, atoms%nat, atoms%neq, atoms%taual, sym%nop, sym%mrot, sym%tau, atoms%lmax, &
      68          80 :                  nsymt, sym%ntypsy, nrot, locops)
      69             : 
      70          80 :       CALL mapatom(sym, atoms, cell, input, noco,gfinp)
      71             :     
      72         160 :    END SUBROUTINE make_sym
      73             : END MODULE m_make_sym

Generated by: LCOV version 1.14