Line data Source code
1 : MODULE m_hyb_abcrot
2 : CONTAINS
3 112 : SUBROUTINE hyb_abcrot(hybinp, atoms, neig, sym,&
4 112 : acof, bcof, ccof)
5 : ! ***************************************************************
6 : ! * This routine transforms a/b/cof which are given wrt rotated *
7 : ! * MT functions (according to invsat/ngopr) into a/b/cof wrt *
8 : ! * unrotated MT functions. Needed for GW calculations. *
9 : ! * *
10 : ! * Christoph Friedrich Mar/2005 *
11 : ! ***************************************************************
12 : USE m_types
13 : USE m_juDFT
14 : IMPLICIT NONE
15 : TYPE(t_hybinp), INTENT(IN) :: hybinp
16 : TYPE(t_sym), INTENT(IN) :: sym
17 : TYPE(t_atoms), INTENT(IN) :: atoms
18 : INTEGER, INTENT(IN) :: neig
19 :
20 : COMPLEX, INTENT(INOUT) :: acof(:, 0:, :) !(input%neig,0:atoms%lmaxd*(atoms%lmaxd+2),atoms%natd)
21 : COMPLEX, INTENT(INOUT) :: bcof(:, 0:, :) !(input%neig,0:atoms%lmaxd*(atoms%lmaxd+2),atoms%natd)
22 : COMPLEX, INTENT(INOUT) :: ccof(-atoms%llod:, :, :, :)!(-llod:llod,input%neig,atoms%nlod,atoms%natd)
23 : INTEGER itype, ineq, iatom, iop, ilo, i, l, ifac
24 112 : call timestart("hyb_abcrot")
25 112 : IF (.NOT. ALLOCATED(hybinp%d_wgn2)) THEN !calculate sym%d_wgn only once
26 0 : PRINT *, "calculate wigner-matrix"
27 0 : call judft_error('WIGNER MATRIX should be available in hybinp part')
28 : ENDIF
29 :
30 : !$OMP PARALLEL DO default(none) private(iatom, itype, iop, ifac, l, i, ilo) &
31 112 : !$OMP shared(atoms, sym, acof, bcof, ccof, neig, hybinp)
32 : do iatom = 1, atoms%nat
33 : itype = atoms%itype(iatom)
34 : iop = sym%ngopr(iatom)
35 : ! l l l
36 : ! inversion of spherical harmonics: Y (pi-theta,pi+phi) = (-1) * Y (theta,phi)
37 : ! m m
38 : ifac = 1
39 : IF (sym%invsat(iatom) == 2) THEN
40 : iop = sym%ngopr(sym%invsatnr(iatom))
41 :
42 : ifac = -1
43 : ENDIF
44 : DO l = 1, atoms%lmax(itype)
45 : DO i = 1, neig
46 : acof(i, l**2:l*(l + 2), iatom) = ifac**l*matmul(conjg(hybinp%d_wgn2(-l:l, -l:l, l, iop)),acof(i, l**2:l*(l + 2), iatom))
47 : bcof(i, l**2:l*(l + 2), iatom) = ifac**l*matmul(conjg(hybinp%d_wgn2(-l:l, -l:l, l, iop)),bcof(i, l**2:l*(l + 2), iatom))
48 : ENDDO
49 : ENDDO
50 : DO ilo = 1, atoms%nlo(itype)
51 : l = atoms%llo(ilo, itype)
52 : IF (l > 0) THEN
53 : DO i = 1, neig
54 : ccof(-l:l, i, ilo, iatom) = ifac**l*matmul(conjg(hybinp%d_wgn2(-l:l, -l:l, l, iop)), ccof(-l:l, i, ilo, iatom))
55 : ENDDO
56 : ENDIF
57 : ENDDO
58 : ENDDO
59 : !$OMP end parallel do
60 112 : call timestop("hyb_abcrot")
61 112 : END SUBROUTINE hyb_abcrot
62 : END MODULE m_hyb_abcrot
|