Commit 0b3fa89c authored by Marco Govoni's avatar Marco Govoni
Browse files

Removed variable igq_l2g_kdip from module. Made local to pdep_io.

parent 94a7c9d5
......@@ -17,7 +17,7 @@ MODULE pdep_io
USE kinds, ONLY : DP
USE mp_global, ONLY : me_bgrp,root_bgrp,nproc_bgrp,intra_bgrp_comm,my_pool_id,my_bgrp_id,inter_bgrp_comm,inter_pool_comm,&
& intra_pool_comm
USE westcom, ONLY : npwq, npwq_g, npwqx, ngq, ngq_g, npwqx, igq_l2g_kdip
USE westcom, ONLY : npwq, npwq_g, npwqx, ngq, ngq_g, npwqx !, igq_l2g_kdip
USE gvect, ONLY : ig_l2g
USE json_module, ONLY : json_file
USE base64_module
......@@ -50,6 +50,8 @@ MODULE pdep_io
CHARACTER(LEN=:),ALLOCATABLE :: charbase64
INTEGER :: nbytes, ndim, igwx, iunit, nlen
CHARACTER(LEN=30) :: endian
INTEGER :: npwqx_g
INTEGER, ALLOCATABLE :: igq_l2g_kdip(:), igq_l2g(:)
!
!
IF (PRESENT(iq)) THEN
......@@ -57,14 +59,31 @@ MODULE pdep_io
! Resume all components
!
ndim = ngq_g(iq)
npwq_g = MAXVAL(igq_l2g_kdip(1:ndim,iq))
!
! <NEW>
!
npwqx_g = MAXVAL( ngq_g(:) )
ALLOCATE( igq_l2g_kdip(npwqx_g) )
igq_l2g_kdip(:) = 0
!
ALLOCATE( igq_l2g(ngq(iq)) )
DO ig = 1, ngq(iq)
igq_l2g(ig) = ig_l2g( igq_q(ig,iq) )
ENDDO
CALL gq_l2gmap_kdip( npwq_g, ngq_g(iq), ngq(iq), igq_l2g, igq_l2g_kdip )
DEALLOCATE( igq_l2g )
!
! </NEW>
!
! npwq_g = MAXVAL(igq_l2g_kdip(1:ndim,iq))
! CALL mp_max(npwq_g,intra_pool_comm)
CALL mp_max(npwq_g,intra_bgrp_comm)
! CALL mp_max(npwq_g,intra_bgrp_comm)
!
ALLOCATE( tmp_vec(npwq_g) )
tmp_vec=0._DP
!
CALL mergewf( pdepg(:), tmp_vec, npwq, igq_l2g_kdip(:,iq), me_bgrp, nproc_bgrp, root_bgrp, intra_bgrp_comm)
CALL mergewf( pdepg(:), tmp_vec, npwq, igq_l2g_kdip, me_bgrp, nproc_bgrp, root_bgrp, intra_bgrp_comm)
DEALLOCATE( igq_l2g_kdip )
!
! ONLY ROOT W/IN BGRP WRITES
!
......@@ -169,15 +188,17 @@ MODULE pdep_io
CHARACTER(LEN=:),ALLOCATABLE :: endian
INTEGER :: nbytes, ndim, igwx, iunit, nlen
LOGICAL :: found, isle
INTEGER :: npwqx_g
INTEGER, ALLOCATABLE :: igq_l2g_kdip(:), igq_l2g(:)
!
IF ( PRESENT(iq) ) THEN
!
! Resume all components
!
ndim = ngq_g(iq)
npwq_g = MAXVAL(igq_l2g_kdip(1:ndim,iq))
! npwq_g = MAXVAL(igq_l2g_kdip(1:ndim,iq))
! CALL mp_max(npwq_g,intra_pool_comm)
CALL mp_max(npwq_g,intra_bgrp_comm)
! CALL mp_max(npwq_g,intra_bgrp_comm)
!
ALLOCATE( tmp_vec(npwq_g) )
tmp_vec=0._DP
......@@ -211,7 +232,24 @@ MODULE pdep_io
!
END IF
!
CALL splitwf( pdepg, tmp_vec, npwq, igq_l2g_kdip(:,iq), me_bgrp, nproc_bgrp, root_bgrp, intra_bgrp_comm)
!
! <NEW>
!
npwqx_g = MAXVAL( ngq_g(:) )
ALLOCATE( igq_l2g_kdip(npwqx_g) )
igq_l2g_kdip(:) = 0
!
ALLOCATE( igq_l2g(ngq(iq)) )
DO ig = 1, ngq(iq)
igq_l2g(ig) = ig_l2g( igq_q(ig,iq) )
ENDDO
CALL gq_l2gmap_kdip( npwq_g, ngq_g(iq), ngq(iq), igq_l2g, igq_l2g_kdip )
DEALLOCATE( igq_l2g )
!
! </NEW>
!
CALL splitwf( pdepg, tmp_vec, npwq, igq_l2g_kdip, me_bgrp, nproc_bgrp, root_bgrp, intra_bgrp_comm)
DEALLOCATE( igq_l2g_kdip )
!
ENDIF
!
......
......@@ -39,7 +39,7 @@ MODULE scratch_area
INTEGER, ALLOCATABLE :: igq_q(:,:) ! equivalent of igk_k(:,:) --> ex. igq_q(ig,iq) = map for FFT (global in iq )
INTEGER, ALLOCATABLE :: ngq_g(:) ! equivalent of ngk_g(:) --> ex. ngk_g(iq) = TOTAL number of PW for (q+G) (global in iq)
! INTEGER, ALLOCATABLE :: igq_l2g(:,:) ! equivalent of igk_l2g(:,:) --> ex. iqq_l2g(ig,iq) => correspondence between the local (q+G) index and the global G index
INTEGER, ALLOCATABLE :: igq_l2g_kdip(:,:) ! equivalent of igk_l2g_kdip(:,:) --> ex. iqq_l2g_kdip(ig,iq) => correspondence between the global order of (q+G) and the local index for (q+G).
! INTEGER, ALLOCATABLE :: igq_l2g_kdip(:,:) ! equivalent of igk_l2g_kdip(:,:) --> ex. iqq_l2g_kdip(ig,iq) => correspondence between the global order of (q+G) and the local index for (q+G).
!
! EPSILON
REAL(DP),ALLOCATABLE :: d_epsm1_ifr(:,:,:)
......
......@@ -15,8 +15,7 @@ SUBROUTINE set_npwq()
!-----------------------------------------------------------------------
!
USE kinds, ONLY : DP
USE westcom, ONLY : npwq,npwq_g,npwqx,ngq,ngq_g,igq_q, &
& l_use_ecutrho,fftdriver
USE westcom, ONLY : npwq,npwq_g,npwqx,ngq,ngq_g,igq_q,l_use_ecutrho,fftdriver
USE mp, ONLY : mp_max, mp_sum
USE mp_global, ONLY : intra_bgrp_comm, inter_bgrp_comm, nbgrp, inter_pool_comm, intra_pool_comm
USE gvect, ONLY : ig_l2g,ngm,ngmx,g
......@@ -33,8 +32,8 @@ SUBROUTINE set_npwq()
INTEGER, EXTERNAL :: n_plane_waves
REAL(DP), ALLOCATABLE :: gq2kin(:)
INTEGER :: iq, ig
INTEGER :: npwqx_g
INTEGER, ALLOCATABLE :: igq_l2g(:)
! INTEGER :: npwqx_g
! INTEGER, ALLOCATABLE :: igq_l2g(:)
!
IF ( gamma_only ) THEN
!
......@@ -79,10 +78,10 @@ SUBROUTINE set_npwq()
!
ngq_g = 0
ngq_g(:) = ngq(:)
CALL mp_sum( ngq_g, inter_bgrp_comm )
!CALL mp_sum( ngq_g, inter_pool_comm )
!CALL mp_sum( ngq_g, intra_pool_comm )
CALL mp_sum( ngq_g, intra_bgrp_comm )
!
ngq_g = ngq_g / nbgrp
!ngq_g = ngq_g / nbgrp
!
! ... compute the maximum G vector index among all q+G in processors
!
......@@ -94,31 +93,32 @@ SUBROUTINE set_npwq()
ENDDO
!npwq_g = MAXVAL( igq_l2g(:,:) )
!
CALL mp_max( npwq_g, inter_bgrp_comm )
!CALL mp_max( npwq_g, intra_pool_comm )
CALL mp_max( npwq_g, intra_bgrp_comm )
!
! ... compute the maximum number of G vectors among all q-points
!
npwqx_g = MAXVAL( ngq_g(1:q_grid%nps) )
! npwqx_g = MAXVAL( ngq_g(1:q_grid%nps) )
!
! ... define a further l2g map
!
ALLOCATE( igq_l2g_kdip(npwqx_g, q_grid%nps) )
igq_l2g_kdip(:,:) = 0
!
DO iq = 1, q_grid%nps
ALLOCATE( igq_l2g(ngq(iq)) )
DO ig = 1, ngq(iq)
igq_l2g(ig) = ig_l2g( igq_q(ig,iq) )
ENDDO
CALL gq_l2gmap_kdip( npwq_g, ngq_g(iq), ngq(iq), igq_l2g, igq_l2g_kdip(1,iq) )
DEALLOCATE( igq_l2g )
ENDDO
! ALLOCATE( igq_l2g_kdip(npwqx_g, q_grid%nps) )
! igq_l2g_kdip(:,:) = 0
! !
! DO iq = 1, q_grid%nps
! ALLOCATE( igq_l2g(ngq(iq)) )
! DO ig = 1, ngq(iq)
! igq_l2g(ig) = ig_l2g( igq_q(ig,iq) )
! ENDDO
! CALL gq_l2gmap_kdip( npwq_g, ngq_g(iq), ngq(iq), igq_l2g, igq_l2g_kdip(1,iq) )
! DEALLOCATE( igq_l2g )
! ENDDO
!
ENDIF
!
END SUBROUTINE
!
!
!----------------------------------------------------------------------------
SUBROUTINE gq_sort( q, ngm, g, ecut, ngq, igq, gq )
!----------------------------------------------------------------------------
......@@ -263,7 +263,6 @@ SUBROUTINE gq_l2gmap_kdip( npw_g, ngk_g, ngk, igk_l2g, igk_l2g_kdip )
ngg = ngg + 1
!
igwk_(ngg) = ig
!
END IF
!
......
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