Commit 655f3b47 authored by Samuel Poncé's avatar Samuel Poncé

Merge branch 'develop' into 'develop'

Optimization of the IBTE symmetry printing routines.

See merge request !206
parents cf871260 e52fa60d
......@@ -18,8 +18,9 @@ SUBROUTINE kpoint_grid_epw ( nrot, time_reversal, skip_equivalence, s, t_rev, &
USE kinds, ONLY: DP
IMPLICIT NONE
!
INTEGER, INTENT(in) :: nrot, npk, nk1, nk2, nk3, &
t_rev(48), s(3,3,48)
INTEGER, INTENT(in) :: nrot
!! Number of Bravais symmetry
INTEGER, INTENT(in) :: npk, nk1, nk2, nk3, t_rev(48), s(3,3,48)
INTEGER, INTENT(inout) :: s_BZtoIBZ(3,3,nk1*nk2*nk3)
!! Symeetry matrix that links an point to its IBZ friend.
INTEGER, INTENT(inout) :: BZtoIBZ (nk1*nk2*nk3)
......
......@@ -247,7 +247,7 @@
!
!
!-----------------------------------------------------------------------
SUBROUTINE print_serta_sym( F_SERTA, BZtoIBZ, s_BZtoIBZ, vkk_all, etf_all, wkf_all, ef0)
SUBROUTINE print_serta_sym( F_SERTA, BZtoIBZ, s_BZtoIBZ, BZtoIBZ_mat, vkk_all, etf_all, wkf_all, ef0)
!-----------------------------------------------------------------------
!!
!! This subroutine prints the SERTA mobility using k-point symmetry.
......@@ -261,7 +261,8 @@
USE elph2, ONLY : nkf, ibndmax, ibndmin, nkqtotf
USE transportcom, ONLY : lower_bnd, transp_temp
USE constants_epw, ONLY : zero, two, pi, kelvin2eV, ryd2ev, eps10, &
electron_SI, bohr2ang, ang2cm, hbarJ
electron_SI, bohr2ang, ang2cm, hbarJ
USE symm_base, ONLY : nrot
USE noncollin_module, ONLY : noncolin
USE mp_global, ONLY : world_comm, my_pool_id
USE mp, ONLY : mp_sum
......@@ -272,6 +273,8 @@
!! BZ to IBZ mapping
INTEGER, INTENT(in) :: s_BZtoIBZ(3,3,nkf1*nkf2*nkf3)
!! Corresponding symmetry matrix
INTEGER, INTENT(in) :: BZtoIBZ_mat(nrot,nkqtotf/2)
!! For a given k-point from the IBZ, given the index of all k from full BZ
REAL(kind=DP), INTENT(in) :: F_SERTA(3, ibndmax-ibndmin+1, nkqtotf/2, nstemp)
!! SERTA solution
REAL(KIND=DP), INTENT(IN) :: vkk_all(3,ibndmax-ibndmin+1,nkqtotf/2)
......@@ -365,11 +368,12 @@
tdf_sigma(:) = zero
vk_cart(:) = vkk_all(:,ibnd, ik)
Fi_cart(:) = F_SERTA(:, ibnd, ik, itemp)
! Loop on full BZ
nb = 0
DO ikbz=1, nkf1*nkf2*nkf3
IF (BZtoIBZ(ikbz) == ik) THEN
nb = nb + 1
!
! Loop on the point equivalent by symmetry in the full BZ
DO nb=1, nrot
IF (BZtoIBZ_mat(nb,ik) > 0 ) THEN
ikbz = BZtoIBZ_mat(nb,ik)
!
! Transform the symmetry matrix from Crystal to
! cartesian
sa (:,:) = dble ( s_BZtoIBZ(:,:,ikbz) )
......@@ -481,11 +485,11 @@
tdf_sigma(:) = zero
vk_cart(:) = vkk_all(:,ibnd, ik)
Fi_cart(:) = F_SERTA(:, ibnd, ik, itemp)
! Loop on full BZ
nb = 0
DO ikbz=1, nkf1*nkf2*nkf3
IF (BZtoIBZ(ikbz) == ik) THEN
nb = nb + 1
!
! Loop on the point equivalent by symmetry in the full BZ
DO nb=1, nrot
IF (BZtoIBZ_mat(nb,ik) > 0 ) THEN
ikbz = BZtoIBZ_mat(nb,ik)
! Transform the symmetry matrix from Crystal to
! cartesian
sa (:,:) = dble ( s_BZtoIBZ(:,:,ikbz) )
......@@ -839,7 +843,7 @@
!-----------------------------------------------------------------------
!
!-----------------------------------------------------------------------
SUBROUTINE print_mob_sym( F_out, BZtoIBZ, s_BZtoIBZ, vkk_all, etf_all, wkf_all, ef0, av_mob)
SUBROUTINE print_mob_sym( F_out, BZtoIBZ, s_BZtoIBZ, BZtoIBZ_mat, vkk_all, etf_all, wkf_all, ef0, av_mob)
!-----------------------------------------------------------------------
!!
!! This subroutine prints the mobility using k-point symmetry ( electron or hole )
......@@ -853,7 +857,8 @@
USE elph2, ONLY : nkf, ibndmax, ibndmin, nkqtotf
USE transportcom, ONLY : lower_bnd, transp_temp
USE constants_epw, ONLY : zero, two, pi, kelvin2eV, ryd2ev, eps10, &
electron_SI, bohr2ang, ang2cm, hbarJ
electron_SI, bohr2ang, ang2cm, hbarJ
USE symm_base, ONLY : nrot
USE noncollin_module, ONLY : noncolin
USE mp_global, ONLY : world_comm
USE mp, ONLY : mp_sum
......@@ -864,6 +869,8 @@
!! BZ to IBZ mapping
INTEGER, INTENT(in) :: s_BZtoIBZ(3,3,nkf1*nkf2*nkf3)
!! Corresponding symmetry matrix
INTEGER, INTENT(in) :: BZtoIBZ_mat(nrot,nkqtotf/2)
!! For a given k-point from the IBZ, given the index of all k from full BZ
REAL(kind=DP), INTENT(in) :: F_out(3, ibndmax-ibndmin+1, nkqtotf/2, nstemp)
!! SERTA solution
REAL(KIND=DP), INTENT(IN) :: vkk_all(3,ibndmax-ibndmin+1,nkqtotf/2)
......@@ -959,11 +966,12 @@
tdf_sigma(:) = zero
vk_cart(:) = vkk_all(:,ibnd, ik)
Fi_cart(:) = F_out(:, ibnd, ik, itemp)
! Loop on full BZ
nb = 0
DO ikbz=1, nkf1*nkf2*nkf3
IF (BZtoIBZ(ikbz) == ik) THEN
nb = nb + 1
!
! Loop on the point equivalent by symmetry in the full BZ
DO nb=1, nrot
IF (BZtoIBZ_mat(nb,ik) > 0 ) THEN
ikbz = BZtoIBZ_mat(nb,ik)
!
! Transform the symmetry matrix from Crystal to
! cartesian
sa (:,:) = dble ( s_BZtoIBZ(:,:,ikbz) )
......@@ -1069,11 +1077,12 @@
tdf_sigma(:) = zero
vk_cart(:) = vkk_all(:, ibnd, ik)
Fi_cart(:) = F_out(:, ibnd, ik, itemp)
! Loop on full BZ
nb = 0
DO ikbz=1, nkf1*nkf2*nkf3
IF (BZtoIBZ(ikbz) == ik) THEN
nb = nb + 1
!
! Loop on the point equivalent by symmetry in the full BZ
DO nb=1, nrot
IF (BZtoIBZ_mat(nb,ik) > 0 ) THEN
ikbz = BZtoIBZ_mat(nb,ik)
!
! Transform the symmetry matrix from Crystal to
! cartesian
sa (:,:) = dble ( s_BZtoIBZ(:,:,ikbz) )
......
......@@ -121,7 +121,13 @@
INTEGER :: BZtoIBZ(nkf1*nkf2*nkf3)
!! BZ to IBZ mapping
INTEGER :: s_BZtoIBZ(3,3,nkf1*nkf2*nkf3)
!! symmetry
!! symmetry matrix for each k-point from the full BZ
INTEGER :: BZtoIBZ_mat(nrot,nkqtotf/2)
!! For a given k-point in the IBZ gives the k-point index
!! of all the k-point in the full BZ that are connected to the current
!! one by symmetry. nrot is the max number of symmetry
INTEGER :: nsym(nkqtotf/2)
!! Temporary matrix used to count how many symmetry for that k-point
INTEGER :: n
!! Use for averaging
!
......@@ -178,16 +184,20 @@
! print*,'nind ',nind
! print*,'allocated ',ALLOCATED(ixkqf_tr)
! print*,'allocated s_BZtoIBZ_full',ALLOCATED(s_BZtoIBZ_full)
! Deal with symmetries
IF (mp_mesh_k) THEN
ALLOCATE(ixkqf_tr(nind), STAT=ierr)
ALLOCATE(s_BZtoIBZ_full(3,3,nind), STAT=ierr)
! For a given k-point in the IBZ gives the k-point index
! of all the k-point in the full BZ that are connected to the current
! one by symmetry. nrot is the max number of symmetry
BZtoIBZ(:) = 0
s_BZtoIBZ(:,:,:) = 0
ixkqf_tr(:) = 0
!call move_alloc(test1, s_BZtoIBZ_full)
s_BZtoIBZ_full(:,:,:) = 0
BZtoIBZ_mat(:,:) = 0
nsym(:) = 0
!
IF ( mpime .eq. ionode_id ) THEN
!
......@@ -203,9 +213,18 @@
ENDDO
BZtoIBZ(:) = BZtoIBZ_tmp(:)
!
! Now create the mapping matrix
DO ikbz=1, nkf1*nkf2*nkf3
ik = BZtoIBZ(ikbz)
nsym(ik) = nsym(ik) + 1
BZtoIBZ_mat( nsym(ik), ik) = ikbz
ENDDO
!
ENDIF ! mpime
CALL mp_bcast( s_BZtoIBZ, ionode_id, inter_pool_comm )
CALL mp_bcast( BZtoIBZ, ionode_id, inter_pool_comm )
!
CALL mp_bcast( s_BZtoIBZ, ionode_id, inter_pool_comm )
CALL mp_bcast( BZtoIBZ, ionode_id, inter_pool_comm )
CALL mp_bcast( BZtoIBZ_mat, ionode_id, inter_pool_comm )
!
DO ind=1, nind
iq = sparse_q( ind )
......@@ -290,7 +309,7 @@
! Now compute and print the electron and hole mobility of SERTA
IF (mp_mesh_k) THEN
! Use k-point symmetry
CALL print_serta_sym(F_SERTA, BZtoIBZ, s_BZtoIBZ, vkk_all, etf_all, wkf_all, ef0)
CALL print_serta_sym(F_SERTA, BZtoIBZ, s_BZtoIBZ, BZtoIBZ_mat, vkk_all, etf_all, wkf_all, ef0)
ELSE
! No symmetry
CALL print_serta(F_SERTA, vkk_all, etf_all, wkf_all, ef0)
......@@ -392,7 +411,7 @@
ENDDO
!
IF (mp_mesh_k) THEN
CALL print_mob_sym(F_out, BZtoIBZ, s_BZtoIBZ, vkk_all, etf_all, wkf_all, ef0, av_mob)
CALL print_mob_sym(F_out, BZtoIBZ, s_BZtoIBZ, BZtoIBZ_mat, vkk_all, etf_all, wkf_all, ef0, av_mob)
ELSE
CALL print_mob(F_out, vkk_all, etf_all, wkf_all, ef0, av_mob)
ENDIF
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment