make_sym.f90 2.26 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
 !--------------------------------------------------------------------------------
! 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.
!--------------------------------------------------------------------------------
MODULE m_make_sym
  USE m_judft
  IMPLICIT NONE
  PRIVATE
  PUBLIC make_sym
CONTAINS
  SUBROUTINE make_sym(sym,cell,atoms,noco,oneD,input)
    !Generates missing symmetry info.
    !tau,mrot and nop have to be specified alread
    USE m_dwigner
    USE m_mapatom
    USE m_od_mapatom
18
    use m_ptsym
19 20 21 22 23 24 25 26 27 28 29 30
    USE m_types_sym
    USE m_types_cell
    USE m_types_atoms
    USE m_types_noco
    USE m_types_oneD
    use m_types_input
    TYPE(t_sym),INTENT(INOUT) :: sym
    TYPE(t_cell),INTENT(IN)   :: cell
    TYPE(t_atoms),INTENT(IN)  :: atoms
    TYPE(t_noco),INTENT(IN)   :: noco
    TYPE(t_oneD),INTENT(IN)   :: oneD
    TYPE(t_input),INTENT(IN)  :: input
31 32 33
    
    integer :: nsymt
    integer,allocatable::nrot(:),locops(:,:)
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51

    !Check for additional time-reversal symmetry
    IF( sym%invs .OR. noco%l_soc ) THEN
       sym%nsym = sym%nop
    ELSE
       ! combine time reversal symmetry with the spatial symmetry opera
       ! thus the symmetry operations are doubled
       sym%nsym = 2*sym%nop
    END IF
    
    !Generated wigner symbols for LDA+U
    IF (ALLOCATED(sym%d_wgn)) DEALLOCATE(sym%d_wgn)
    ALLOCATE(sym%d_wgn(-3:3,-3:3,3,sym%nop))
    IF (atoms%n_u.GT.0) THEN
       CALL d_wigner(sym%nop,sym%mrot,cell%bmat,3,sym%d_wgn)
    END IF

    !Atom specific symmetries
52 53 54 55 56 57 58

    allocate(locops(sym%nop,atoms%nat),nrot(atoms%nat))
    allocate(sym%ntypsy(atoms%nat))
    call ptsym(atoms%ntype,atoms%nat,atoms%neq,atoms%taual,sym%nop,sym%mrot,sym%tau,atoms%lmax,&
         nsymt,sym%ntypsy,nrot,locops)


59 60
    IF (.NOT.oneD%odd%d1) THEN
     CALL mapatom(sym,atoms,cell,input,noco)
61
     allocate(oneD%ngopr1(atoms%nat))
62 63 64 65 66 67 68 69 70 71
     oneD%ngopr1 = sym%ngopr
  ELSE
     CALL juDFT_error("The oneD version is broken here. Compare call to mapatom with old version")
     CALL mapatom(sym,atoms,cell,input,noco)
     !CALL od_mapatom(oneD,atoms,sym,cell)
  END IF
 

END SUBROUTINE make_sym
END MODULE m_make_sym