TABLE OF CONTENTS


ABINIT/getkpgnorm [ Functions ]

[ Top ] [ Functions ]

NAME

 getkpgnorm

FUNCTION

  compute the norms of the k+G vectors

COPYRIGHT

 Copyright (C) 2003-2017 ABINIT group (XG)
 This file is distributed under the terms of the
 GNU General Public License, see ~abinit/COPYING
 or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  gprimd(3,3)=metric tensor
  kg_k(3,npw_k)= G vectors, in reduced coordinates
  kpt(3)=k vector, in reduced coordinates
  npw_k=size of the G-vector set

OUTPUT

  kpgnorm(npw_k)=norms of the k+G vectors

SIDE EFFECTS

NOTES

PARENTS

      m_cut3d,partial_dos_fractions

CHILDREN

SOURCE

 35 #if defined HAVE_CONFIG_H
 36 #include "config.h"
 37 #endif
 38 
 39 #include "abi_common.h"
 40 
 41 
 42 subroutine getkpgnorm(gprimd,kpt,kg_k,kpgnorm,npw_k)
 43 
 44  use defs_basis
 45  use m_profiling_abi
 46 
 47 !This section has been created automatically by the script Abilint (TD).
 48 !Do not modify the following lines by hand.
 49 #undef ABI_FUNC
 50 #define ABI_FUNC 'getkpgnorm'
 51 !End of the abilint section
 52 
 53  implicit none
 54 
 55 !Arguments ------------------------------------
 56 !scalars
 57  integer,intent(in) :: npw_k
 58 !arrays
 59  integer,intent(in) :: kg_k(3,npw_k)
 60  real(dp),intent(in) :: gprimd(3,3),kpt(3)
 61  real(dp),intent(out) :: kpgnorm(npw_k)
 62 
 63 !Local variables-------------------------------
 64 !character(len=500) :: message
 65 !scalars
 66  integer :: ipw
 67  real(dp) :: g11,g12,g13,g21,g22,g23,g31,g32,g33,k1,k2,k3,kpg1,kpg2,kpg3,rr,xx
 68  real(dp) :: yy,zz
 69 
 70 ! *************************************************************************
 71 
 72  k1=kpt(1) ; k2=kpt(2) ; k3=kpt(3)
 73  g11=gprimd(1,1)
 74  g12=gprimd(1,2)
 75  g13=gprimd(1,3)
 76  g21=gprimd(2,1)
 77  g22=gprimd(2,2)
 78  g23=gprimd(2,3)
 79  g31=gprimd(3,1)
 80  g32=gprimd(3,2)
 81  g33=gprimd(3,3)
 82 
 83 !Loop over all k+G
 84  do ipw=1,npw_k
 85 
 86 !  Load k+G
 87    kpg1=k1+dble(kg_k(1,ipw))
 88    kpg2=k2+dble(kg_k(2,ipw))
 89    kpg3=k3+dble(kg_k(3,ipw))
 90 
 91 !  Calculate module of k+G
 92    xx=g11*kpg1+g12*kpg2+g13*kpg3
 93    yy=g21*kpg1+g22*kpg2+g23*kpg3
 94    zz=g31*kpg1+g32*kpg2+g33*kpg3
 95    rr=sqrt(xx**2+yy**2+zz**2)
 96    kpgnorm(ipw) = rr
 97 
 98  end do ! ipw
 99 
100 end subroutine getkpgnorm