-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathjget.f90
46 lines (35 loc) · 937 Bytes
/
jget.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
! The code was developed at the Fritz Haber Institute, and
! the intellectual properties and copyright of this file
! are with the Max Planck Society. When you use it, please
! cite R. Gomez-Abal, X. Li, C. Ambrosch-Draxl, M. Scheffler,
! Extended linear tetrahedron method for the calculation of q-dependent
! dynamical response functions, to be published in Comp. Phys. Commun. (2010)
!bop
!
! !FUNCTION: jget
!
! !INTERFACE:
integer(4) function jget(a,ind)
! !DESCRIPTION:
!
! Reads the value of the bit ind of vector a
!
! !ARGUMENTS:
implicit none
integer(4), intent(in) :: a(*)
integer(4), intent(in) :: ind
! !RETURN VALUE:
!
! integer(4) :: jget
! !LOCAL VARIABLES:
integer(4) :: i,off
! !SYSTEM ROUTINES:
intrinsic ibits
!EOP
!BOC
i=(ind-1)/32+1
off=mod(ind-1,32)
jget=ibits(a(i),off,1)
return
end function jget
!EOC