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 .
|
|
|
|
!
|
2004-06-26 01:25:37 +08:00
|
|
|
#include "f_defs.h"
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
|
|
|
!-----------------------------------------------------------------------
|
2003-02-08 00:04:36 +08:00
|
|
|
subroutine dpsidpsidv
|
2003-01-20 05:58:50 +08:00
|
|
|
!-----------------------------------------------------------------------
|
2004-06-14 15:30:47 +08:00
|
|
|
!
|
|
|
|
USE ions_base, ONLY : nat
|
2004-02-04 19:06:45 +08:00
|
|
|
USE kinds, only : DP
|
2003-01-20 05:58:50 +08:00
|
|
|
use pwcom
|
|
|
|
use phcom
|
|
|
|
use d3com
|
|
|
|
|
|
|
|
implicit none
|
2003-02-08 00:04:36 +08:00
|
|
|
integer :: ik, ikk, ikq, ibnd, jbnd, nu_i, nu_j, nu_z, nrec
|
2005-08-28 22:09:42 +08:00
|
|
|
real (DP) :: wgauss, wga (nbnd), wgq (nbnd), w0gauss, w0g (nbnd), &
|
2003-01-20 05:58:50 +08:00
|
|
|
deltae, wg1, wg2, wwg
|
2005-08-28 22:09:42 +08:00
|
|
|
complex (DP) :: wrk, wrk0, ZDOTC
|
|
|
|
complex (DP), allocatable :: dqpsi (:,:), ps1_ij (:,:), ps1_ji (:,:),&
|
2003-01-20 05:58:50 +08:00
|
|
|
ps3_ij (:,:), ps2_ji (:,:), d3dyn1 (:,:,:), d3dyn2 (:,:,:),&
|
|
|
|
d3dyn3 (:,:,:)
|
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
allocate (dqpsi( npwx, nbnd))
|
2004-03-07 21:47:42 +08:00
|
|
|
if (degauss /= 0.d0) then
|
2003-02-08 00:04:36 +08:00
|
|
|
allocate (ps1_ij( nbnd, nbnd))
|
|
|
|
allocate (ps1_ji( nbnd, nbnd))
|
|
|
|
allocate (ps3_ij( nbnd, nbnd))
|
|
|
|
allocate (ps2_ji( nbnd, nbnd))
|
2003-01-20 05:58:50 +08:00
|
|
|
endif
|
2003-02-08 00:04:36 +08:00
|
|
|
allocate (d3dyn1( 3 * nat, 3 * nat, 3 * nat))
|
|
|
|
if (.not.allmodes) then
|
|
|
|
allocate (d3dyn2( 3 * nat, 3 * nat, 3 * nat))
|
|
|
|
allocate (d3dyn3( 3 * nat, 3 * nat, 3 * nat))
|
2003-01-20 05:58:50 +08:00
|
|
|
endif
|
2004-03-07 21:47:42 +08:00
|
|
|
d3dyn1 (:,:,:) = (0.d0, 0.d0)
|
2003-02-08 00:04:36 +08:00
|
|
|
if (.not.allmodes) then
|
2004-03-07 21:47:42 +08:00
|
|
|
d3dyn2 (:,:,:) = (0.d0, 0.d0)
|
|
|
|
d3dyn3 (:,:,:) = (0.d0, 0.d0)
|
2003-01-20 05:58:50 +08:00
|
|
|
endif
|
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
do ik = 1, nksq
|
|
|
|
if (lgamma) then
|
|
|
|
ikk = ik
|
|
|
|
ikq = ik
|
|
|
|
else
|
|
|
|
ikk = 2 * ik - 1
|
|
|
|
ikq = 2 * ik
|
2003-01-20 05:58:50 +08:00
|
|
|
endif
|
2004-03-07 21:47:42 +08:00
|
|
|
|
|
|
|
if (degauss /= 0.d0) then
|
2003-02-08 00:04:36 +08:00
|
|
|
do ibnd = 1, nbnd
|
|
|
|
wga (ibnd) = wgauss ( (ef - et (ibnd, ikk) ) / degauss, ngauss)
|
|
|
|
wgq (ibnd) = wgauss ( (ef - et (ibnd, ikq) ) / degauss, ngauss)
|
2003-01-20 05:58:50 +08:00
|
|
|
w0g (ibnd) = w0gauss ( (ef - et (ibnd, ikk) ) / degauss, &
|
|
|
|
ngauss) / degauss
|
|
|
|
enddo
|
|
|
|
endif
|
2004-03-07 21:47:42 +08:00
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
do nu_i = 1, 3 * nat
|
|
|
|
nrec = (nu_i - 1) * nksq + ik
|
2003-01-20 05:58:50 +08:00
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
call davcio (dpsi, lrdwf, iudqwf, nrec, - 1)
|
|
|
|
do nu_j = 1, 3 * nat
|
|
|
|
nrec = (nu_j - 1) * nksq + ik
|
2003-01-20 05:58:50 +08:00
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
call davcio (dqpsi, lrdwf, iudqwf, nrec, - 1)
|
2004-03-07 21:47:42 +08:00
|
|
|
if (degauss /= 0.d0) then
|
2003-02-08 00:04:36 +08:00
|
|
|
nrec = nu_i + (nu_j - 1) * 3 * nat + (ik - 1) * 9 * nat * nat
|
|
|
|
call davcio (ps1_ij, lrdpdvp, iudpdvp_1, nrec, - 1)
|
|
|
|
nrec = nu_j + (nu_i - 1) * 3 * nat + (ik - 1) * 9 * nat * nat
|
|
|
|
call davcio (ps1_ji, lrdpdvp, iudpdvp_1, nrec, - 1)
|
2003-01-20 05:58:50 +08:00
|
|
|
endif
|
2004-03-07 21:47:42 +08:00
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
do nu_z = 1, 3 * nat
|
|
|
|
if (q0mode (nu_z) ) then
|
|
|
|
nrec = nu_z + (ik - 1) * 3 * nat
|
|
|
|
|
|
|
|
call davcio (psidqvpsi, lrpdqvp, iupd0vp, nrec, - 1)
|
General cleanup of intrinsic functions:
conversion to real => DBLE
(including real part of a complex number)
conversion to complex => CMPLX
complex conjugate => CONJG
imaginary part => AIMAG
All functions are uppercase.
CMPLX is preprocessed by f_defs.h and performs an explicit cast:
#define CMPLX(a,b) cmplx(a,b,kind=DP)
This implies that 1) f_defs.h must be included whenever a CMPLX is present,
2) CMPLX should stay in a single line, 3) DP must be defined.
All occurrences of real, float, dreal, dfloat, dconjg, dimag, dcmplx
removed - please do not reintroduce any of them.
Tested only with ifc7 and g95 - beware unintended side effects
Maybe not the best solution (explicit casts everywhere would be better)
but it can be easily changed with a script if the need arises.
The following code might be used to test for possible trouble:
program test_intrinsic
implicit none
integer, parameter :: dp = selected_real_kind(14,200)
real (kind=dp) :: a = 0.123456789012345_dp
real (kind=dp) :: b = 0.987654321098765_dp
complex (kind=dp) :: c = ( 0.123456789012345_dp, 0.987654321098765_dp)
print *, ' A = ', a
print *, ' DBLE(A)= ', DBLE(a)
print *, ' C = ', c
print *, 'CONJG(C)= ', CONJG(c)
print *, 'DBLE(c),AIMAG(C) = ', DBLE(c), AIMAG(c)
print *, 'CMPLX(A,B,kind=dp)= ', CMPLX( a, b, kind=dp)
end program test_intrinsic
Note that CMPLX and REAL without a cast yield single precision numbers on
ifc7 and g95 !!!
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2133 c92efa57-630b-4861-b058-cf58834340f0
2005-08-27 01:44:42 +08:00
|
|
|
wrk0 = CMPLX (0.d0, 0.d0)
|
|
|
|
wrk = CMPLX (0.d0, 0.d0)
|
2003-02-08 00:04:36 +08:00
|
|
|
do ibnd = 1, nbnd
|
|
|
|
do jbnd = 1, nbnd
|
2004-03-07 21:47:42 +08:00
|
|
|
if (degauss /= 0.d0) then
|
2003-02-08 00:04:36 +08:00
|
|
|
deltae = et (ibnd, ikk) - et (jbnd, ikk)
|
2004-03-07 21:47:42 +08:00
|
|
|
if (abs (deltae) > 1.0d-5) then
|
2003-02-08 00:04:36 +08:00
|
|
|
wg1 = wga (ibnd) / deltae
|
|
|
|
wg2 = wga (jbnd) / deltae
|
2004-03-07 21:47:42 +08:00
|
|
|
wrk0 = wrk0 + psidqvpsi (jbnd, ibnd) * &
|
|
|
|
(wg1 * ps1_ij (ibnd, jbnd) - &
|
General cleanup of intrinsic functions:
conversion to real => DBLE
(including real part of a complex number)
conversion to complex => CMPLX
complex conjugate => CONJG
imaginary part => AIMAG
All functions are uppercase.
CMPLX is preprocessed by f_defs.h and performs an explicit cast:
#define CMPLX(a,b) cmplx(a,b,kind=DP)
This implies that 1) f_defs.h must be included whenever a CMPLX is present,
2) CMPLX should stay in a single line, 3) DP must be defined.
All occurrences of real, float, dreal, dfloat, dconjg, dimag, dcmplx
removed - please do not reintroduce any of them.
Tested only with ifc7 and g95 - beware unintended side effects
Maybe not the best solution (explicit casts everywhere would be better)
but it can be easily changed with a script if the need arises.
The following code might be used to test for possible trouble:
program test_intrinsic
implicit none
integer, parameter :: dp = selected_real_kind(14,200)
real (kind=dp) :: a = 0.123456789012345_dp
real (kind=dp) :: b = 0.987654321098765_dp
complex (kind=dp) :: c = ( 0.123456789012345_dp, 0.987654321098765_dp)
print *, ' A = ', a
print *, ' DBLE(A)= ', DBLE(a)
print *, ' C = ', c
print *, 'CONJG(C)= ', CONJG(c)
print *, 'DBLE(c),AIMAG(C) = ', DBLE(c), AIMAG(c)
print *, 'CMPLX(A,B,kind=dp)= ', CMPLX( a, b, kind=dp)
end program test_intrinsic
Note that CMPLX and REAL without a cast yield single precision numbers on
ifc7 and g95 !!!
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2133 c92efa57-630b-4861-b058-cf58834340f0
2005-08-27 01:44:42 +08:00
|
|
|
wg2 * CONJG(ps1_ji (jbnd, ibnd) ) )
|
2003-02-08 00:04:36 +08:00
|
|
|
else
|
|
|
|
wg1 = wga (ibnd)
|
|
|
|
wwg = w0g (ibnd)
|
2004-03-07 21:47:42 +08:00
|
|
|
wrk0 = wrk0 - psidqvpsi (jbnd, ibnd) * wwg * &
|
|
|
|
ps1_ij (ibnd, jbnd)
|
|
|
|
wrk = wrk - psidqvpsi (jbnd, ibnd) * wg1 * ZDOTC &
|
|
|
|
(npwq, dpsi (1, ibnd), 1, dqpsi (1, jbnd), 1)
|
2003-01-20 05:58:50 +08:00
|
|
|
endif
|
2003-02-08 00:04:36 +08:00
|
|
|
else
|
2004-03-07 21:47:42 +08:00
|
|
|
wrk = wrk - psidqvpsi (jbnd, ibnd) * ZDOTC &
|
|
|
|
(npwq, dpsi (1, ibnd), 1, dqpsi (1, jbnd), 1)
|
2003-01-20 05:58:50 +08:00
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
enddo
|
2003-02-21 22:57:00 +08:00
|
|
|
#ifdef __PARA
|
2003-02-08 00:04:36 +08:00
|
|
|
call reduce (2, wrk)
|
2003-01-20 05:58:50 +08:00
|
|
|
#endif
|
2003-02-08 00:04:36 +08:00
|
|
|
wrk = wrk + wrk0
|
|
|
|
wrk = 2.d0 * wk (ikk) * wrk
|
2003-01-20 05:58:50 +08:00
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
d3dyn1 (nu_z, nu_i, nu_j) = d3dyn1 (nu_z, nu_i, nu_j) + wrk
|
2003-01-20 05:58:50 +08:00
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
2004-03-07 21:47:42 +08:00
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
if (.not.allmodes) then
|
|
|
|
do nu_j = 1, 3 * nat
|
|
|
|
nrec = (nu_j - 1) * nksq + ik
|
2003-01-20 05:58:50 +08:00
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
call davcio (dqpsi, lrdwf, iudqwf, nrec, - 1)
|
|
|
|
do nu_i = 1, 3 * nat
|
|
|
|
if (q0mode (nu_i) ) then
|
|
|
|
nrec = (nu_i - 1) * nksq + ik
|
2003-01-20 05:58:50 +08:00
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
call davcio (dpsi, lrdwf, iud0qwf, nrec, - 1)
|
2004-03-07 21:47:42 +08:00
|
|
|
if (degauss /= 0.d0) then
|
2003-01-20 05:58:50 +08:00
|
|
|
nrec = nu_i + (nu_j - 1) * 3 * nat + (ik - 1) * 9 * nat * &
|
|
|
|
nat
|
2003-02-08 00:04:36 +08:00
|
|
|
call davcio (ps3_ij, lrdpdvp, iudpdvp_3, nrec, - 1)
|
2003-01-20 05:58:50 +08:00
|
|
|
nrec = nu_j + (nu_i - 1) * 3 * nat + (ik - 1) * 9 * nat * &
|
|
|
|
nat
|
2003-02-08 00:04:36 +08:00
|
|
|
call davcio (ps2_ji, lrdpdvp, iudpdvp_2, nrec, - 1)
|
2003-01-20 05:58:50 +08:00
|
|
|
endif
|
2004-03-07 21:47:42 +08:00
|
|
|
|
2003-02-08 00:04:36 +08:00
|
|
|
do nu_z = 1, 3 * nat
|
|
|
|
nrec = nu_z + (ik - 1) * 3 * nat
|
|
|
|
|
|
|
|
call davcio (psidqvpsi, lrpdqvp, iupdqvp, nrec, - 1)
|
General cleanup of intrinsic functions:
conversion to real => DBLE
(including real part of a complex number)
conversion to complex => CMPLX
complex conjugate => CONJG
imaginary part => AIMAG
All functions are uppercase.
CMPLX is preprocessed by f_defs.h and performs an explicit cast:
#define CMPLX(a,b) cmplx(a,b,kind=DP)
This implies that 1) f_defs.h must be included whenever a CMPLX is present,
2) CMPLX should stay in a single line, 3) DP must be defined.
All occurrences of real, float, dreal, dfloat, dconjg, dimag, dcmplx
removed - please do not reintroduce any of them.
Tested only with ifc7 and g95 - beware unintended side effects
Maybe not the best solution (explicit casts everywhere would be better)
but it can be easily changed with a script if the need arises.
The following code might be used to test for possible trouble:
program test_intrinsic
implicit none
integer, parameter :: dp = selected_real_kind(14,200)
real (kind=dp) :: a = 0.123456789012345_dp
real (kind=dp) :: b = 0.987654321098765_dp
complex (kind=dp) :: c = ( 0.123456789012345_dp, 0.987654321098765_dp)
print *, ' A = ', a
print *, ' DBLE(A)= ', DBLE(a)
print *, ' C = ', c
print *, 'CONJG(C)= ', CONJG(c)
print *, 'DBLE(c),AIMAG(C) = ', DBLE(c), AIMAG(c)
print *, 'CMPLX(A,B,kind=dp)= ', CMPLX( a, b, kind=dp)
end program test_intrinsic
Note that CMPLX and REAL without a cast yield single precision numbers on
ifc7 and g95 !!!
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2133 c92efa57-630b-4861-b058-cf58834340f0
2005-08-27 01:44:42 +08:00
|
|
|
wrk0 = CMPLX (0.d0, 0.d0)
|
|
|
|
wrk = CMPLX (0.d0, 0.d0)
|
2003-02-08 00:04:36 +08:00
|
|
|
do ibnd = 1, nbnd
|
|
|
|
do jbnd = 1, nbnd
|
2004-03-07 21:47:42 +08:00
|
|
|
if (degauss /= 0.d0) then
|
2003-02-08 00:04:36 +08:00
|
|
|
deltae = et (ibnd, ikk) - et (jbnd, ikq)
|
2004-03-07 21:47:42 +08:00
|
|
|
if (abs (deltae) > 1.0d-5) then
|
2003-02-08 00:04:36 +08:00
|
|
|
wg1 = wga (ibnd) / deltae
|
|
|
|
wg2 = wgq (jbnd) / deltae
|
2004-03-07 21:47:42 +08:00
|
|
|
wrk0 = wrk0 + psidqvpsi (jbnd, ibnd) * &
|
|
|
|
(wg1 * ps2_ji (ibnd, jbnd) - &
|
General cleanup of intrinsic functions:
conversion to real => DBLE
(including real part of a complex number)
conversion to complex => CMPLX
complex conjugate => CONJG
imaginary part => AIMAG
All functions are uppercase.
CMPLX is preprocessed by f_defs.h and performs an explicit cast:
#define CMPLX(a,b) cmplx(a,b,kind=DP)
This implies that 1) f_defs.h must be included whenever a CMPLX is present,
2) CMPLX should stay in a single line, 3) DP must be defined.
All occurrences of real, float, dreal, dfloat, dconjg, dimag, dcmplx
removed - please do not reintroduce any of them.
Tested only with ifc7 and g95 - beware unintended side effects
Maybe not the best solution (explicit casts everywhere would be better)
but it can be easily changed with a script if the need arises.
The following code might be used to test for possible trouble:
program test_intrinsic
implicit none
integer, parameter :: dp = selected_real_kind(14,200)
real (kind=dp) :: a = 0.123456789012345_dp
real (kind=dp) :: b = 0.987654321098765_dp
complex (kind=dp) :: c = ( 0.123456789012345_dp, 0.987654321098765_dp)
print *, ' A = ', a
print *, ' DBLE(A)= ', DBLE(a)
print *, ' C = ', c
print *, 'CONJG(C)= ', CONJG(c)
print *, 'DBLE(c),AIMAG(C) = ', DBLE(c), AIMAG(c)
print *, 'CMPLX(A,B,kind=dp)= ', CMPLX( a, b, kind=dp)
end program test_intrinsic
Note that CMPLX and REAL without a cast yield single precision numbers on
ifc7 and g95 !!!
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2133 c92efa57-630b-4861-b058-cf58834340f0
2005-08-27 01:44:42 +08:00
|
|
|
wg2 * CONJG(ps3_ij (jbnd, ibnd) ) )
|
2003-02-08 00:04:36 +08:00
|
|
|
else
|
|
|
|
wg1 = wga (ibnd)
|
|
|
|
wwg = w0g (ibnd)
|
2004-03-07 21:47:42 +08:00
|
|
|
wrk0 = wrk0 - psidqvpsi (jbnd, ibnd) * wwg * &
|
|
|
|
ps2_ji (ibnd, jbnd)
|
|
|
|
wrk = wrk - psidqvpsi (jbnd, ibnd) * wg1 * &
|
|
|
|
ZDOTC (npwq, dqpsi (1, ibnd), 1, &
|
|
|
|
dpsi (1, jbnd), 1)
|
2003-01-20 05:58:50 +08:00
|
|
|
endif
|
2003-02-08 00:04:36 +08:00
|
|
|
else
|
2004-03-07 21:47:42 +08:00
|
|
|
wrk = wrk - psidqvpsi (jbnd, ibnd) * ZDOTC &
|
|
|
|
(npwq, dqpsi (1, ibnd), 1, dpsi (1, jbnd), 1)
|
2003-01-20 05:58:50 +08:00
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
enddo
|
2003-02-21 22:57:00 +08:00
|
|
|
#ifdef __PARA
|
2003-02-08 00:04:36 +08:00
|
|
|
call reduce (2, wrk)
|
2003-01-20 05:58:50 +08:00
|
|
|
#endif
|
2003-02-08 00:04:36 +08:00
|
|
|
wrk = wrk + wrk0
|
|
|
|
wrk = 2.d0 * wk (ikk) * wrk
|
2003-01-20 05:58:50 +08:00
|
|
|
d3dyn2 (nu_i, nu_j, nu_z) = d3dyn2 (nu_i, nu_j, nu_z) &
|
|
|
|
+ wrk
|
|
|
|
d3dyn3 (nu_i, nu_z, nu_j) = d3dyn3 (nu_i, nu_z, nu_j) &
|
General cleanup of intrinsic functions:
conversion to real => DBLE
(including real part of a complex number)
conversion to complex => CMPLX
complex conjugate => CONJG
imaginary part => AIMAG
All functions are uppercase.
CMPLX is preprocessed by f_defs.h and performs an explicit cast:
#define CMPLX(a,b) cmplx(a,b,kind=DP)
This implies that 1) f_defs.h must be included whenever a CMPLX is present,
2) CMPLX should stay in a single line, 3) DP must be defined.
All occurrences of real, float, dreal, dfloat, dconjg, dimag, dcmplx
removed - please do not reintroduce any of them.
Tested only with ifc7 and g95 - beware unintended side effects
Maybe not the best solution (explicit casts everywhere would be better)
but it can be easily changed with a script if the need arises.
The following code might be used to test for possible trouble:
program test_intrinsic
implicit none
integer, parameter :: dp = selected_real_kind(14,200)
real (kind=dp) :: a = 0.123456789012345_dp
real (kind=dp) :: b = 0.987654321098765_dp
complex (kind=dp) :: c = ( 0.123456789012345_dp, 0.987654321098765_dp)
print *, ' A = ', a
print *, ' DBLE(A)= ', DBLE(a)
print *, ' C = ', c
print *, 'CONJG(C)= ', CONJG(c)
print *, 'DBLE(c),AIMAG(C) = ', DBLE(c), AIMAG(c)
print *, 'CMPLX(A,B,kind=dp)= ', CMPLX( a, b, kind=dp)
end program test_intrinsic
Note that CMPLX and REAL without a cast yield single precision numbers on
ifc7 and g95 !!!
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2133 c92efa57-630b-4861-b058-cf58834340f0
2005-08-27 01:44:42 +08:00
|
|
|
+ CONJG(wrk)
|
2003-01-20 05:58:50 +08:00
|
|
|
enddo
|
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
endif
|
|
|
|
enddo
|
2003-02-21 22:57:00 +08:00
|
|
|
#ifdef __PARA
|
2003-02-08 00:04:36 +08:00
|
|
|
call poolreduce (2 * 27 * nat * nat * nat, d3dyn1)
|
|
|
|
if (.not.allmodes) then
|
|
|
|
call poolreduce (2 * 27 * nat * nat * nat, d3dyn2)
|
|
|
|
call poolreduce (2 * 27 * nat * nat * nat, d3dyn3)
|
2003-01-20 05:58:50 +08:00
|
|
|
endif
|
|
|
|
#endif
|
2003-02-08 00:04:36 +08:00
|
|
|
do nu_i = 1, 3 * nat
|
|
|
|
do nu_j = 1, 3 * nat
|
|
|
|
do nu_z = 1, 3 * nat
|
|
|
|
if (allmodes) then
|
2004-03-07 21:47:42 +08:00
|
|
|
d3dyn (nu_i, nu_j, nu_z) = d3dyn (nu_i, nu_j, nu_z) + &
|
|
|
|
d3dyn1 (nu_i, nu_j, nu_z) + d3dyn1 (nu_j, nu_z, nu_i) + &
|
|
|
|
d3dyn1 (nu_z, nu_i, nu_j)
|
2003-01-20 05:58:50 +08:00
|
|
|
d3dyn_aux6 (nu_i, nu_j, nu_z) = d3dyn_aux6 (nu_i, nu_j, nu_z) &
|
|
|
|
+ d3dyn1 (nu_i, nu_j, nu_z) + d3dyn1 (nu_j, nu_z, nu_i) &
|
|
|
|
+ d3dyn1 (nu_z, nu_i, nu_j)
|
2003-02-08 00:04:36 +08:00
|
|
|
else
|
2004-03-07 21:47:42 +08:00
|
|
|
d3dyn (nu_i, nu_j, nu_z) = d3dyn (nu_i, nu_j, nu_z) + &
|
|
|
|
d3dyn1 (nu_i, nu_j, nu_z) + d3dyn2 (nu_i, nu_j, nu_z) + &
|
|
|
|
d3dyn3 (nu_i, nu_j, nu_z)
|
2003-01-20 05:58:50 +08:00
|
|
|
d3dyn_aux6 (nu_i, nu_j, nu_z) = d3dyn_aux6 (nu_i, nu_j, nu_z) &
|
|
|
|
+ d3dyn1 (nu_i, nu_j, nu_z) + d3dyn2 (nu_i, nu_j, nu_z) &
|
|
|
|
+ d3dyn3 (nu_i, nu_j, nu_z)
|
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
2003-02-08 00:04:36 +08:00
|
|
|
deallocate (dqpsi)
|
2004-03-07 21:47:42 +08:00
|
|
|
if (degauss /= 0.d0) then
|
2003-02-08 00:04:36 +08:00
|
|
|
deallocate (ps1_ij)
|
|
|
|
deallocate (ps1_ji)
|
|
|
|
deallocate (ps3_ij)
|
|
|
|
deallocate (ps2_ji)
|
2003-01-20 05:58:50 +08:00
|
|
|
endif
|
2003-02-08 00:04:36 +08:00
|
|
|
deallocate (d3dyn1)
|
|
|
|
if (.not.allmodes) then
|
|
|
|
deallocate (d3dyn2)
|
|
|
|
deallocate (d3dyn3)
|
2003-01-20 05:58:50 +08:00
|
|
|
endif
|
2003-02-08 00:04:36 +08:00
|
|
|
return
|
2003-01-20 05:58:50 +08:00
|
|
|
end subroutine dpsidpsidv
|