@@ -221,7 +221,7 @@ void Input::Default(void)
221221// ----------------------------------------------------------
222222 dr2 = 1.0e-9 ;
223223 niter = 40 ;
224- nstep = 1 ;
224+ this -> nstep = 0 ;
225225 out_stru = 0 ;
226226// ----------------------------------------------------------
227227// occupation
@@ -948,7 +948,7 @@ bool Input::Read(const std::string &fn)
948948 }
949949 else if (strcmp (" nstep" , word) == 0 )
950950 {
951- read_value (ifs, nstep);
951+ read_value (ifs, this -> nstep );
952952 }
953953 else if (strcmp (" out_stru" , word) == 0 )
954954 {
@@ -2204,7 +2204,7 @@ void Input::Bcast()
22042204
22052205 Parallel_Common::bcast_double ( dr2 );
22062206 Parallel_Common::bcast_int ( niter );
2207- Parallel_Common::bcast_int ( nstep );
2207+ Parallel_Common::bcast_int ( this -> nstep );
22082208 Parallel_Common::bcast_int ( out_stru ); // mohan add 2012-03-23
22092209
22102210 // Parallel_Common::bcast_string( occupations );
@@ -2562,7 +2562,7 @@ void Input::Check(void)
25622562 std::cout<<"sorry, can't calculate force with soc now, would be implement in next version!"<<std::endl;
25632563 }
25642564*/
2565- nstep = 1 ;
2565+ this -> nstep = 1 ;
25662566
25672567 }
25682568 else if (calculation == " scf-sto" ) // qianrui 2021-2-20
@@ -2572,6 +2572,7 @@ void Input::Check(void)
25722572 mem_saver = 0 ;
25732573 ModuleBase::GlobalFunc::AUTO_SET (" mem_savre" ," 0" );
25742574 }
2575+ this ->nstep = 1 ;
25752576 }
25762577 else if (calculation == " relax" ) // pengfei 2014-10-13
25772578 {
@@ -2581,12 +2582,13 @@ void Input::Check(void)
25812582 ModuleBase::GlobalFunc::AUTO_SET (" mem_savre" ," 0" );
25822583 }
25832584 force = 1 ;
2585+ if (! this ->nstep ) this ->nstep = 50 ;
25842586 }
25852587
25862588 else if (calculation == " nscf" )
25872589 {
25882590 GlobalV::CALCULATION = " nscf" ;
2589- nstep = 1 ;
2591+ this -> nstep = 1 ;
25902592 out_stru = 0 ;
25912593
25922594 // if (local_basis == 0 && linear_scaling == 0) xiaohui modify 2013-09-01
@@ -2610,7 +2612,7 @@ void Input::Check(void)
26102612 else if (calculation == " istate" )
26112613 {
26122614 GlobalV::CALCULATION = " istate" ;
2613- nstep = 1 ;
2615+ this -> nstep = 1 ;
26142616 out_stru = 0 ;
26152617 out_dos = 0 ;
26162618 out_band = 0 ;
@@ -2631,7 +2633,7 @@ void Input::Check(void)
26312633 else if (calculation == " ienvelope" )
26322634 {
26332635 GlobalV::CALCULATION = " ienvelope" ; // mohan fix 2011-11-04
2634- nstep = 1 ;
2636+ this -> nstep = 1 ;
26352637 out_stru = 0 ;
26362638 out_dos = 0 ;
26372639 out_band = 0 ;
@@ -2653,6 +2655,10 @@ void Input::Check(void)
26532655 GlobalV::CALCULATION = " md" ;
26542656 symmetry = false ;
26552657 force = 1 ;
2658+ if (this ->nstep ==0 ){
2659+ GlobalV::ofs_running<<" nstep should be set. Autoset nstep to 50!" <<endl;
2660+ this ->nstep = 50 ;
2661+ }
26562662 if (!out_md_control) out_level = " m" ;// zhengdy add 2019-04-07
26572663
26582664 // deal with input parameters , 2019-04-30
@@ -2683,9 +2689,11 @@ void Input::Check(void)
26832689 {
26842690 force = 1 ;
26852691 stress = 1 ;
2692+ if (! this ->nstep ) this ->nstep = 50 ;
26862693 }
26872694 else if (calculation == " test" )
26882695 {
2696+ this ->nstep = 1 ;
26892697 }
26902698 else
26912699 {
0 commit comments