@@ -25,8 +25,9 @@ void ModuleIO::write_proj_band_lcao(
2525 const double * sk = dynamic_cast <const hamilt::HamiltLCAO<double , double >*>(p_ham)->getSk ();
2626
2727 int nspin0 = 1 ;
28- if (PARAM.inp .nspin == 2 )
28+ if (PARAM.inp .nspin == 2 ) {
2929 nspin0 = 2 ;
30+ }
3031 int nks = 0 ;
3132 if (nspin0 == 1 )
3233 {
@@ -103,14 +104,16 @@ void ModuleIO::write_proj_band_lcao(
103104
104105 out << " <pband>" << std::endl;
105106 out << " <nspin>" << PARAM.inp .nspin << " </nspin>" << std::endl;
106- if (PARAM.inp .nspin == 4 )
107+ if (PARAM.inp .nspin == 4 ) {
107108 out << " <norbitals>" << std::setw (2 ) << PARAM.globalv .nlocal / 2 << " </norbitals>" << std::endl;
108- else
109+ } else {
109110 out << " <norbitals>" << std::setw (2 ) << PARAM.globalv .nlocal << " </norbitals>" << std::endl;
111+ }
110112 out << " <band_structure nkpoints=\" " << nks << " \" nbands=\" " << PARAM.inp .nbands << " \" units=\" eV\" >"
111113 << std::endl;
112- for (int ib = 0 ; ib < PARAM.inp .nbands ; ib++)
114+ for (int ib = 0 ; ib < PARAM.inp .nbands ; ib++) {
113115 out << " " << (pelec->ekb (is * nks, ib)) * ModuleBase::Ry_to_eV;
116+ }
114117 out << std::endl;
115118 out << " </band_structure>" << std::endl;
116119
@@ -139,9 +142,9 @@ void ModuleIO::write_proj_band_lcao(
139142 out << " <data>" << std::endl;
140143 for (int ib = 0 ; ib < PARAM.inp .nbands ; ib++)
141144 {
142- if (PARAM.inp .nspin == 1 || PARAM.inp .nspin == 2 )
145+ if (PARAM.inp .nspin == 1 || PARAM.inp .nspin == 2 ) {
143146 out << std::setw (13 ) << weight (is, ib * PARAM.globalv .nlocal + w);
144- else if (PARAM.inp .nspin == 4 )
147+ } else if (PARAM.inp .nspin == 4 )
145148 {
146149 int w0 = w - s0;
147150 out << std::setw (13 )
@@ -178,8 +181,9 @@ void ModuleIO::write_proj_band_lcao(
178181 ModuleBase::timer::tick (" ModuleIO" , " write_proj_band_lcao" );
179182
180183 int nspin0 = 1 ;
181- if (PARAM.inp .nspin == 2 )
184+ if (PARAM.inp .nspin == 2 ) {
182185 nspin0 = 2 ;
186+ }
183187 int nks = 0 ;
184188 if (nspin0 == 1 )
185189 {
@@ -302,8 +306,9 @@ void ModuleIO::write_proj_band_lcao(
302306
303307 for (int ik = 0 ; ik < nks; ik++)
304308 {
305- for (int ib = 0 ; ib < PARAM.inp .nbands ; ib++)
309+ for (int ib = 0 ; ib < PARAM.inp .nbands ; ib++) {
306310 out << " " << (pelec->ekb (ik + is * nks, ib)) * ModuleBase::Ry_to_eV;
311+ }
307312 out << std::endl;
308313 }
309314 out << " </band_structure>" << std::endl;
0 commit comments