diff --git a/source/src_io/write_rho_cube.cpp b/source/src_io/write_rho_cube.cpp index 9604289fc6..eac8cec179 100644 --- a/source/src_io/write_rho_cube.cpp +++ b/source/src_io/write_rho_cube.cpp @@ -9,7 +9,10 @@ void Charge::write_rho_cube( const int &precision) { ModuleBase::TITLE("Charge","write_rho_cube"); - + if (out_chg==0) + { + return; + } time_t start, end; std::ofstream ofs;