diff --git a/ABACUS.develop/source/Makefile.Objects b/ABACUS.develop/source/Makefile.Objects index e30467c719..65d4a468fd 100644 --- a/ABACUS.develop/source/Makefile.Objects +++ b/ABACUS.develop/source/Makefile.Objects @@ -88,6 +88,7 @@ sph_bessel_recursive-d1.o \ sph_bessel_recursive-d2.o \ global_variable.o \ global_function.o \ +title.o\ global_file.o \ element_basis_index.o \ restart.o \ diff --git a/ABACUS.develop/source/src_external/ORB_api/Makefile b/ABACUS.develop/source/src_external/ORB_api/Makefile index 637c9b3617..7052822570 100644 --- a/ABACUS.develop/source/src_external/ORB_api/Makefile +++ b/ABACUS.develop/source/src_external/ORB_api/Makefile @@ -26,7 +26,8 @@ OPTS_GDB = -g -W FP_OBJS_0=main.o\ $(OBJS_TRY)\ -$(OBJS_ORBITAL)\ +$(OBJS_GLOBAL)\ +#$(OBJS_ORBITAL)\ FP_OBJS=$(patsubst %.o, ${OBJ_DIR}/%.o, ${FP_OBJS_0}) PDIAG_OBJS=$(patsubst %.o, ${OBJ_DIR}/%.o, ${OBJS_PDIAG}) diff --git a/ABACUS.develop/source/src_external/ORB_api/Makefile.Objects b/ABACUS.develop/source/src_external/ORB_api/Makefile.Objects index cd8c50d06d..861a59fc29 100644 --- a/ABACUS.develop/source/src_external/ORB_api/Makefile.Objects +++ b/ABACUS.develop/source/src_external/ORB_api/Makefile.Objects @@ -32,4 +32,5 @@ ORB_gen_tables.o\ OBJS_GLOBAL=sph_bessel.o\ sph_bessel_recursive-d1.o\ sph_bessel_recursive-d2.o\ +title.o\ timer.o\ diff --git a/ABACUS.develop/source/src_global/global_function.cpp b/ABACUS.develop/source/src_global/global_function.cpp index 9ece417ad7..e1eccab2a1 100644 --- a/ABACUS.develop/source/src_global/global_function.cpp +++ b/ABACUS.develop/source/src_global/global_function.cpp @@ -17,43 +17,6 @@ #include using namespace std; -//========================================================== -// GLOBAL FUNCTION : -// NAME : TITLE( title for each function ) -//========================================================== -void TITLE(const string &class_function_name) -{ - return;//no output - cout<<" ==> "< "< "< "< "< "< #include +#include "title.h" // mohan add 2021-05-05 #include "global_variable.h" #include "global_function-func_each_2.h" // Peize Lin add 2016-09-07 using namespace std; -//========================================================== -// GLOBAL FUNCTION : -// NAME : TITLE( title for each function ) -//========================================================== -void TITLE(const string &class_function_name); -void TITLE(const string &class_name,const string &function_name); -void TITLE(ofstream &ofs,const string &class_name,const string &function_name); void NOTE(const string &words); void NEW_PART(const string &words); diff --git a/ABACUS.develop/source/src_global/mathzone_add1.cpp b/ABACUS.develop/source/src_global/mathzone_add1.cpp index c9907290f8..1dedb89df8 100644 --- a/ABACUS.develop/source/src_global/mathzone_add1.cpp +++ b/ABACUS.develop/source/src_global/mathzone_add1.cpp @@ -16,8 +16,6 @@ typedef fftw_complex FFTW_COMPLEX; //#include -//#include -//#include #include bool Mathzone_Add1::flag_jlx_expand_coef = false; @@ -1421,9 +1419,13 @@ void Mathzone_Add1::Uni_Deriv_Phi for (int ir = 0; ir < mesh; ir++) { if (is_re) + { phind[ir] = fac * c_re(fft_ndphir[ir]) / FFT_NR; + } else + { phind[ir] = fac * c_im(fft_ndphir[ir]) / FFT_NR; + } } fftw_destroy_plan (p1); @@ -1431,4 +1433,3 @@ void Mathzone_Add1::Uni_Deriv_Phi timer::tick("Mathzone_Add1", "Uni_Deriv_Phi"); } - diff --git a/ABACUS.develop/source/src_global/mathzone_add1.h b/ABACUS.develop/source/src_global/mathzone_add1.h index 310738d745..98e0f151f9 100644 --- a/ABACUS.develop/source/src_global/mathzone_add1.h +++ b/ABACUS.develop/source/src_global/mathzone_add1.h @@ -175,23 +175,21 @@ class Mathzone_Add1 double* phind ); - - private: - const static int sph_lmax = 20; - static double** c_ln_c; - static double** c_ln_s; - static bool flag_jlx_expand_coef; + const static int sph_lmax = 20; + static double** c_ln_c; + static double** c_ln_s; + static bool flag_jlx_expand_coef; - static void expand_coef_jlx (); - static double pol_seg_int - ( - const int& polint_order, - const double* coef, - const int& n, - const double* k, - const int& ik - ); + static void expand_coef_jlx (); + static double pol_seg_int + ( + const int& polint_order, + const double* coef, + const int& n, + const double* k, + const int& ik + ); }; #endif diff --git a/ABACUS.develop/source/src_global/sph_bessel.cpp b/ABACUS.develop/source/src_global/sph_bessel.cpp index ad57f0e867..a848588060 100644 --- a/ABACUS.develop/source/src_global/sph_bessel.cpp +++ b/ABACUS.develop/source/src_global/sph_bessel.cpp @@ -1,6 +1,8 @@ -#include "../src_pw/global.h" +//#include "../src_pw/global.h" #include "sph_bessel.h" #include "../src_parallel/parallel_reduce.h" +#include "timer.h" +#include "global_function.h" Sph_Bessel::Sph_Bessel() { @@ -206,7 +208,9 @@ double Sph_Bessel::jlx7(const int &n, const double &x) double order, rj, rjp, ry, ryp; if (n < 0 || x <= 0.0) { - WARNING_QUIT("Sph_Bessel::jlx7","bad arguments in sphbes"); + cout << "Sph_Bessel::jlx7,bad arguments in sphbes" << endl; + //WARNING_QUIT("Sph_Bessel::jlx7","bad arguments in sphbes"); + exit(0); // mohan add 2021-05-05 } order = n + 0.5; BESSJY(x, order, &rj, &ry, &rjp, &ryp); @@ -224,7 +228,9 @@ void Sph_Bessel::BESSJY(double x, double xnu, double *rj, double *ry, double *rj temp,w,x2,xi,xi2,xmu,xmu2; if (x <= 0.0 || xnu < 0.0) { - WARNING_QUIT("Sph_Bessel::BESSJY","bad arguments in bessjy"); + cout << "Sph_Bessel::BESSJY, bad arguments in bessjy" << endl; + //WARNING_QUIT("Sph_Bessel::BESSJY","bad arguments in bessjy"); + exit(0); } nl=(x < xmin ? (int)(xnu+0.5) : IMAX(0,(int)(xnu-x+1.5))); xmu=xnu-nl; @@ -252,7 +258,9 @@ void Sph_Bessel::BESSJY(double x, double xnu, double *rj, double *ry, double *rj } if (i > maxit) { - WARNING_QUIT("Sph_Bessel::BESSJY","x too large in bessjy; try asymptotic expansion"); + cout << "Sph_Bessel::BESSJY, x too large in bessjy; try asymptotic expansion" << endl; + //WARNING_QUIT("Sph_Bessel::BESSJY","x too large in bessjy; try asymptotic expansion"); + exit(0); } rjl=isign*fpmin; rjpl=h*rjl; @@ -299,7 +307,9 @@ void Sph_Bessel::BESSJY(double x, double xnu, double *rj, double *ry, double *rj } if (i > maxit) { - WARNING_QUIT("Sph_Bessel::BESSJY","bessy series failed to converge"); + cout << "Sph_Bessel::BESSJY, bessy series failed to converge" << endl; + //WARNING_QUIT("Sph_Bessel::BESSJY","bessy series failed to converge"); + exit(0); // mohan add 2021-05-05 } rymu = -sum; ry1 = -sum1*xi2; @@ -344,7 +354,9 @@ void Sph_Bessel::BESSJY(double x, double xnu, double *rj, double *ry, double *rj } if (i > maxit) { - WARNING_QUIT("Sph_Bessel::BESSJY","cf2 failed in bessjy"); + cout << "Sph_Bessel::BESSJY, cf2 failed in bessjy" << endl; + //WARNING_QUIT("Sph_Bessel::BESSJY","cf2 failed in bessjy"); + exit(0); // mohan add 2021-05-05 } gam=(p-f)/q; rjmu=sqrt(w/((p-f)*gam+q)); diff --git a/ABACUS.develop/source/src_global/title.cpp b/ABACUS.develop/source/src_global/title.cpp new file mode 100644 index 0000000000..f0aa21c31d --- /dev/null +++ b/ABACUS.develop/source/src_global/title.cpp @@ -0,0 +1,52 @@ +#include "title.h" + +#ifdef __NORMAL +#else +#include "global_variable.h" +#endif + +//========================================================== +// GLOBAL FUNCTION : +// NAME : TITLE( title for each function ) +//========================================================== +void TITLE(const string &class_function_name) +{ + return;//no output + +#ifdef __NORMAL + cout<<" ==> "< "< "< "< "< "< +#include +#include +#include +#include +#include +#include + +#include +#include + +using namespace std; + +void TITLE(const string &class_function_name); +void TITLE(const string &class_name,const string &function_name); +void TITLE(ofstream &ofs,const string &class_name,const string &function_name); + +#endif diff --git a/ABACUS.develop/source/src_io/read_pp_upf100.cpp b/ABACUS.develop/source/src_io/read_pp_upf100.cpp index 68a76fa9f6..7b8a8a225d 100644 --- a/ABACUS.develop/source/src_io/read_pp_upf100.cpp +++ b/ABACUS.develop/source/src_io/read_pp_upf100.cpp @@ -292,18 +292,7 @@ void Pseudopot_upf::read_pseudo_local(ifstream &ifs) { ifs >> this->vloc[ir]; } - - // for test -/* - ofstream ofs("vloc_UPF.dat"); - for(int ir=0; ir // Peize Lin fix bug about strcmp 2016-08-02 #include #include "../src_global/math_integral.h" -//#include -//#include #include using namespace std; @@ -102,7 +100,6 @@ void LCAO_Orbitals::bcast_files(const int &ntype_in) #endif -//#include "../src_pw/global.h" void LCAO_Orbitals::Read_Orbitals( const int &ntype_in, const int &lmax_in, diff --git a/ABACUS.develop/source/src_lcao/ORB_table_phi.h b/ABACUS.develop/source/src_lcao/ORB_table_phi.h index 413189f843..c9caa3ef8d 100644 --- a/ABACUS.develop/source/src_lcao/ORB_table_phi.h +++ b/ABACUS.develop/source/src_lcao/ORB_table_phi.h @@ -4,6 +4,7 @@ #include "ORB_read.h" #include "ORB_atomic_lm.h" #include "../src_global/sph_bessel_recursive.h" +#include "../src_global/intarray.h" #include class ORB_table_phi diff --git a/ABACUS.develop/source/src_pw/VL_in_pw.cpp b/ABACUS.develop/source/src_pw/VL_in_pw.cpp index 0bc3d9f18b..e5cb59ce21 100644 --- a/ABACUS.develop/source/src_pw/VL_in_pw.cpp +++ b/ABACUS.develop/source/src_pw/VL_in_pw.cpp @@ -77,7 +77,9 @@ void pseudopot_cell_vl::allocate(void) ZEROS(numeric, ucell.ntype); for (int it = 0; it < ucell.ntype; it++) - { this->numeric[it] = true; } + { + this->numeric[it] = true; + } // mohan change global variable 'npsx' to local variable, // npsx( max number of different PPs) @@ -120,7 +122,7 @@ void pseudopot_cell_vl::vloc_of_g( // The local pseudopotential of the US case is always in // numerical form, expressed in Ry units. // ---------------------------------------------------------------- - int igl0;// start from |G|=0 or not. + int igl0=0;// start from |G|=0 or not. int ig=0;// counters on g-vectors; int ir=0;// counter on mesh points