diff --git a/source/module_cell/read_atoms.cpp b/source/module_cell/read_atoms.cpp index 8e8019cb248..0cb40e0c926 100644 --- a/source/module_cell/read_atoms.cpp +++ b/source/module_cell/read_atoms.cpp @@ -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; it2atoms[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;