Removed (again) masses in a.u. from global variables. BEWARE: I haven't

yet noticed any problem, but there will be for sure a few exotic 
cases that will have to be fixed



git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@8133 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
giannozz 2011-08-31 19:49:28 +00:00
parent e28120dcee
commit bbc4bdec01
16 changed files with 41 additions and 52 deletions

View File

@ -1,5 +1,6 @@
Incompatible changes in svn version:
* atomic masses are in amu unless otherwise stated
* Options 'cubic'/'hexagonal' to CELL_PARAMETERS removed: it is no
longer useful, the code will anyway find the correct sym.ops.
* Options 'bohr'/'angstrom'/'alat' to CELL_PARAMETERS implemented

View File

@ -25,7 +25,7 @@ SUBROUTINE phq_readin()
USE io_global, ONLY : ionode_id
USE mp, ONLY : mp_bcast
USE input_parameters, ONLY : max_seconds
USE ions_base, ONLY : amass, pmass, atm
USE ions_base, ONLY : amass, atm
USE klist, ONLY : xk, nks, nkstot, lgauss, two_fermi_energies
USE control_flags, ONLY : gamma_only, tqr, restart, lkpoint_dir
USE uspp, ONLY : okvan
@ -340,10 +340,6 @@ SUBROUTINE phq_readin()
atom_weight(atomic_number(TRIM(atm(it))))
IF (amass_input(it) > 0.D0) amass(it) = amass_input(it)
IF (amass(it) <= 0.D0) CALL errore ('phq_readin', 'Wrong masses', it)
!
! convert masses to a.u.
!
pmass(it) = amconv * amass(it)
ENDDO
lgamma_gamma=.FALSE.
IF (nkstot==1.OR.(nkstot==2.AND.nspin==2)) THEN

View File

@ -27,12 +27,10 @@
! zv(is) = (pseudo-)atomic charge
! amass(is) = mass of ions, in atomic mass units
! pmass(is) = mass of ions, in atomic units - TEMP: used by phonon
! rcmax(is) = Ewald radius (for ion-ion interactions)
REAL(DP) :: zv(ntypx) = 0.0_DP
REAL(DP) :: amass(ntypx) = 0.0_DP
REAL(DP) :: pmass(ntypx) = 0.0_DP
REAL(DP) :: rcmax(ntypx) = 0.0_DP
! ityp( i ) = the type of i-th atom in stdin

View File

@ -16,7 +16,7 @@ subroutine dyndia (xq, nmodes, nat, ntyp, ityp, amass, iudyn, dyn, w2)
!
USE kinds, only : DP
USE io_global, ONLY : stdout
USE constants, ONLY : RY_TO_THZ, RY_TO_CMM1
USE constants, ONLY : amconv, RY_TO_THZ, RY_TO_CMM1
USE io_dyn_mat, ONLY : write_dyn_mat_tail
USE control_ph, ONLY : xmldyn
implicit none
@ -60,7 +60,7 @@ subroutine dyndia (xq, nmodes, nat, ntyp, ityp, amass, iudyn, dyn, w2)
enddo
enddo
!
! divide the dynamical matrix by the masses
! divide the dynamical matrix by the masses (beware: amass is in amu)
!
do nu_i = 1, nmodes
na = (nu_i - 1) / 3 + 1
@ -68,7 +68,8 @@ subroutine dyndia (xq, nmodes, nat, ntyp, ityp, amass, iudyn, dyn, w2)
do nu_j = 1, nmodes
nb = (nu_j - 1) / 3 + 1
ntb = ityp (nb)
dyn (nu_i, nu_j) = dyn (nu_i, nu_j) / sqrt (amass (nta) * amass (ntb) )
dyn (nu_i, nu_j) = dyn (nu_i, nu_j) / sqrt (amass (nta)*amass (ntb)) &
/ amconv
enddo
enddo
!
@ -96,7 +97,7 @@ subroutine dyndia (xq, nmodes, nat, ntyp, ityp, amass, iudyn, dyn, w2)
unorm = 0.d0
do mu = 1, 3 * nat
na = (mu - 1) / 3 + 1
dyn (mu, nu_i) = z (mu, nu_i) / sqrt (amass (ityp (na) ) )
dyn (mu, nu_i) = z (mu, nu_i) / sqrt (amconv * amass (ityp (na) ) )
unorm = unorm + dyn (mu, nu_i) * CONJG(dyn (mu, nu_i) )
enddo
if (iudyn /= 0) then

View File

@ -17,7 +17,7 @@ subroutine dynmatrix
!
USE kinds, ONLY : DP
USE constants, ONLY : FPI, BOHR_RADIUS_ANGS
USE ions_base, ONLY : nat, ntyp => nsp, ityp, tau, atm, pmass, zv
USE ions_base, ONLY : nat, ntyp => nsp, ityp, tau, atm, amass, zv
USE io_global, ONLY : stdout
USE control_flags, ONLY : modenum
USE cell_base, ONLY : at, bg, celldm, ibrav, omega
@ -148,11 +148,11 @@ subroutine dynmatrix
IF (imq==0) nqq=2*nq
IF (lgamma.AND.done_epsil.AND.done_zeu) THEN
CALL write_dyn_mat_header( fildyn, ntyp, nat, ibrav, nspin_mag, &
celldm, at, bg, omega, atm, pmass, tau, ityp, m_loc, &
celldm, at, bg, omega, atm, amass, tau, ityp, m_loc, &
nqq, epsilon, zstareu, lraman, ramtns*omega/fpi*convfact)
ELSE
CALL write_dyn_mat_header( fildyn, ntyp, nat, ibrav, nspin_mag, &
celldm, at, bg, omega, atm, pmass, tau,ityp,m_loc,nqq)
celldm, at, bg, omega, atm, amass, tau,ityp,m_loc,nqq)
ENDIF
ELSE
CALL write_old_dyn_mat(iudyn)
@ -209,9 +209,9 @@ subroutine dynmatrix
! Diagonalizes the dynamical matrix at q
!
IF (ldiag_loc) THEN
call dyndia (xq, nmodes, nat, ntyp, ityp, pmass, iudyn, dyn, w2)
call dyndia (xq, nmodes, nat, ntyp, ityp, amass, iudyn, dyn, w2)
IF (search_sym) CALL find_mode_sym (dyn, w2, at, bg, tau, nat, nsymq, sr,&
irt, xq, rtau, pmass, ntyp, ityp, 1, lgamma, lgamma_gamma, &
irt, xq, rtau, amass, ntyp, ityp, 1, lgamma, lgamma_gamma, &
nspin_mag, name_rap_mode, num_rap_mode)
END IF
!
@ -233,7 +233,8 @@ end subroutine dynmatrix
! It will be removed when the xml file format of the dynamical matrix
! will be tested.
!
USE ions_base, ONLY : ntyp => nsp, nat, ityp, tau, atm, pmass
USE constants, ONLY: amconv
USE ions_base, ONLY : ntyp => nsp, nat, ityp, tau, atm, amass
USE cell_base, ONLY : ibrav, celldm, at
USE run_info, ONLY : title
@ -248,7 +249,7 @@ end subroutine dynmatrix
WRITE (iudyn,'(2x,3f15.9)') ((at(i,j),i=1,3),j=1,3)
END IF
DO nt = 1, ntyp
WRITE (iudyn, * ) nt, ' ''', atm (nt) , ' '' ', pmass (nt)
WRITE (iudyn, * ) nt, ' ''', atm (nt) , ' '' ', amconv*amass(nt)
ENDDO
DO na = 1, nat
WRITE (iudyn, '(2i5,3f15.7)') na, ityp (na) , (tau (j, na) , j = 1, 3)

View File

@ -14,7 +14,7 @@ SUBROUTINE elphon()
!
USE kinds, ONLY : DP
USE cell_base, ONLY : celldm, omega, ibrav
USE ions_base, ONLY : nat, ntyp => nsp, ityp, tau, pmass
USE ions_base, ONLY : nat, ntyp => nsp, ityp, tau, amass
USE gvecs, ONLY: doublegrid
USE fft_base, ONLY : dfftp, dffts
USE noncollin_module, ONLY : nspin_mag
@ -67,7 +67,7 @@ SUBROUTINE elphon()
! calculated in a previous run
!
IF (.NOT.trans) CALL readmat (iudyn, ibrav, celldm, nat, ntyp, &
ityp, omega, pmass, tau, xq, w2, dyn)
ityp, omega, amass, tau, xq, w2, dyn)
!
CALL stop_clock ('elphon')
RETURN

View File

@ -14,7 +14,7 @@ SUBROUTINE ep_matrix_element_wannier()
!
USE kinds, ONLY : DP
USE cell_base, ONLY : celldm, omega, ibrav
USE ions_base, ONLY : nat, ntyp => nsp, ityp, tau, pmass
USE ions_base, ONLY : nat, ntyp => nsp, ityp, tau, amass
USE gvecs, ONLY: doublegrid
USE fft_base, ONLY : dfftp, dffts
USE noncollin_module, ONLY : nspin_mag
@ -138,7 +138,7 @@ SUBROUTINE ep_matrix_element_wannier()
! calculated in a previous run
!
IF (.NOT.trans) CALL readmat (iudyn, ibrav, celldm, nat, ntyp, &
ityp, omega, pmass, tau, xq, w2, dyn)
ityp, omega, amass, tau, xq, w2, dyn)
!
deallocate(xk_gamma)
deallocate(kpq,g_kpq,igqg)

View File

@ -1,5 +1,5 @@
!
! Copyright (C) 2006 Quantum ESPRESSO group
! Copyright (C) 2006-2011 Quantum ESPRESSO group
! This file is distributed under the terms of the
! GNU General Public License. See the file `License'
! in the root directory of the present distribution,
@ -18,7 +18,7 @@ SUBROUTINE find_mode_sym (u, w2, at, bg, tau, nat, nsym, sr, irt, xq, &
!
USE io_global, ONLY : stdout
USE kinds, ONLY : DP
USE constants, ONLY : RY_TO_CMM1
USE constants, ONLY : amconv, RY_TO_CMM1
USE rap_point_group, ONLY : code_group, nclass, nelem, elem, which_irr, &
char_mat, name_rap, name_class, gname, ir_ram
USE rap_point_group_is, ONLY : gname_is
@ -84,11 +84,12 @@ SUBROUTINE find_mode_sym (u, w2, at, bg, tau, nat, nsym, sr, irt, xq, &
IF (flag==1) THEN
!
! Find the eigenvalues of the dynmaical matrix
! Note that amass is in amu; amconv converts it to Ry au
!
DO nu_i = 1, nmodes
DO mu = 1, nmodes
na = (mu - 1) / 3 + 1
z (mu, nu_i) = u (mu, nu_i) * SQRT (amass (ityp (na) ) )
z (mu, nu_i) = u (mu, nu_i) * SQRT (amconv*amass (ityp (na) ) )
END DO
END DO
ELSE

View File

@ -16,7 +16,7 @@ subroutine init_representations()
!
!
USE kinds, ONLY : DP
USE ions_base, ONLY : tau, nat, ntyp => nsp, ityp, pmass
USE ions_base, ONLY : tau, nat, ntyp => nsp, ityp, amass
USE cell_base, ONLY : at, bg
USE io_global, ONLY : stdout
USE symm_base, ONLY : nrot, nsym, sr, ftau, irt, t_rev, time_reversal, &
@ -91,7 +91,7 @@ subroutine init_representations()
call set_irr (nat, at, bg, xq, s, sr, tau, ntyp, ityp, ftau, invs, &
nsym, rtau, irt, irgq, nsymq, minus_q, irotmq, u, npert, &
nirr, gi, gimq, iverbosity, u_from_file, w2, search_sym, &
nspin_mag, t_rev, pmass, num_rap_mode, name_rap_mode)
nspin_mag, t_rev, amass, num_rap_mode, name_rap_mode)
npertx = 0
DO irr = 1, nirr
npertx = max (npertx, npert (irr) )

View File

@ -230,10 +230,6 @@ PROGRAM matdyn
CALL mp_bcast(la2f,ionode_id)
CALL mp_bcast(q_in_band_form,ionode_id)
!
! convert masses to atomic units
!
amass(:) = amass(:) * amconv
!
! read force constants
!
ntyp_blk = ntypx ! avoids fake out-of-bound error
@ -2224,8 +2220,8 @@ subroutine readfg ( ifn, nr1, nr2, nr3, nat, frcg )
end subroutine readfg
!
!
SUBROUTINE find_representations_mode_q( nat, ntyp, xq, w2, u, tau, ityp, pmass,&
name_rap_mode, num_rap_mode, nspin_mag )
SUBROUTINE find_representations_mode_q ( nat, ntyp, xq, w2, u, tau, ityp, &
amass, name_rap_mode, num_rap_mode, nspin_mag )
USE kinds, ONLY : DP
USE cell_base, ONLY : at, bg
@ -2235,7 +2231,7 @@ SUBROUTINE find_representations_mode_q( nat, ntyp, xq, w2, u, tau, ityp, pmass,&
IMPLICIT NONE
INTEGER, INTENT(IN) :: nat, ntyp, nspin_mag
REAL(DP), INTENT(IN) :: xq(3), pmass(ntyp), tau(3,nat)
REAL(DP), INTENT(IN) :: xq(3), amass(ntyp), tau(3,nat)
REAL(DP), INTENT(IN) :: w2(3*nat)
INTEGER, INTENT(IN) :: ityp(nat)
COMPLEX(DP), INTENT(IN) :: u(3*nat,3*nat)
@ -2277,7 +2273,7 @@ SUBROUTINE find_representations_mode_q( nat, ntyp, xq, w2, u, tau, ityp, pmass,&
sym (1:nsym) = .TRUE.
CALL sgam_ph (at, bg, nsym, s, irt, tau, rtau, nat, sym)
CALL find_mode_sym (u, w2, at, bg, tau, nat, nsymq, sr, irt, xq, rtau, &
pmass, ntyp, ityp, 1, .FALSE., .FALSE., &
amass, ntyp, ityp, 1, .FALSE., .FALSE., &
nspin_mag, name_rap_mode, num_rap_mode)
ENDIF
RETURN

View File

@ -22,7 +22,7 @@ SUBROUTINE phq_readin()
USE ions_base, ONLY : nat, ntyp => nsp
USE io_global, ONLY : ionode_id
USE mp, ONLY : mp_bcast
USE ions_base, ONLY : amass, pmass, atm
USE ions_base, ONLY : amass, atm
USE input_parameters, ONLY : max_seconds, nk1, nk2, nk3, k1, k2, k3
USE start_k, ONLY : reset_grid
USE klist, ONLY : xk, nks, nkstot, lgauss, two_fermi_energies, lgauss
@ -467,10 +467,6 @@ SUBROUTINE phq_readin()
atom_weight(atomic_number(TRIM(atm(it))))
IF (amass_input(it) > 0.D0) amass(it) = amass_input(it)
IF (amass(it) <= 0.D0) CALL errore ('phq_readin', 'Wrong masses', it)
!
! convert masses to a.u.
!
pmass(it) = amconv * amass(it)
ENDDO
lgamma_gamma=.FALSE.
IF (.NOT.ldisp) THEN

View File

@ -51,7 +51,7 @@ subroutine phq_setup
!
!
USE kinds, ONLY : DP
USE ions_base, ONLY : tau, nat, ntyp => nsp, ityp, pmass
USE ions_base, ONLY : tau, nat, ntyp => nsp, ityp, amass
USE cell_base, ONLY : at, bg
USE io_global, ONLY : stdout
USE ener, ONLY : ef, ef_up, ef_dw
@ -352,7 +352,7 @@ subroutine phq_setup
call set_irr (nat, at, bg, xq, s, sr, tau, ntyp, ityp, ftau, invs,&
nsym, rtau, irt, irgq, nsymq, minus_q, irotmq, u, npert, &
nirr, gi, gimq, iverbosity, u_from_file, w2, search_sym, &
nspin_mag, t_rev, pmass, num_rap_mode, name_rap_mode)
nspin_mag, t_rev, amass, num_rap_mode, name_rap_mode)
npertx = 0
DO irr = 1, nirr
npertx = max (npertx, npert (irr) )

View File

@ -222,6 +222,7 @@ subroutine dyndiag (nat,ntyp,amass,ityp,dyn,w2,z)
! On output: w2 = energies, z = displacements
!
use kinds, only: dp
use constants, only: amconv
implicit none
! input
integer nat, ntyp, ityp(nat)
@ -280,7 +281,7 @@ subroutine dyndiag (nat,ntyp,amass,ityp,dyn,w2,z)
do jpol = 1,3
dyn2((na-1)*3+ipol, (nb-1)*3+jpol) = &
dyn2((na-1)*3+ipol, (nb-1)*3+jpol) / &
sqrt(amass(nta)*amass(ntb))
(amconv*sqrt(amass(nta)*amass(ntb)))
end do
end do
end do
@ -298,7 +299,7 @@ subroutine dyndiag (nat,ntyp,amass,ityp,dyn,w2,z)
do na = 1,nat
nta = ityp(na)
do ipol = 1,3
z((na-1)*3+ipol,i) = z((na-1)*3+ipol,i)/ sqrt(amass(nta))
z((na-1)*3+ipol,i) = z((na-1)*3+ipol,i)/ sqrt(amconv*amass(nta))
end do
end do
end do

View File

@ -10,7 +10,7 @@
subroutine set_irr (nat, at, bg, xq, s, sr, tau, ntyp, ityp, ftau, invs, nsym, &
rtau, irt, irgq, nsymq, minus_q, irotmq, u, npert, &
nirr, gi, gimq, iverbosity, u_from_file, eigen, search_sym,&
nspin_mag, t_rev, pmass, num_rap_mode, name_rap_mode)
nspin_mag, t_rev, amass, num_rap_mode, name_rap_mode)
!---------------------------------------------------------------------
!
! This subroutine computes a basis for all the irreducible
@ -67,7 +67,7 @@ subroutine set_irr (nat, at, bg, xq, s, sr, tau, ntyp, ityp, ftau, invs, nsym, &
! output: the number of the representation of each mode
real(DP) :: xq (3), rtau (3, 48, nat), at (3, 3), bg (3, 3), &
gi (3, 48), gimq (3), sr(3,3,48), tau(3,nat), pmass(ntyp)
gi (3, 48), gimq (3), sr(3,3,48), tau(3,nat), amass(ntyp)
! input: the q point
! input: the R associated to each tau
! input: the direct lattice vectors
@ -76,7 +76,7 @@ subroutine set_irr (nat, at, bg, xq, s, sr, tau, ntyp, ityp, ftau, invs, nsym, &
! output: [S(irotmq)*q + q]
! input: symmetry matrices in cartesian coordinates
! input: the atomic positions
! input: the mass of each atom
! input: the mass of each atom (in amu)
complex(DP) :: u(3*nat, 3*nat)
! output: the pattern vectors
@ -208,7 +208,7 @@ subroutine set_irr (nat, at, bg, xq, s, sr, tau, ntyp, ityp, ftau, invs, nsym, &
IF (search_sym) THEN
CALL find_mode_sym (u, eigen, at, bg, tau, nat, nsymq, &
sr, irt, xq, rtau, pmass, ntyp, ityp, 0, lgamma, &
sr, irt, xq, rtau, amass, ntyp, ityp, 0, lgamma, &
.FALSE., nspin_mag, name_rap_mode, num_rap_mode )
!
! Order the modes so that we first make all those that belong to the first

2
TODO
View File

@ -13,7 +13,6 @@ TODO LIST - August 2011
1.0.0 At least Debian/RPM for Linux
1.1 www.quantum-espresso.org:
1.1.0 Better download page that allows selection of packages
(see 1.3.0)
1.1.1 move to wordpress or whatever gives to developers better access
to the contents
1.1.2 Move all contents of wiki into the new web site
@ -93,7 +92,6 @@ TODO LIST - August 2011
confusing and contains some suspect values.
4.0.5 Martyna-Tuckerman has to be extended to any system dimensionality and to exx, using
coulomb_vcut trick.
4.0.6 Better restart for Exx. Exx should restart from any stop point.
4.1 New developments to be added (sooner or later):
4.1.1 Moka structure builder + new xml input/output (RS)

View File

@ -24,7 +24,7 @@ TMP_DIR=$HOME/tmp
# needed if some PP has to be downloaded from web site
WGET="wget -O"
# for machines that do not have wget (e.g. Mac OS-X)
WGET="curl -o"
#WGET="curl -o"
# To run the ESPRESSO programs on a parallel machine, you may have to
# add the appropriate commands (poe, mpirun, mpprun...) and/or options
@ -38,5 +38,5 @@ WGET="curl -o"
# To run on a single processor, you can usually leave them empty.
#PARA_PREFIX="mpirun -np 2"
PARA_PREFIX=" "
PARA_PREFIX="env OMP_NUM_THREADS=1 "
PARA_POSTFIX=