Skip to content

Commit

Permalink
Fix: add warning_quit if some parameter is repeated in INPUT (deepmod…
Browse files Browse the repository at this point in the history
…eling#4639)

* Fix: add warning_quit if some parameters ar iseated in INPUT

* delete repeated parameters in INPUT

* delete repeated INPUT
  • Loading branch information
Qianruipku authored Jul 12, 2024
1 parent edc877f commit 5a5ff7f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
7 changes: 6 additions & 1 deletion source/module_io/read_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,13 @@ void ReadInput::read_txt_input(Parameter& param, const std::string& filename)
{
Input_Item* p_item = &(it->second);
this->readvalue_items.push_back(p_item);
if(p_item->is_read())
{
std::string warningstr = "The parameter " + p_item->label + " has been read twice.";
ModuleBase::WARNING_QUIT("ReadInput", warningstr);
}
// qianrui delete '/' 2024-07-10, because path has '/' head.
read_information(ifs, it->second.str_values, "#!");
read_information(ifs, p_item->str_values, "#!");
}
else
{
Expand Down
1 change: 0 additions & 1 deletion source/module_io/test/support/INPUT
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ nspin 1 #1: single spin; 2: up and down spin; 4: noncol
kspacing 0 #unit in 1/bohr, should be > 0, default is 0 which means read KPT file
min_dist_coef 0.2 #factor related to the allowed minimum distance between two atoms
nbands 8 #number of bands
nbands_sto 256 #number of stochastic bands
nbands_istate 5 #number of bands around Fermi level for get_pchg calulation
symmetry 1 #the control of symmetry
init_vel False #read velocity from STRU or not
Expand Down
1 change: 0 additions & 1 deletion tests/integrate/108_PW_RE_PINT_RKS/INPUT
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ suffix autotest
relax_nmax 100
force_thr_ev 0.01
stress_thr 1
out_stru 1
out_level ie
pseudo_rcut 10.0
pseudo_mesh 1
Expand Down
3 changes: 0 additions & 3 deletions tests/integrate/601_NO_TDDFT_vel_Si/INPUT
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@ scf_nmax 50
scf_thr 1e-6

ks_solver scalapack_gvx
basis_type lcao
gamma_only 0
md_nstep 2

mixing_type broyden
mixing_beta 0.7
mixing_gg0 0.0
scf_thr 1.0e-6

calculation md
esolver_type tddft
Expand Down

0 comments on commit 5a5ff7f

Please sign in to comment.