Skip to content
11 changes: 2 additions & 9 deletions source/module_cell/read_atoms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,16 +415,9 @@ bool UnitCell::read_atom_positions(std::ifstream &ifpos, std::ofstream &ofs_runn
// start magnetization
//=======================================
ModuleBase::GlobalFunc::READ_VALUE(ifpos, atoms[it].label);
bool found = false;
for(int it2=0; it2<ntype; it2++)
{
if( this->atoms[it].label == this->atom_label[it] )
{
found = true;
}
}
if(!found)
if(this->atoms[it].label != this->atom_label[it])
{
ofs_warning << " Label orders in ATOMIC_POSITIONS and ATOMIC_SPECIES sections do not match!" << std::endl;
ofs_warning << " Label read from ATOMIC_POSITIONS is " << this->atoms[it].label << std::endl;
ofs_warning << " Label from ATOMIC_SPECIES is " << this->atom_label[it] << std::endl;
return 0;
Expand Down