2003-01-20 05:58:50 +08:00
|
|
|
!
|
2005-05-17 03:19:04 +08:00
|
|
|
! Copyright (C) 2002-2005 FPMD-CPV groups
|
2003-01-20 05:58:50 +08:00
|
|
|
! 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 .
|
2005-01-15 18:53:46 +08:00
|
|
|
!
|
2005-04-28 23:27:41 +08:00
|
|
|
|
2003-01-20 05:58:50 +08:00
|
|
|
!-----------------------------------------------------------------------
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
subroutine formf( tfirst, eself )
|
|
|
|
!-----------------------------------------------------------------------
|
2005-05-02 04:53:24 +08:00
|
|
|
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
!computes (a) the self-energy eself of the ionic pseudocharges;
|
|
|
|
! (b) the form factors of: (i) pseudopotential (vps),
|
|
|
|
! (ii) ionic pseudocharge (rhops)
|
|
|
|
! all quantities are returned in common /pseu/
|
|
|
|
! also calculated the derivative of vps with respect to
|
|
|
|
! g^2 (dvps)
|
|
|
|
!
|
2005-08-28 22:09:42 +08:00
|
|
|
USE kinds, ONLY : DP
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
use mp, ONLY : mp_sum
|
|
|
|
use control_flags, ONLY : iprint, tpre, iprsta
|
|
|
|
use io_global, ONLY : stdout
|
2006-03-23 17:19:43 +08:00
|
|
|
use mp_global, ONLY : intra_image_comm
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
use bhs, ONLY : rc1, rc2, wrc2, wrc1, rcl, al, bl, lloc
|
|
|
|
use gvecs, ONLY : ngs
|
|
|
|
use cell_base, ONLY : omega, tpiba2, tpiba
|
|
|
|
use ions_base, ONLY : rcmax, zv, nsp, na
|
|
|
|
use local_pseudo, ONLY : vps, rhops, dvps, drhops
|
|
|
|
use atom, ONLY : r, rab, mesh, numeric
|
2006-03-06 18:39:38 +08:00
|
|
|
use uspp_param, ONLY : vloc_at, oldvan
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
use pseudo_base, ONLY : compute_rhops, formfn, formfa, compute_eself
|
|
|
|
use pseudopotential, ONLY : tpstab, build_pstab, vps_sp, dvps_sp
|
|
|
|
use splines, ONLY : spline
|
|
|
|
use reciprocal_vectors, ONLY : gstart, g
|
|
|
|
!
|
|
|
|
implicit none
|
|
|
|
logical :: tfirst
|
2005-08-28 22:09:42 +08:00
|
|
|
real(DP) :: eself
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
!
|
2005-08-28 22:09:42 +08:00
|
|
|
real(DP) :: vpsum, rhopsum
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
integer :: is, ig
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP) :: cost1, xg
|
2005-05-02 04:53:24 +08:00
|
|
|
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
call start_clock( 'formf' )
|
|
|
|
!
|
|
|
|
! calculation of gaussian selfinteraction
|
|
|
|
!
|
|
|
|
eself = compute_eself( na, zv, rcmax, nsp )
|
2005-05-02 04:53:24 +08:00
|
|
|
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
if( tfirst .or. ( iprsta >= 4 ) )then
|
|
|
|
WRITE( stdout, 1200 ) eself
|
|
|
|
endif
|
|
|
|
!
|
|
|
|
1200 format(/,3x,'formf: eself=',f10.5)
|
|
|
|
!
|
|
|
|
IF( tpstab ) THEN
|
|
|
|
!
|
|
|
|
CALL build_pstab( )
|
|
|
|
!
|
|
|
|
END IF
|
|
|
|
!
|
|
|
|
do is = 1, nsp
|
2005-04-28 23:27:41 +08:00
|
|
|
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
IF( tpstab ) THEN
|
|
|
|
!
|
|
|
|
! Use interpolation table, with cubic spline
|
|
|
|
!
|
|
|
|
cost1 = 1.0d0/omega
|
|
|
|
!
|
|
|
|
IF( gstart == 2 ) THEN
|
|
|
|
vps (1,is) = vps_sp(is)%y(1) * cost1
|
|
|
|
dvps(1,is) = dvps_sp(is)%y(1) * cost1
|
|
|
|
END IF
|
|
|
|
!
|
|
|
|
DO ig = gstart, ngs
|
|
|
|
xg = SQRT( g(ig) ) * tpiba
|
|
|
|
vps (ig,is) = spline( vps_sp(is), xg ) * cost1
|
|
|
|
dvps(ig,is) = spline( dvps_sp(is), xg ) * cost1
|
|
|
|
END DO
|
|
|
|
!
|
|
|
|
ELSE
|
2005-04-28 23:27:41 +08:00
|
|
|
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
if ( numeric(is) ) then
|
2005-04-28 23:27:41 +08:00
|
|
|
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
call formfn( vps(:,is), dvps(:,is), r(:,is), rab(:,is), vloc_at(:,is), &
|
2005-12-02 01:25:22 +08:00
|
|
|
zv(is), rcmax(is), g, omega, tpiba2, mesh(is), &
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
ngs, oldvan(is), tpre )
|
2005-04-28 23:27:41 +08:00
|
|
|
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
else
|
2005-05-02 04:53:24 +08:00
|
|
|
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
! bhs pseudopotentials
|
|
|
|
!
|
|
|
|
call formfa( vps(:,is), dvps(:,is), rc1(is), rc2(is), wrc1(is), wrc2(is), &
|
|
|
|
rcl(:,is,lloc(is)), al(:,is,lloc(is)), bl(:,is,lloc(is)), &
|
|
|
|
zv(is), rcmax(is), g, omega, tpiba2, ngs, gstart, tpre )
|
2005-05-02 04:53:24 +08:00
|
|
|
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
end if
|
2004-08-27 18:20:42 +08:00
|
|
|
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
END IF
|
|
|
|
!
|
|
|
|
! fourier transform of local pp and gaussian nuclear charge
|
|
|
|
!
|
|
|
|
call compute_rhops( rhops(:,is), drhops(:,is), zv(is), rcmax(is), g, &
|
|
|
|
omega, tpiba2, ngs, tpre )
|
2004-08-27 18:20:42 +08:00
|
|
|
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
if( tfirst .or. ( iprsta >= 4 ) )then
|
|
|
|
vpsum = SUM( vps( 1:ngs, is ) )
|
|
|
|
rhopsum = SUM( rhops( 1:ngs, is ) )
|
2006-03-23 17:19:43 +08:00
|
|
|
call mp_sum( vpsum, intra_image_comm )
|
|
|
|
call mp_sum( rhopsum, intra_image_comm )
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
WRITE( stdout,1250) vps(1,is),rhops(1,is)
|
|
|
|
WRITE( stdout,1300) vpsum,rhopsum
|
|
|
|
endif
|
|
|
|
!
|
|
|
|
end do
|
|
|
|
!
|
|
|
|
call stop_clock( 'formf' )
|
|
|
|
!
|
|
|
|
1250 format(3x,'formf: vps(g=0)=',f12.7,' rhops(g=0)=',f12.7)
|
|
|
|
1300 format(3x,'formf: sum_g vps(g)=',f12.7,' sum_g rhops(g)=',f12.7)
|
|
|
|
!
|
|
|
|
return
|
|
|
|
end subroutine formf
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
!-----------------------------------------------------------------------
|
2005-11-02 06:40:42 +08:00
|
|
|
SUBROUTINE newnlinit()
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
!-----------------------------------------------------------------------
|
|
|
|
!
|
2005-11-02 06:40:42 +08:00
|
|
|
! ... this routine calculates arrays beta, qradb, qq, qgb, rhocb
|
|
|
|
! ... and derivatives w.r.t. cell parameters dbeta, dqrad
|
|
|
|
! ... See also comments in nlinit
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
!
|
2005-09-23 20:50:54 +08:00
|
|
|
use control_flags, ONLY : tpre
|
|
|
|
use pseudopotential, ONLY : interpolate_beta, interpolate_qradb
|
2005-09-26 23:56:23 +08:00
|
|
|
use pseudopotential, ONLY : exact_beta, tpstab, check_tables
|
2005-09-23 20:50:54 +08:00
|
|
|
USE core, ONLY : core_charge_ftr
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
!
|
2005-11-02 06:40:42 +08:00
|
|
|
IMPLICIT NONE
|
2005-09-26 23:56:23 +08:00
|
|
|
!
|
|
|
|
LOGICAL :: recompute_table
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
!
|
2005-11-02 06:40:42 +08:00
|
|
|
! ... initialization for vanderbilt species
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
!
|
2005-11-02 06:40:42 +08:00
|
|
|
recompute_table = tpre .AND. check_tables()
|
2005-09-26 23:56:23 +08:00
|
|
|
!
|
2005-11-02 06:40:42 +08:00
|
|
|
IF ( recompute_table ) &
|
|
|
|
CALL errore( ' newnlinit', &
|
|
|
|
'interpolation tables recalculation, not implemented yet', 1 )
|
2005-09-26 23:56:23 +08:00
|
|
|
!
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
CALL interpolate_qradb( tpre )
|
|
|
|
!
|
2006-03-11 00:02:42 +08:00
|
|
|
!
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
! initialization that is common to all species
|
|
|
|
!
|
|
|
|
IF( tpstab ) THEN
|
|
|
|
!
|
|
|
|
CALL interpolate_beta( tpre )
|
|
|
|
!
|
|
|
|
ELSE
|
|
|
|
!
|
2005-11-02 06:40:42 +08:00
|
|
|
! ... this is mainly for testing
|
|
|
|
!
|
|
|
|
CALL exact_beta( tpre )
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
!
|
|
|
|
END IF
|
|
|
|
!
|
2005-11-02 06:40:42 +08:00
|
|
|
! ... non-linear core-correction ( rhocb(ig,is) )
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
!
|
|
|
|
CALL core_charge_ftr( tpre )
|
|
|
|
!
|
2005-11-02 06:40:42 +08:00
|
|
|
RETURN
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
!
|
2005-11-02 06:40:42 +08:00
|
|
|
END SUBROUTINE newnlinit
|
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
!-----------------------------------------------------------------------
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
subroutine nlfh( bec, dbec, lambda )
|
|
|
|
!-----------------------------------------------------------------------
|
|
|
|
!
|
|
|
|
! contribution to the internal stress tensor due to the constraints
|
|
|
|
!
|
2005-08-28 22:09:42 +08:00
|
|
|
USE kinds, ONLY : DP
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
use cvan, ONLY : nvb, ish
|
|
|
|
use uspp, ONLY : nhsa => nkb, qq
|
|
|
|
use uspp_param, ONLY : nh, nhm
|
|
|
|
use ions_base, ONLY : na
|
2006-01-30 00:43:06 +08:00
|
|
|
use electrons_base, ONLY : nbspx, nbsp, nudx, nspin, nupdwn, iupdwn
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
use cell_base, ONLY : omega, h
|
|
|
|
use constants, ONLY : pi, fpi
|
|
|
|
use stre, ONLY : stress
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
implicit none
|
|
|
|
|
2006-01-30 00:43:06 +08:00
|
|
|
real(DP), intent(in) :: bec( nhsa, nbsp ), dbec( nhsa, nbsp, 3, 3 )
|
|
|
|
real(DP), intent(in) :: lambda( nudx, nudx, nspin )
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2006-01-30 00:43:06 +08:00
|
|
|
integer :: i, j, ii, jj, inl, iv, jv, ia, is, iss, nss, istart
|
2005-08-28 22:09:42 +08:00
|
|
|
real(DP) :: fpre(3,3)
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
!
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP), ALLOCATABLE :: tmpbec(:,:), tmpdh(:,:), temp(:,:)
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
!
|
2006-01-30 00:43:06 +08:00
|
|
|
ALLOCATE ( tmpbec(nhm,nudx), tmpdh(nudx,nhm), temp(nudx,nudx) )
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
!
|
2003-09-18 05:50:03 +08:00
|
|
|
fpre(:,:) = 0.d0
|
2003-01-20 05:58:50 +08:00
|
|
|
do ii=1,3
|
|
|
|
do jj=1,3
|
|
|
|
do is=1,nvb
|
|
|
|
do ia=1,na(is)
|
|
|
|
!
|
2006-01-30 00:43:06 +08:00
|
|
|
do iss = 1, nspin
|
|
|
|
!
|
|
|
|
istart = iupdwn( iss )
|
|
|
|
nss = nupdwn( iss )
|
|
|
|
!
|
|
|
|
tmpbec = 0.d0
|
|
|
|
tmpdh = 0.d0
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2006-01-30 00:43:06 +08:00
|
|
|
do iv=1,nh(is)
|
|
|
|
do jv=1,nh(is)
|
|
|
|
inl=ish(is)+(jv-1)*na(is)+ia
|
|
|
|
if(abs(qq(iv,jv,is)).gt.1.e-5) then
|
|
|
|
do i = 1, nss
|
|
|
|
tmpbec(iv,i) = tmpbec(iv,i) + &
|
|
|
|
& qq(iv,jv,is) * bec(inl, i + istart - 1)
|
|
|
|
end do
|
|
|
|
endif
|
|
|
|
end do
|
2003-01-20 05:58:50 +08:00
|
|
|
end do
|
|
|
|
!
|
2006-01-30 00:43:06 +08:00
|
|
|
do iv=1,nh(is)
|
|
|
|
inl=ish(is)+(iv-1)*na(is)+ia
|
|
|
|
do i = 1, nss
|
|
|
|
tmpdh(i,iv) = dbec( inl, i+istart-1, ii, jj )
|
|
|
|
end do
|
2003-01-20 05:58:50 +08:00
|
|
|
end do
|
|
|
|
!
|
2006-01-30 00:43:06 +08:00
|
|
|
if(nh(is).gt.0)then
|
|
|
|
|
|
|
|
temp = 0.d0
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2006-01-30 00:43:06 +08:00
|
|
|
call MXMA &
|
|
|
|
& (tmpdh,1,nudx,tmpbec,1,nhm,temp,1,nudx,nss,nh(is),nss)
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2006-03-08 17:03:27 +08:00
|
|
|
! do j=1,nss
|
|
|
|
! do i=1,nss
|
|
|
|
! temp(i,j)=temp(i,j)*lambda(i,j,iss)
|
|
|
|
! end do
|
|
|
|
! end do
|
|
|
|
! fpre(ii,jj)=fpre(ii,jj)+2.*SUM(temp(1:nss,1:nss))
|
|
|
|
!
|
|
|
|
DO j = 1, nss
|
|
|
|
DO i = 1, nss
|
|
|
|
fpre(ii,jj) = fpre(ii,jj) + 2*temp(i,j)*lambda(i,j,iss)
|
|
|
|
END DO
|
|
|
|
END DO
|
|
|
|
|
2006-01-30 00:43:06 +08:00
|
|
|
endif
|
|
|
|
!
|
|
|
|
end do
|
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
do i=1,3
|
|
|
|
do j=1,3
|
|
|
|
stress(i,j)=stress(i,j)+(fpre(i,1)*h(j,1)+ &
|
|
|
|
& fpre(i,2)*h(j,2)+fpre(i,3)*h(j,3))/omega
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
!
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
DEALLOCATE ( tmpbec, tmpdh, temp )
|
|
|
|
|
|
|
|
return
|
|
|
|
end subroutine nlfh
|
|
|
|
|
|
|
|
|
2003-01-20 05:58:50 +08:00
|
|
|
!-----------------------------------------------------------------------
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
subroutine nlinit
|
|
|
|
!-----------------------------------------------------------------------
|
|
|
|
!
|
|
|
|
! this routine allocates and initalizes arrays beta, qradb, qq, qgb,
|
|
|
|
! rhocb, and derivatives w.r.t. cell parameters dbeta, dqrad
|
|
|
|
!
|
|
|
|
! beta(ig,l,is) = 4pi/sqrt(omega) y^r(l,q^)
|
|
|
|
! int_0^inf dr r^2 j_l(qr) betar(l,is,r)
|
|
|
|
!
|
|
|
|
! Note that beta(g)_lm,is = (-i)^l*beta(ig,l,is) (?)
|
|
|
|
!
|
|
|
|
! qradb(ig,l,k,is) = 4pi/omega int_0^r dr r^2 j_l(qr) q(r,l,k,is)
|
|
|
|
!
|
|
|
|
! qq_ij=int_0^r q_ij(r)=omega*qg(g=0)
|
|
|
|
!
|
|
|
|
! beta and qradb are first calculated on a fixed linear grid in |G|
|
|
|
|
! (betax, qradx) then calculated on the box grid by interpolation
|
|
|
|
! (this is done in routine newnlinit)
|
|
|
|
!
|
|
|
|
use parameters, ONLY : lmaxx
|
|
|
|
use control_flags, ONLY : iprint, tpre, program_name
|
|
|
|
use io_global, ONLY : stdout, ionode
|
|
|
|
use gvecw, ONLY : ngw
|
2006-03-06 18:39:38 +08:00
|
|
|
use cvan, ONLY : ish, nvb
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
use core, ONLY : rhocb, nlcc_any, allocate_core
|
|
|
|
use constants, ONLY : pi, fpi
|
|
|
|
use ions_base, ONLY : na, nsp
|
2006-03-06 18:39:38 +08:00
|
|
|
use uspp, ONLY : aainit, beta, qq, dvan, nhtol, nhtolm, indv,&
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
nhsa => nkb, nhsavb=>nkbus
|
2006-03-06 18:39:38 +08:00
|
|
|
use uspp_param, ONLY : kkbeta, qqq, nqlc, betar, lmaxq, dion,&
|
|
|
|
nbeta, nbetam, lmaxkb, lll, nhm, nh, tvanp
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
use atom, ONLY : mesh, r, rab, nlcc, numeric
|
|
|
|
use qradb_mod, ONLY : qradb
|
|
|
|
use qgb_mod, ONLY : qgb
|
|
|
|
use gvecb, ONLY : ngb
|
2005-09-23 20:50:54 +08:00
|
|
|
use gvecp, ONLY : ngm
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
use cdvan, ONLY : dbeta
|
|
|
|
use dqrad_mod, ONLY : dqrad
|
|
|
|
use dqgb_mod, ONLY : dqgb
|
|
|
|
use betax, ONLY : qradx, dqradx, refg, betagx, mmx, dbetagx
|
|
|
|
use pseudopotential, ONLY : pseudopotential_indexes, compute_dvan, &
|
|
|
|
compute_betagx, compute_qradx
|
|
|
|
USE grid_dimensions, ONLY : nnrx
|
2005-05-19 05:01:05 +08:00
|
|
|
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
|
|
|
implicit none
|
|
|
|
!
|
2004-04-20 04:35:42 +08:00
|
|
|
integer is, il, l, ir, iv, jv, lm, ind, ltmp, i0
|
2005-08-28 22:09:42 +08:00
|
|
|
real(8), allocatable:: fint(:), jl(:), jltmp(:), djl(:), &
|
2003-01-20 05:58:50 +08:00
|
|
|
& dfint(:)
|
2005-08-28 22:09:42 +08:00
|
|
|
real(8) xg, xrg, fac
|
2005-05-19 05:01:05 +08:00
|
|
|
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
IF( ionode ) THEN
|
|
|
|
WRITE( stdout, 100 )
|
|
|
|
100 FORMAT( //, &
|
|
|
|
3X,'Pseudopotentials initialization',/, &
|
|
|
|
3X,'-------------------------------' )
|
|
|
|
END IF
|
|
|
|
|
2005-02-21 22:52:12 +08:00
|
|
|
!
|
2005-05-19 05:01:05 +08:00
|
|
|
! initialize indexes
|
2005-02-21 22:52:12 +08:00
|
|
|
!
|
2005-09-23 20:50:54 +08:00
|
|
|
CALL pseudopotential_indexes( nlcc_any )
|
2005-05-19 05:01:05 +08:00
|
|
|
!
|
|
|
|
! initialize array ap
|
|
|
|
!
|
|
|
|
call aainit( lmaxkb + 1 )
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
!
|
2005-09-23 20:50:54 +08:00
|
|
|
CALL allocate_core( nnrx, ngm, ngb, nsp )
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
!
|
2006-03-11 00:02:42 +08:00
|
|
|
!
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
allocate( beta( ngw, nhm, nsp ) )
|
2006-03-07 18:15:27 +08:00
|
|
|
allocate( qradb( ngb, nbetam*(nbetam+1)/2, lmaxq, nsp ) )
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
allocate( qgb( ngb, nhm*(nhm+1)/2, nsp ) )
|
|
|
|
allocate( qq( nhm, nhm, nsp ) )
|
2006-03-07 18:15:27 +08:00
|
|
|
qradb(:,:,:,:) = 0.d0
|
2003-09-18 05:50:03 +08:00
|
|
|
qq (:,:,:) =0.d0
|
2006-01-13 05:03:17 +08:00
|
|
|
IF (tpre) THEN
|
2006-03-15 19:23:03 +08:00
|
|
|
allocate( dqrad( ngb, nbetam*(nbetam+1)/2, lmaxq, nsp, 3, 3 ) )
|
2006-01-13 05:03:17 +08:00
|
|
|
allocate( dqgb( ngb, nhm*(nhm+1)/2, nsp, 3, 3 ) )
|
|
|
|
allocate( dbeta( ngw, nhm, nsp, 3, 3 ) )
|
2006-03-15 19:23:03 +08:00
|
|
|
dqrad(:,:,:,:,:,:) = 0.d0
|
2006-01-13 05:03:17 +08:00
|
|
|
END IF
|
2005-05-19 05:01:05 +08:00
|
|
|
!
|
|
|
|
! initialization for vanderbilt species
|
|
|
|
!
|
|
|
|
CALL compute_qradx( tpre )
|
|
|
|
!
|
|
|
|
! initialization that is common to all species
|
|
|
|
!
|
2005-03-15 17:07:59 +08:00
|
|
|
WRITE( stdout, fmt="(//,3X,'Common initialization' )" )
|
2005-05-19 05:01:05 +08:00
|
|
|
|
|
|
|
do is = 1, nsp
|
2005-03-15 17:07:59 +08:00
|
|
|
WRITE( stdout, fmt="(/,3X,'Specie: ',I5)" ) is
|
2005-05-19 05:01:05 +08:00
|
|
|
if ( .not. numeric(is) ) then
|
2003-01-20 05:58:50 +08:00
|
|
|
fac=1.0
|
|
|
|
else
|
2005-05-19 05:01:05 +08:00
|
|
|
! fac converts ry to hartree
|
2003-01-20 05:58:50 +08:00
|
|
|
fac=0.5
|
|
|
|
end if
|
2005-05-19 05:01:05 +08:00
|
|
|
do iv = 1, nh(is)
|
|
|
|
WRITE( stdout,901) iv, indv(iv,is), nhtol(iv,is)
|
2003-01-20 05:58:50 +08:00
|
|
|
end do
|
|
|
|
901 format(2x,i2,' indv= ',i2,' ang. mom= ',i2)
|
2005-05-19 05:01:05 +08:00
|
|
|
!
|
2003-11-09 18:42:50 +08:00
|
|
|
WRITE( stdout,*)
|
|
|
|
WRITE( stdout,'(20x,a)') ' dion '
|
2005-05-19 05:01:05 +08:00
|
|
|
do iv = 1, nbeta(is)
|
2006-03-06 18:39:38 +08:00
|
|
|
WRITE( stdout,'(8f9.4)') ( fac*dion(iv,jv,is), jv = 1, nbeta(is) )
|
2003-01-20 05:58:50 +08:00
|
|
|
end do
|
2005-05-19 05:01:05 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
end do
|
2005-05-19 05:01:05 +08:00
|
|
|
!
|
|
|
|
! calculation of array betagx(ig,iv,is)
|
|
|
|
!
|
|
|
|
call compute_betagx( tpre )
|
|
|
|
!
|
|
|
|
! calculate array dvan(iv,jv,is)
|
|
|
|
!
|
|
|
|
call compute_dvan()
|
|
|
|
!
|
|
|
|
! newnlinit stores qgb and qq, calculates arrays beta qradb rhocb
|
|
|
|
! and derivatives wrt cell dbeta dqrad
|
|
|
|
!
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
call newnlinit()
|
2005-03-15 17:07:59 +08:00
|
|
|
|
2003-01-20 05:58:50 +08:00
|
|
|
return
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
end subroutine nlinit
|
2003-01-20 05:58:50 +08:00
|
|
|
|
|
|
|
!-------------------------------------------------------------------------
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
subroutine qvan2b(ngy,iv,jv,is,ylm,qg)
|
|
|
|
!--------------------------------------------------------------------------
|
|
|
|
!
|
|
|
|
! q(g,l,k) = sum_lm (-i)^l ap(lm,l,k) yr_lm(g^) qrad(g,l,l,k)
|
|
|
|
!
|
2005-08-28 22:09:42 +08:00
|
|
|
USE kinds, ONLY : DP
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
use control_flags, ONLY : iprint, tpre
|
|
|
|
use qradb_mod, ONLY : qradb
|
|
|
|
use uspp, ONLY : nlx, lpx, lpl, ap, indv, nhtolm
|
|
|
|
use gvecb, ONLY : ngb
|
|
|
|
use uspp_param, ONLY : lmaxq
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
implicit none
|
|
|
|
!
|
|
|
|
integer, intent(in) :: ngy, iv, jv, is
|
2005-08-28 22:09:42 +08:00
|
|
|
real(DP), intent(in) :: ylm( ngb, lmaxq*lmaxq )
|
|
|
|
complex(DP), intent(out) :: qg( ngb )
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
!
|
2006-03-07 18:15:27 +08:00
|
|
|
integer :: ivs, jvs, ijvs, ivl, jvl, i, ii, ij, l, lp, ig
|
2005-08-28 22:09:42 +08:00
|
|
|
complex(DP) :: sig
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
!
|
|
|
|
! iv = 1..8 s_1 p_x1 p_z1 p_y1 s_2 p_x2 p_z2 p_y2
|
|
|
|
! ivs = 1..4 s_1 s_2 p_1 p_2
|
|
|
|
! ivl = 1..4 s p_x p_z p_y
|
|
|
|
!
|
|
|
|
ivs=indv(iv,is)
|
|
|
|
jvs=indv(jv,is)
|
2006-03-07 18:15:27 +08:00
|
|
|
if (ivs >= jvs) then
|
|
|
|
ijvs = ivs*(ivs-1)/2 + jvs
|
|
|
|
else
|
|
|
|
ijvs = jvs*(jvs-1)/2 + ivs
|
|
|
|
end if
|
|
|
|
! ijvs is the packed index for (ivs,jvs)
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
ivl=nhtolm(iv,is)
|
|
|
|
jvl=nhtolm(jv,is)
|
2006-03-07 18:15:27 +08:00
|
|
|
if (ivl > nlx .OR. jvl > nlx) &
|
|
|
|
call errore (' qvan2b ', ' wrong dimensions', MAX(ivl,jvl))
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
!
|
|
|
|
qg(:) = (0.d0, 0.d0)
|
|
|
|
!
|
|
|
|
! lpx = max number of allowed y_lm
|
|
|
|
! lp = composite lm to indentify them
|
|
|
|
!
|
|
|
|
do i=1,lpx(ivl,jvl)
|
|
|
|
lp=lpl(ivl,jvl,i)
|
|
|
|
if (lp > lmaxq*lmaxq) call errore(' qvan2b ',' lp out of bounds ',lp)
|
|
|
|
!
|
|
|
|
! extraction of angular momentum l from lp:
|
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
|
|
|
! l = int ( sqrt( DBLE(l-1) + epsilon) ) + 1
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
!
|
|
|
|
if (lp == 1) then
|
|
|
|
l=1
|
|
|
|
else if ((lp >= 2) .and. (lp <= 4)) then
|
|
|
|
l=2
|
|
|
|
else if ((lp >= 5) .and. (lp <= 9)) then
|
|
|
|
l=3
|
|
|
|
else if ((lp >= 10).and.(lp <= 16)) then
|
|
|
|
l=4
|
|
|
|
else if ((lp >= 17).and.(lp <= 25)) then
|
|
|
|
l=5
|
|
|
|
else if ((lp >= 26).and.(lp <= 36)) then
|
|
|
|
l=6
|
|
|
|
else if ((lp >= 37).and.(lp <= 49)) then
|
|
|
|
l=7
|
|
|
|
else
|
|
|
|
call errore(' qvan2b ',' not implemented ',lp)
|
|
|
|
endif
|
|
|
|
!
|
|
|
|
! sig= (-i)^l
|
|
|
|
!
|
|
|
|
sig=(0.,-1.)**(l-1)
|
|
|
|
sig=sig*ap(lp,ivl,jvl)
|
|
|
|
do ig=1,ngy
|
2006-03-07 18:15:27 +08:00
|
|
|
qg(ig)=qg(ig)+sig*ylm(ig,lp)*qradb(ig,ijvs,l,is)
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
end do
|
|
|
|
end do
|
2005-03-15 17:07:59 +08:00
|
|
|
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
return
|
|
|
|
end subroutine qvan2b
|
2004-04-21 20:54:06 +08:00
|
|
|
|
|
|
|
!-------------------------------------------------------------------------
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
subroutine dqvan2b(ngy,iv,jv,is,ylm,dylm,dqg)
|
|
|
|
!--------------------------------------------------------------------------
|
|
|
|
!
|
|
|
|
! dq(i,j) derivatives wrt to h(i,j) of q(g,l,k) calculated in qvan2b
|
|
|
|
!
|
2005-08-28 22:09:42 +08:00
|
|
|
USE kinds, ONLY : DP
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
use control_flags, ONLY : iprint, tpre
|
|
|
|
use qradb_mod, ONLY : qradb
|
|
|
|
use uspp, ONLY : nlx, lpx, lpl, ap, indv, nhtolm
|
|
|
|
use gvecb, ONLY : ngb
|
|
|
|
use dqrad_mod, ONLY : dqrad
|
|
|
|
use uspp_param, ONLY : lmaxq
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
integer, intent(in) :: ngy, iv, jv, is
|
2005-08-28 22:09:42 +08:00
|
|
|
REAL(DP), INTENT(IN) :: ylm( ngb, lmaxq*lmaxq ), dylm( ngb, lmaxq*lmaxq, 3, 3 )
|
|
|
|
complex(DP), intent(out) :: dqg( ngb, 3, 3 )
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
|
2006-03-07 18:15:27 +08:00
|
|
|
integer :: ivs, jvs, ijvs, ivl, jvl, i, ii, ij, l, lp, ig
|
2005-08-28 22:09:42 +08:00
|
|
|
complex(DP) :: sig
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
!
|
|
|
|
!
|
|
|
|
! iv = 1..8 s_1 p_x1 p_z1 p_y1 s_2 p_x2 p_z2 p_y2
|
|
|
|
! ivs = 1..4 s_1 s_2 p_1 p_2
|
|
|
|
! ivl = 1..4 s p_x p_z p_y
|
|
|
|
!
|
|
|
|
|
|
|
|
ivs=indv(iv,is)
|
|
|
|
jvs=indv(jv,is)
|
2006-03-07 18:15:27 +08:00
|
|
|
if (ivs >= jvs) then
|
|
|
|
ijvs = ivs*(ivs-1)/2 + jvs
|
|
|
|
else
|
|
|
|
ijvs = jvs*(jvs-1)/2 + ivs
|
|
|
|
end if
|
|
|
|
! ijvs is the packed index for (ivs,jvs)
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
ivl=nhtolm(iv,is)
|
|
|
|
jvl=nhtolm(jv,is)
|
2006-03-07 18:15:27 +08:00
|
|
|
if (ivl > nlx .OR. jvl > nlx) &
|
|
|
|
call errore (' qvan2 ', ' wrong dimensions (2)', MAX(ivl,jvl))
|
|
|
|
!
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
dqg(:,:,:) = (0.d0, 0.d0)
|
|
|
|
|
|
|
|
! lpx = max number of allowed y_lm
|
|
|
|
! lp = composite lm to indentify them
|
|
|
|
|
|
|
|
do i=1,lpx(ivl,jvl)
|
|
|
|
lp=lpl(ivl,jvl,i)
|
|
|
|
if (lp > lmaxq*lmaxq) call errore(' dqvan2b ',' lp out of bounds ',lp)
|
|
|
|
|
|
|
|
! extraction of angular momentum l from lp:
|
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
|
|
|
! l = int ( sqrt( DBLE(l-1) + epsilon) ) + 1
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
!
|
|
|
|
if (lp == 1) then
|
|
|
|
l=1
|
|
|
|
else if ((lp >= 2) .and. (lp <= 4)) then
|
|
|
|
l=2
|
|
|
|
else if ((lp >= 5) .and. (lp <= 9)) then
|
|
|
|
l=3
|
|
|
|
else if ((lp >= 10).and.(lp <= 16)) then
|
|
|
|
l=4
|
|
|
|
else if ((lp >= 17).and.(lp <= 25)) then
|
|
|
|
l=5
|
|
|
|
else if ((lp >= 26).and.(lp <= 36)) then
|
|
|
|
l=6
|
|
|
|
else if ((lp >= 37).and.(lp <= 49)) then
|
|
|
|
l=7
|
|
|
|
else
|
|
|
|
call errore(' qvan2b ',' not implemented ',lp)
|
|
|
|
endif
|
|
|
|
!
|
|
|
|
! sig= (-i)^l
|
|
|
|
!
|
|
|
|
sig=(0.,-1.)**(l-1)
|
|
|
|
sig=sig*ap(lp,ivl,jvl)
|
|
|
|
do ij=1,3
|
|
|
|
do ii=1,3
|
|
|
|
do ig=1,ngy
|
|
|
|
dqg(ig,ii,ij) = dqg(ig,ii,ij) + sig * &
|
2006-04-07 22:54:20 +08:00
|
|
|
& ( ylm(ig,lp) * dqrad(ig,ijvs,l,is,ii,ij) - &
|
|
|
|
& dylm(ig,lp,ii,ij)*qradb(ig,ijvs,l,is) ) ! SEGNO
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
!
|
|
|
|
return
|
|
|
|
end subroutine dqvan2b
|
|
|
|
|
2003-01-20 05:58:50 +08:00
|
|
|
!-----------------------------------------------------------------------
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
subroutine dylmr2_( nylm, ngy, g, gg, ainv, dylm )
|
2004-04-21 18:33:55 +08:00
|
|
|
!-----------------------------------------------------------------------
|
|
|
|
!
|
2004-04-21 22:51:19 +08:00
|
|
|
! temporary CP interface for PW routine dylmr2
|
|
|
|
! dylmr2 calculates d Y_{lm} /d G_ipol
|
|
|
|
! dylmr2_ calculates G_ipol \sum_k h^(-1)(jpol,k) (dY_{lm} /dG_k)
|
2004-04-21 18:33:55 +08:00
|
|
|
!
|
2005-08-28 22:09:42 +08:00
|
|
|
USE kinds, ONLY: DP
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
|
2004-04-21 18:33:55 +08:00
|
|
|
implicit none
|
|
|
|
!
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
integer, intent(IN) :: nylm, ngy
|
2005-08-28 22:09:42 +08:00
|
|
|
real(DP), intent(IN) :: g (3, ngy), gg (ngy), ainv(3,3)
|
|
|
|
real(DP), intent(OUT) :: dylm (ngy, nylm, 3, 3)
|
2004-04-21 18:33:55 +08:00
|
|
|
!
|
2006-04-01 23:43:55 +08:00
|
|
|
integer :: ipol, jpol, lm, ig
|
2005-08-28 22:09:42 +08:00
|
|
|
real(DP), allocatable :: dylmaux (:,:,:)
|
2004-04-21 18:33:55 +08:00
|
|
|
!
|
|
|
|
allocate ( dylmaux(ngy,nylm,3) )
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
!
|
2004-04-21 18:33:55 +08:00
|
|
|
dylmaux(:,:,:) = 0.d0
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
!
|
2004-04-21 18:33:55 +08:00
|
|
|
do ipol =1,3
|
|
|
|
call dylmr2 (nylm, ngy, g, gg, dylmaux(1,1,ipol), ipol)
|
|
|
|
enddo
|
|
|
|
!
|
|
|
|
do ipol =1,3
|
|
|
|
do jpol =1,3
|
|
|
|
do lm=1,nylm
|
2006-04-01 23:43:55 +08:00
|
|
|
do ig = 1, ngy
|
|
|
|
dylm (ig,lm,ipol,jpol) = (dylmaux(ig,lm,1) * ainv(jpol,1) + &
|
|
|
|
dylmaux(ig,lm,2) * ainv(jpol,2) + &
|
|
|
|
dylmaux(ig,lm,3) * ainv(jpol,3) ) &
|
|
|
|
* g(ipol,ig)
|
|
|
|
end do
|
2004-04-21 18:33:55 +08:00
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
!
|
2004-04-21 18:33:55 +08:00
|
|
|
deallocate ( dylmaux )
|
- FPMD: pseudopotential variable wsg, wnl, fnl substituted with
dion, beta, bec everyware.
- subroutines formfn, compute_beta, nlsm1, nlsm2, ecc ... now are common
between FPMD and CPV, a lot of clean ups!
- Changes in stdout: relevant physical quantities ( positions velocities an cell )
are now printed with the seme format of the corresponding input card,
like in PW, as was suggested by SdG.
- exemple23 updated to reflect the new input namelist "wannier"
- Subroutine init_run now is used in FPMD too.
- WARNING in the stress computed with CP, for a pseudo with core-corrections,
a contribution is missing! Not yet fixed, I need to talk with PG for the
box staff.
- WARNING the examples reference are not updated, I'm on the IBM sp, and
I prefer to update them from a linux machine.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2110 c92efa57-630b-4861-b058-cf58834340f0
2005-08-22 22:14:13 +08:00
|
|
|
!
|
|
|
|
return
|
|
|
|
!
|
2004-04-21 18:33:55 +08:00
|
|
|
end subroutine dylmr2_
|