~ubuntu-branches/debian/sid/abinit/sid

« back to all changes in this revision

Viewing changes to src/15gw/findkp.F90

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme
  • Date: 2007-09-14 13:05:00 UTC
  • Revision ID: james.westby@ubuntu.com-20070914130500-1kzh2mrgo6ir4b6i
Tags: upstream-5.3.4.dfsg
ImportĀ upstreamĀ versionĀ 5.3.4.dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
!{\src2tex{textfont=tt}}
 
2
!!****f* ABINIT/findkp
 
3
!! NAME
 
4
!! findkp
 
5
!!
 
6
!! FUNCTION
 
7
!! Check if the k-point is in the set of the kbz
 
8
!! (subtracting the reciprocal vector g0)
 
9
!! and return the index number and the reciprocal vector g0
 
10
!!
 
11
!! COPYRIGHT
 
12
!! Copyright (C) 1999-2007 ABINIT group (GMR, VO, LR, RWG)
 
13
!! This file is distributed under the terms of the
 
14
!! GNU General Public License, see ~abinit/COPYING
 
15
!! or http://www.gnu.org/copyleft/gpl.txt .
 
16
!! For the initials of contributors, see ~abinit/doc/developers/contributors.txt .
 
17
!!
 
18
!! PARENTS
 
19
!!
 
20
!! INPUTS
 
21
!!  k(3)=k point to be found in the BZ
 
22
!!  kbz(3,nkbz)=coordinates of k points in BZ
 
23
!!  nkbz=number of k points in BZ
 
24
!!
 
25
!! OUTPUT
 
26
!!  logical function findkp= 1 if found
 
27
!!  ik=index of the k opint in BZ
 
28
!!  g0=reciprocal vector to be subtracted
 
29
!!
 
30
!! SOURCE
 
31
 
 
32
#if defined HAVE_CONFIG_H
 
33
#include "config.h"
 
34
#endif
 
35
 
 
36
logical function findkp(nkbz,kbz,ik,k,g0)
 
37
 
 
38
 use defs_basis
 
39
 
 
40
!This section has been created automatically by the script Abilint (TD). Do not modify these by hand.
 
41
#ifdef HAVE_FORTRAN_INTERFACES
 
42
 use interfaces_15gw, except_this_one => findkp
 
43
#endif
 
44
!End of the abilint section
 
45
 
 
46
 implicit none
 
47
 
 
48
!Arguments ------------------------------------
 
49
!scalars
 
50
 integer,intent(in) :: nkbz
 
51
 integer,intent(out) :: ik
 
52
!arrays
 
53
 integer,intent(out) :: g0(3)
 
54
 real(dp),intent(in) :: k(3),kbz(3,nkbz)
 
55
 
 
56
!Local variables ------------------------------
 
57
!scalars
 
58
 integer :: ig1,ig2,ig3,ikp
 
59
 logical :: yetfound
 
60
!arrays
 
61
 real(dp) :: kdiff(3),kp(3)
 
62
 
 
63
! *************************************************************************
 
64
!This section has been created automatically by the script Abilint (TD). Do not modify these by hand.
 
65
#ifndef HAVE_FORTRAN_INTERFACES
 
66
 integer :: itst0
 
67
#endif
 
68
!End of the abilint section
 
69
 
 
70
 yetfound=.false.
 
71
 ik=0 ; g0(:)=0
 
72
 do ikp=1,nkbz
 
73
   kp(:)=kbz(:,ikp)
 
74
!  compute kdiff=k''-k+G0
 
75
   do ig1=-2,2
 
76
     kdiff=kp(1)-k(1)+ig1
 
77
     do ig2=-2,2
 
78
       kdiff(2)=kp(2)-k(2)+ig2
 
79
       do ig3=-2,2
 
80
         kdiff(3)=kp(3)-k(3)+ig3
 
81
!        check if kdiff=k''-k+G0 is null
 
82
         if(itst0(kdiff)==1) then
 
83
!          check if k has been yet found
 
84
           if(yetfound) then
 
85
             write(6,*) '**error,findkp 1: kp yet found'
 
86
             write(6,*) k
 
87
             write(6,*) ik,kbz(:,ik),g0
 
88
             write(6,*) ikp,kbz(:,ikp),ig1,ig2,ig3
 
89
             stop 'kp yet found'
 
90
           end if
 
91
           yetfound=.true.
 
92
           ik=ikp
 
93
           g0(1)=ig1
 
94
           g0(2)=ig2
 
95
           g0(3)=ig3
 
96
         end if
 
97
       end do
 
98
     end do
 
99
   end do
 
100
 end do
 
101
 findkp=yetfound
 
102
 return
 
103
 end function findkp
 
104
!!***