set_iks_l2g.f90 1.16 KB
Newer Older
Marco Govoni's avatar
Marco Govoni committed
1
!
2
! Copyright (C) 2015-2017 M. Govoni 
Marco Govoni's avatar
Marco Govoni committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
! This file is distributed under the terms of the
! GNU General Public License. See the file `License'
! in the root directory of the present distribution,
! or http://www.gnu.org/copyleft/gpl.txt .
!
! This file is part of WEST.
!
! Contributors to this file: 
! Marco Govoni
!
!-----------------------------------------------------------------------
SUBROUTINE set_iks_l2g
  !-----------------------------------------------------------------------
  !
  USE kinds,                  ONLY : DP
  USE pwcom,                  ONLY : nks,nkstot
  USE westcom,                ONLY : iks_l2g
  USE mp,                     ONLY : mp_sum
  USE mp_global,              ONLY : inter_pool_comm,npool,my_pool_id
22
  USE types_bz_grid,          ONLY : k_grid
Marco Govoni's avatar
Marco Govoni committed
23
24
25
26
27
28
29
30
31
  !
  IMPLICIT NONE
  !
  INTEGER :: iks, ip, my_offset
  INTEGER :: my_nks(0:npool-1)
  !
  ALLOCATE( iks_l2g(nkstot) )
  !
  my_nks=0
32
  my_nks(my_pool_id) = k_grid%nps
Marco Govoni's avatar
Marco Govoni committed
33
34
35
36
37
38
39
  CALL mp_sum( my_nks, inter_pool_comm )
  !
  my_offset = 0 
  DO ip = 0, my_pool_id-1
     my_offset = my_offset + my_nks(ip)
  ENDDO
  !
40
  DO iks = 1, k_grid%nps
Marco Govoni's avatar
Marco Govoni committed
41
42
43
44
     iks_l2g(iks) = my_offset + iks 
  ENDDO
  !
END SUBROUTINE