Skip to content

Commit 5eb2438

Browse files
authored
Merge branch 'develop' into refactor_libxc
2 parents 35d90df + 870f01e commit 5eb2438

File tree

140 files changed

+1114
-1205
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+1114
-1205
lines changed

docs/advanced/input_files/input-main.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,6 @@
366366
- [vion\_in\_h](#vion_in_h)
367367
- [test\_force](#test_force)
368368
- [test\_stress](#test_stress)
369-
- [colour](#colour)
370369
- [test\_skip\_ewald](#test_skip_ewald)
371370
- [Electronic conductivities](#electronic-conductivities)
372371
- [cal\_cond](#cal_cond)
@@ -3506,8 +3505,6 @@ These variables are used to control berry phase and wannier90 interface paramete
35063505
- 1: Yes.
35073506
- **Default**: 0
35083507

3509-
### colour
3510-
35113508
- **Type**: Boolean
35123509
- **Description**: Specify whether to set the colorful output in terminal.
35133510
- 0: No.

source/driver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ void Driver::reading()
156156
// parallelization.
157157
Parallel_Global::init_pools(GlobalV::NPROC,
158158
GlobalV::MY_RANK,
159-
GlobalV::NSTOGROUP,
159+
PARAM.inp.bndpar,
160160
GlobalV::KPAR,
161161
GlobalV::NPROC_IN_STOGROUP,
162162
GlobalV::RANK_IN_STOGROUP,

source/module_base/global_file.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ void ModuleBase::Global_File::make_dir_out(
7575
#ifdef __MPI
7676
Parallel_Reduce::reduce_all(make_dir);
7777
#endif
78-
if(make_dir>0)break;
78+
if(make_dir>0) {break;
79+
}
7980
++times;
8081
}
8182

@@ -112,7 +113,8 @@ void ModuleBase::Global_File::make_dir_out(
112113
#ifdef __MPI
113114
Parallel_Reduce::reduce_all(make_dir_stru);
114115
#endif
115-
if(make_dir_stru>0) break;
116+
if(make_dir_stru>0) { break;
117+
}
116118
++times;
117119
}
118120

@@ -151,7 +153,8 @@ void ModuleBase::Global_File::make_dir_out(
151153
#ifdef __MPI
152154
Parallel_Reduce::reduce_all(make_dir_matrix);
153155
#endif
154-
if(make_dir_matrix>0) break;
156+
if(make_dir_matrix>0) { break;
157+
}
155158
++times;
156159
}
157160

source/module_base/global_variable.cpp

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -24,34 +24,22 @@ int NLOCAL = 0; // total number of local basis.
2424
int NSPIN = 1; // LDA
2525
bool TWO_EFERMI = false; // two fermi energy, exist only magnetization is fixed.
2626
double nupdown = 0.0;
27-
double FORCE_THR = 1.0e-3;
2827
bool CAL_STRESS = false;
29-
double PRESSURE = 0.0;
3028
std::string RELAX_METHOD = "bfgs";
31-
std::string OUT_LEVEL = "ie";
32-
bool relax_new = true;
33-
bool fixed_atoms = false;
34-
int SCF_NMAX = 100;
3529

36-
bool use_paw = false;
3730
bool use_uspp = false;
38-
bool double_grid = false;
3931
std::string KS_SOLVER = "cg"; // xiaohui add 2013-09-01
4032
double SEARCH_RADIUS = -1.0;
4133

42-
int PW_DIAG_NMAX = 30;
4334
int PW_DIAG_NDIM = 4;
4435
double PW_DIAG_THR = 1.0e-2;
4536
int NB2D = 1;
4637

47-
int SCF_THR_TYPE = 1;
4838

4939
double DQ = 0.010; // space between Q points of the reciprocal radial tab
5040
int NQX = 10000; // number of points describing reciprocal radial tab
5141
int NQXQ = 10000; // number of points describing reciprocal radial tab for Q
5242

53-
bool COLOUR = false;
54-
bool GAMMA_ONLY_LOCAL = false; // mohan add 2010-10-20
5543
bool GAMMA_ONLY_PW = false; // mohan add 2012-06-05
5644

5745
int ZEEMAN_IN_H = 1;
@@ -65,7 +53,6 @@ bool out_mul = false; // qifeng add 2019/9/10
6553
int NPROC = 1; ///< global number of process
6654
int KPAR = 1; ///< global number of pools
6755
int KPAR_LCAO = 1; ///< global number of pools for LCAO diagonalization only
68-
int NSTOGROUP = 1;
6956
int MY_RANK = 0; ///< global index of process
7057
int MY_POOL = 0; ///< global index of pool (count in pool)
7158
int MY_STOGROUP = 0;
@@ -145,7 +132,6 @@ bool DOMAG = false;
145132
bool DOMAG_Z = false;
146133
int NPOL = 1;
147134

148-
bool FINAL_SCF = false; // LiuXh add 20180619
149135

150136
bool deepks_out_labels = false; // caoyu add 2021-10-16 for DeePKS, wenfei 2022-1-16
151137
bool deepks_scf = false; // caoyu add 2021-10-16 for DeePKS, wenfei 2022-1-16
@@ -157,44 +143,13 @@ bool deepks_equiv = false;
157143
bool deepks_setorb = false;
158144

159145

160-
bool imp_sol = false; // implicit solvation. sunml added 2022-04-04
161-
double eb_k = 80.0;
162146

163-
int dft_plus_u = 0; // DFTU control
164147

165148
// Xinyang Dong added for rpa
166-
bool rpa_setorb = false;
167149
std::vector<std::string> rpa_orbitals;
168150

169-
std::string of_kinetic = "wt";
170-
std::string of_method = "tn";
171-
std::string of_conv = "energy";
172-
double of_tole = 2e-6;
173-
double of_tolp = 1e-5;
174-
double of_tf_weight = 1.;
175-
double of_vw_weight = 1.;
176-
double of_wt_alpha = 5. / 6.;
177-
double of_wt_beta = 5. / 6.;
178-
double of_wt_rho0 = 0.;
179-
bool of_hold_rho0 = false;
180-
double of_lkt_a = 1.3;
181-
bool of_full_pw = true;
182-
int of_full_pw_dim = 0;
183-
bool of_read_kernel = false;
184-
std::string of_kernel_file = "WTkernel.txt";
185151

186152
// mixing parameters
187-
std::string MIXING_MODE = "broyden";
188-
double MIXING_BETA = 0.7;
189-
int MIXING_NDIM = 8;
190-
double MIXING_RESTART = 0.0;
191-
double MIXING_GG0 = 1.00;
192-
double MIXING_BETA_MAG = 1.6;
193-
double MIXING_GG0_MAG = 1.00;
194-
double MIXING_GG0_MIN = 0.1;
195-
double MIXING_ANGLE = 0.0;
196-
bool MIXING_TAU = false;
197-
bool MIXING_DMR = false;
198153

199154
//==========================================================
200155
// device flags added by denghui
@@ -203,30 +158,20 @@ std::string device_flag = "unknown";
203158
//==========================================================
204159
// precision flags added by denghui
205160
//==========================================================
206-
std::string precision_flag = "unknown";
207161

208-
std::string chg_extrap = "";
209162
int out_pot = 0;
210163

211-
std::string init_chg = "";
212164

213-
std::string init_wfc = "atomic";
214-
bool psi_initializer = false;
215165

216166
double nelec = 0;
217-
bool out_bandgap = false; // QO added for bandgap printing
218167

219168
//==========================================================
220169
// Deltaspin related
221170
//==========================================================
222-
double sc_thr = 1.0e-6;
223171

224172
//==========================================================
225173
// Quasiatomic orbital related
226174
//==========================================================
227-
double qo_thr = 1.0e-6;
228-
std::vector<double> qo_screening_coeff = {};
229175

230176
// on-site orbitals
231-
double onsite_radius = 0.0;
232177
} // namespace GlobalV

source/module_base/global_variable.h

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,14 @@ extern int NSPIN; // 7
2525
extern bool TWO_EFERMI; // 7.5 two fermi energy, exist if nupdown isn't zero.
2626
extern double nupdown;
2727

28-
extern double FORCE_THR; // 8.2
2928
extern bool CAL_STRESS; // 8.25 calcualte the stress
3029

31-
extern double PRESSURE;
3230
extern std::string RELAX_METHOD;
33-
extern std::string OUT_LEVEL;
3431

35-
extern bool relax_new;
3632

37-
extern bool use_paw;
3833
extern bool use_uspp;
39-
extern bool double_grid;
4034

41-
extern bool fixed_atoms;
4235

43-
extern int SCF_NMAX; // 8.4
4436

4537
extern std::string KS_SOLVER; // xiaohui add 2013-09-01
4638
extern double SEARCH_RADIUS; // 11.1 // mohan add 2011-03-10
@@ -52,20 +44,16 @@ extern bool DOMAG; // 1 : calculate the magnetism with x, y, z component
5244
extern bool DOMAG_Z; // 1 : constrain the magnetism to z axis
5345
extern int NPOL; // 1 : no soc; 2 : has soc
5446

55-
extern int PW_DIAG_NMAX; // 13
5647
extern int PW_DIAG_NDIM; // 14
5748
extern double PW_DIAG_THR; // 15 pw_diag_thr
5849
extern int NB2D; // 16.5 dividsion of 2D_matrix.
5950

60-
extern int SCF_THR_TYPE; // type of the criterion of scf_thr, 1: reci drho for
6151
// pw, 2: real drho for lcao
6252

6353
extern double DQ; // 19 mohan add 2009-09-10
6454
extern int NQX; // 20 mohan add 2009-09-10
6555
extern int NQXQ; // liuyu add 2023-10-03
6656

67-
extern bool COLOUR; // mohan add 2011-04-26
68-
extern bool GAMMA_ONLY_LOCAL; // 22 : mohan add 2010-10-20
6957
extern bool GAMMA_ONLY_PW; // mohan add 2012-06-05
7058

7159

@@ -87,7 +75,6 @@ extern bool GAMMA_ONLY_PW; // mohan add 2012-06-05
8775
//========================================================================
8876
extern int NPROC;
8977
extern int KPAR;
90-
extern int NSTOGROUP;
9178
extern int MY_RANK;
9279
extern int MY_POOL;
9380
extern int MY_STOGROUP;
@@ -176,7 +163,6 @@ extern int test_relax_method;
176163
//==========================================================
177164
extern int test_deconstructor;
178165

179-
extern bool FINAL_SCF; // LiuXh add 20180619
180166

181167
extern bool deepks_out_labels; // (need libnpy) prints energy and force labels
182168
// and descriptors for training, wenfei 2022-1-12
@@ -193,27 +179,12 @@ extern bool deepks_setorb;
193179

194180

195181
// implicit solvation
196-
extern bool imp_sol; // sunml added 2022-04-04
197-
extern double eb_k;
198182

199183
// DFTU control
200-
extern int dft_plus_u;
201184
// rpa related
202-
extern bool rpa_setorb;
203185
extern std::vector<std::string> rpa_orbitals;
204186

205187
// mixing parameters
206-
extern std::string MIXING_MODE;
207-
extern double MIXING_BETA;
208-
extern int MIXING_NDIM;
209-
extern double MIXING_RESTART;
210-
extern double MIXING_GG0;
211-
extern bool MIXING_TAU;
212-
extern double MIXING_BETA_MAG;
213-
extern double MIXING_GG0_MAG;
214-
extern double MIXING_GG0_MIN;
215-
extern double MIXING_ANGLE;
216-
extern bool MIXING_DMR;
217188

218189
//==========================================================
219190
// device flags added by denghui
@@ -222,31 +193,21 @@ extern std::string device_flag;
222193
//==========================================================
223194
// precision flags added by denghui
224195
//==========================================================
225-
extern std::string precision_flag;
226196

227-
extern std::string chg_extrap;
228197
extern int out_pot;
229198

230-
extern std::string init_chg; // output charge if out_chg > 0, and output every
231199
// "out_chg" elec step.
232200
/// @brief method to initialize wavefunction
233201
/// @author kirk0830, 20230920
234-
extern std::string init_wfc;
235202
/// @brief whether use the new psi initializer to initialize psi
236203
/// @author ykhuang, 20230920
237-
extern bool psi_initializer;
238204

239205
extern double nelec;
240-
extern bool out_bandgap;
241206

242207
// Deltaspin related
243-
extern double sc_thr;
244208

245209
// Quasiatomic orbital related
246-
extern double qo_thr;
247-
extern std::vector<double> qo_screening_coeff;
248210

249211
// radius of on-site orbitals
250-
extern double onsite_radius;
251212
} // namespace GlobalV
252213
#endif

source/module_base/tool_quit.cpp

Lines changed: 13 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "tool_quit.h"
2-
32
#ifdef __MPI
43
#include "mpi.h"
54
#endif
@@ -52,10 +51,6 @@ void QUIT(int ret)
5251

5352
ModuleBase::Global_File::close_all_log(GlobalV::MY_RANK);
5453

55-
//if (GlobalV::MY_RANK==0)
56-
//{
57-
// ModuleBase::Memory::print_all( GlobalV::ofs_running ) ;
58-
//}
5954
std::cout<<" See output information in : "<<GlobalV::global_out_dir<<std::endl;
6055
#endif
6156

@@ -72,39 +67,11 @@ void WARNING_QUIT(const std::string &file,const std::string &description,int ret
7267
{
7368
#ifdef __NORMAL
7469

75-
std::cout << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
76-
std::cout << " NOTICE " << std::endl;
77-
std::cout << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
70+
std::cout << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
71+
std::cout << " NOTICE " << std::endl;
72+
std::cout << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
7873

7974
#else
80-
81-
//std::cout<<" ----------- SOMETHING TO WARN YOU ! -------" << std::endl;
82-
// 41: red background
83-
// 42: green background
84-
// 31: red
85-
// 32: greem
86-
// 33: yellow
87-
// 34: blue
88-
// 35: zi
89-
// 36: qing
90-
// 37: white
91-
if(GlobalV::COLOUR)
92-
{
93-
//printf( "\e[32m%s\e[0m\n", " -------------- SOMETHING TO WARN YOU ! ------------");
94-
//printf( " \e[32m%s\e[0m\n", description.c_str());
95-
//printf( " \e[32m%s\e[0m", "CHECK IN FILE : ");
96-
//printf( "\e[32m%s\e[0m", GlobalV::global_out_dir.c_str());
97-
//printf( "\e[32m%s\e[0m\n", "warning.log");
98-
//printf( "\e[32m%s\e[0m\n", " ---------------------------------------------------");
99-
printf( "[32m%s[0m\n", " -------------- SOMETHING TO WARN YOU ! ------------");
100-
printf( " [32m%s[0m\n", description.c_str());
101-
printf( " [32m%s[0m", "CHECK IN FILE : ");
102-
printf( "[32m%s[0m", GlobalV::global_out_dir.c_str());
103-
printf( "[32m%s[0m\n", "warning.log");
104-
printf( "[32m%s[0m\n", " ---------------------------------------------------");
105-
}
106-
else
107-
{
10875
std::cout << " " << std::endl;
10976
std::cout << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
11077
std::cout << " NOTICE " << std::endl;
@@ -118,17 +85,16 @@ void WARNING_QUIT(const std::string &file,const std::string &description,int ret
11885
std::cout << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
11986

12087

121-
GlobalV::ofs_running << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
122-
GlobalV::ofs_running << " NOTICE " << std::endl;
123-
GlobalV::ofs_running << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
124-
GlobalV::ofs_running << std::endl;
125-
GlobalV::ofs_running << " " << description << std::endl;
126-
GlobalV::ofs_running << " CHECK IN FILE : " << GlobalV::global_out_dir << "warning.log" << std::endl;
127-
GlobalV::ofs_running << std::endl;
128-
GlobalV::ofs_running << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
129-
GlobalV::ofs_running << " NOTICE " << std::endl;
130-
GlobalV::ofs_running << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
131-
}
88+
GlobalV::ofs_running << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
89+
GlobalV::ofs_running << " NOTICE " << std::endl;
90+
GlobalV::ofs_running << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
91+
GlobalV::ofs_running << std::endl;
92+
GlobalV::ofs_running << " " << description << std::endl;
93+
GlobalV::ofs_running << " CHECK IN FILE : " << GlobalV::global_out_dir << "warning.log" << std::endl;
94+
GlobalV::ofs_running << std::endl;
95+
GlobalV::ofs_running << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
96+
GlobalV::ofs_running << " NOTICE " << std::endl;
97+
GlobalV::ofs_running << " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
13298

13399
WARNING(file,description);
134100
GlobalV::ofs_running<<" Check in file : "<<GlobalV::global_out_dir<<"warning.log"<<std::endl;

0 commit comments

Comments
 (0)