Added an input variable to SYSTEM namelist: tot_charge. The same information

could also be specified with a proper choise of nelec. The later option however
is more sensitive to human errors, especially when working on large systems
containing diverse elements (or when working in the middle of the night...) [silviu]


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2577 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
silviu 2005-12-12 00:17:09 +00:00
parent 6bb756b04b
commit aba8a4d2da
4 changed files with 15 additions and 5 deletions

View File

@ -836,7 +836,7 @@ MODULE input
etot_conv_thr, ekin_conv_thr, nspin, f_inp, nelup, neldw, nbnd, &
nelec, tprnks, ks_path, press, cell_damping, cell_dofree, tf_inp, &
refg, greash, grease, greasp, epol, efield, tcg, maxiter, etresh, &
passop
passop, tot_charge
!
USE input_parameters, ONLY : wf_efield, wf_switch, sw_len, efx0, efy0, &
efz0, efx1, efy1, efz1, wfsd, wfdt, maxwfdt, &
@ -1006,7 +1006,8 @@ MODULE input
CALL ks_states_init( nspin, tprnks, tprnks_empty )
CALL electrons_base_initval( zv, na_inp, ntyp, nelec, nelup, &
neldw, nbnd, nspin, occupations, f_inp )
neldw, nbnd, nspin, occupations, f_inp, &
tot_charge )
CALL electrons_setup( empty_states_nbnd, emass, emass_cutoff, nkstot )

View File

@ -210,6 +210,10 @@ nelec INTEGER
number of electron in the unit cell. If not specified it is
read from the pseudopotential
tot_charge INTEGER ( default = 0 )
total system charge. Used if nelec is not specified,
otherwise it is ignored.
nbnd INTEGER ( default = nelec / 2 )
number of electronic states (bands) to be calculated.

View File

@ -39,7 +39,7 @@
SUBROUTINE electrons_base_initval( zv_ , na_ , nsp_ , nelec_ , nelup_ , neldw_ , nbnd_ , &
nspin_ , occupations_ , f_inp )
nspin_ , occupations_ , f_inp, tot_charge_ )
USE constants, ONLY: eps8
USE io_global, ONLY: stdout
@ -51,7 +51,7 @@
INTEGER, INTENT(IN) :: nbnd_ , nspin_
CHARACTER(LEN=*), INTENT(IN) :: occupations_
REAL(DP), INTENT(IN) :: f_inp(:,:)
REAL(DP) :: nelec, nelup, neldw, ocp, fsum
REAL(DP) :: nelec, nelup, neldw, ocp, fsum, tot_charge_
INTEGER :: iss, i, in
nspin = nspin_
@ -63,6 +63,7 @@
DO i = 1, nsp_
nelec = nelec + na_ ( i ) * zv_ ( i )
END DO
nelec = nelec - tot_charge_
END IF
IF( nelup_ > 0.0d0 .AND. neldw_ > 0.0d0 ) THEN

View File

@ -337,6 +337,9 @@ MODULE input_parameters
! number of electrons, this parameter is MANDATORY in FPMD
! may be fractionary in PW, but not in CP and FPMD !
REAL(DP):: tot_charge = 0.0d0
! total system charge
REAL(DP) :: ecutwfc = 0.0d0
! energy cutoff for wave functions in k-space ( in Rydbergs )
! this parameter is MANDATORY in FPMD
@ -552,7 +555,8 @@ MODULE input_parameters
#endif
noncolin, lspinorb, lambda, angle1, angle2, report, &
constrained_magnetization, B_field, fixed_magnetization, &
sic, sic_epsilon, force_pairing, sic_alpha
sic, sic_epsilon, force_pairing, sic_alpha, &
tot_charge
!=----------------------------------------------------------------------------=!