From 2e6d24bbfd97853521f272570144d5e607b40975 Mon Sep 17 00:00:00 2001 From: Iurii Timrov Date: Tue, 15 Dec 2020 13:33:19 +0100 Subject: [PATCH] Introduce a new input variable ethr_nscf in the turboEELS code. ethr_nscf is the threshold for the convergence of eigenvalues during the iterative diagonalization of the Hamiltonian in the non-self-consistent-field (NSCF) calculation at k and k+q points. Note, this quantity is NOT extensive. This new input variable was requested by Nils Holle. --- TDDFPT/Doc/INPUT_EELS.def | 9 +++++++++ TDDFPT/src/bcast_lr_input.f90 | 3 ++- TDDFPT/src/lr_readin.f90 | 5 +++-- TDDFPT/src/lr_setup_nscf.f90 | 5 +++-- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/TDDFPT/Doc/INPUT_EELS.def b/TDDFPT/Doc/INPUT_EELS.def index 9afa3933b..6ec77b8e3 100644 --- a/TDDFPT/Doc/INPUT_EELS.def +++ b/TDDFPT/Doc/INPUT_EELS.def @@ -214,6 +214,15 @@ input_description -distribution {Quantum Espresso} -package turboEELS -program t } } + var ethr_nscf -type REAL { + default { 1.D-11 } + info { + Threshold for the convergence of eigenvalues during + the iterative diagonalization of the Hamiltonian in + the non-self-consistent-field (NSCF) calculation at + k and k+q points. Note, this quantity is NOT extensive. + } + } } diff --git a/TDDFPT/src/bcast_lr_input.f90 b/TDDFPT/src/bcast_lr_input.f90 index 76a00c6b1..c7f5290ac 100644 --- a/TDDFPT/src/bcast_lr_input.f90 +++ b/TDDFPT/src/bcast_lr_input.f90 @@ -23,7 +23,7 @@ SUBROUTINE bcast_lr_input USE mp_global, ONLY: intra_image_comm USE mp_world, ONLY: world_comm USE qpoint, ONLY: xq - USE control_lr, ONLY: lrpa, alpha_mix + USE control_lr, ONLY: lrpa, alpha_mix, ethr_nscf IMPLICIT NONE ! @@ -56,6 +56,7 @@ SUBROUTINE bcast_lr_input CALL mp_bcast (d0psi_rs, ionode_id,world_comm ) CALL mp_bcast (lshift_d0psi, ionode_id,world_comm ) CALL mp_bcast (tddfpt, ionode_id, world_comm ) + CALL mp_bcast (ethr_nscf, ionode_id, world_comm ) CALL plugin_arguments_bcast(ionode_id, world_comm) ! for EELS diff --git a/TDDFPT/src/lr_readin.f90 b/TDDFPT/src/lr_readin.f90 index 7c290e05d..97fa5cf26 100644 --- a/TDDFPT/src/lr_readin.f90 +++ b/TDDFPT/src/lr_readin.f90 @@ -50,7 +50,7 @@ SUBROUTINE lr_readin USE io_rho_xml, ONLY : write_scf USE mp_bands, ONLY : ntask_groups USE constants, ONLY : eps4, rytoev - USE control_lr, ONLY : lrpa, alpha_mix + USE control_lr, ONLY : lrpa, alpha_mix, ethr_nscf USE mp_world, ONLY : world_comm IMPLICIT NONE @@ -75,7 +75,7 @@ SUBROUTINE lr_readin & charge_response, no_hxc, n_ipol, project, & & scissor, pseudo_hermitian, d0psi_rs, lshift_d0psi, & & q1, q2, q3, approximation, calculator, alpha_mix, start, & - & end, increment, epsil, units + & end, increment, epsil, units, ethr_nscf NAMELIST / lr_post / omeg, beta_gamma_z_prefix, w_T_npol, plot_type, epsil, itermax_int,sum_rule namelist / lr_dav / num_eign, num_init, num_basis_max, residue_conv_thr, precondition, & & dav_debug, reference,single_pole, sort_contr, diag_of_h, close_pre, & @@ -119,6 +119,7 @@ SUBROUTINE lr_readin project = .FALSE. max_seconds = 1.0E+7_DP scissor = 0.d0 + ethr_nscf = 1.D-11 ! ! For EELS ! diff --git a/TDDFPT/src/lr_setup_nscf.f90 b/TDDFPT/src/lr_setup_nscf.f90 index 7fe8eea9a..6dea4315a 100644 --- a/TDDFPT/src/lr_setup_nscf.f90 +++ b/TDDFPT/src/lr_setup_nscf.f90 @@ -33,6 +33,7 @@ SUBROUTINE lr_setup_nscf () USE wvfct, ONLY : nbnd, nbndx USE control_flags, ONLY : ethr, isolve, david, use_para_diag, & & noinv, max_cg_iter + USE control_lr, ONLY : ethr_nscf USE mp_pools, ONLY : kunit USE spin_orb, ONLY : domag USE noncollin_module, ONLY : noncolin @@ -51,9 +52,9 @@ SUBROUTINE lr_setup_nscf () ! IF ( .NOT. ALLOCATED( force ) ) ALLOCATE( force( 3, nat ) ) ! - ! ... threshold for diagonalization ethr - should be good for all cases + ! ... threshold for diagonalization ethr ! - ethr = 1.0D-9 / nelec + ethr = ethr_nscf ! ! ... variables for iterative diagonalization (Davidson is assumed) !