2003-01-20 05:58:50 +08:00
|
|
|
!
|
|
|
|
! Copyright (C) 2001 PWSCF group
|
|
|
|
! 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 .
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!-----------------------------------------------------------------------
|
2003-02-08 00:04:36 +08:00
|
|
|
subroutine ccalbec (nkb, npwx, npw, nbnd, bec, vkb, psi)
|
2003-01-20 05:58:50 +08:00
|
|
|
!-----------------------------------------------------------------------
|
|
|
|
!
|
|
|
|
! This subroutine computes the dot product of the beta functions
|
|
|
|
! and the wavefunctions, and save them in the array bec.
|
|
|
|
!
|
|
|
|
#include "machine.h"
|
2004-01-23 23:08:03 +08:00
|
|
|
USE kinds, only: DP
|
2003-02-08 00:04:36 +08:00
|
|
|
implicit none
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
|
|
|
! here the dummy variables
|
|
|
|
!
|
2003-02-08 00:04:36 +08:00
|
|
|
integer :: nkb, npwx, npw, nbnd
|
2003-01-20 05:58:50 +08:00
|
|
|
! input: the total number of beta functions
|
|
|
|
! input: the maximum number of plane waves
|
|
|
|
! input: the length of the vectors
|
|
|
|
! input: the number of bands
|
|
|
|
complex(kind=DP) :: vkb (npwx,nkb), psi (npwx,nbnd), bec (nkb,nbnd)
|
|
|
|
! input: the FT of the beta functions
|
|
|
|
! input: the wavefunctions
|
|
|
|
! output: dot product of the beta and the wavefunctions
|
|
|
|
complex(kind=DP) :: alpha, beta
|
|
|
|
!
|
2003-02-08 00:04:36 +08:00
|
|
|
if (nkb.eq.0) return
|
2003-01-20 05:58:50 +08:00
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
call start_clock ('ccalbec')
|
|
|
|
alpha= (1.d0, 0.d0)
|
|
|
|
beta = (0.d0, 0.d0)
|
2003-01-20 05:58:50 +08:00
|
|
|
call ZGEMM ('C', 'N', nkb, nbnd, npw, alpha, vkb, npwx, psi, &
|
|
|
|
npwx, beta, bec, nkb)
|
2003-02-21 22:57:00 +08:00
|
|
|
#ifdef __PARA
|
2003-02-08 00:04:36 +08:00
|
|
|
call reduce (2 * nkb * nbnd, bec)
|
2003-01-20 05:58:50 +08:00
|
|
|
#endif
|
2003-02-08 00:04:36 +08:00
|
|
|
call stop_clock ('ccalbec')
|
|
|
|
return
|
2003-01-20 05:58:50 +08:00
|
|
|
end subroutine ccalbec
|
|
|
|
|