diff --git a/src/KOKKOS/neigh_bond_kokkos.cpp b/src/KOKKOS/neigh_bond_kokkos.cpp
index 4dd39a1d383cb5da9063a5c439ca725d511d7c48..615dc94ee2faf6d2c690557909757b9a0525181d 100644
--- a/src/KOKKOS/neigh_bond_kokkos.cpp
+++ b/src/KOKKOS/neigh_bond_kokkos.cpp
@@ -37,8 +37,6 @@ using namespace LAMMPS_NS;
 #define BONDDELTA 10000
 #define LB_FACTOR 1.5
 
-enum{IGNORE,WARN,ERROR};           // same as thermo.cpp
-
 /* ---------------------------------------------------------------------- */
 
 template<class DeviceType>
@@ -288,7 +286,7 @@ void NeighBondKokkos<DeviceType>::bond_all()
     }
   } while (h_fail_flag());
 
-  if (nmissing && lostbond == ERROR) {
+  if (nmissing && lostbond == Thermo::ERROR) {
     char str[128];
     sprintf(str,"Bond atoms missing on proc %d at step " BIGINT_FORMAT,
             me,update->ntimestep);
@@ -296,7 +294,7 @@ void NeighBondKokkos<DeviceType>::bond_all()
   }
 
   if (neighbor->cluster_check) bond_check();
-  if (lostbond == IGNORE) return;
+  if (lostbond == Thermo::IGNORE) return;
 
   int all;
   MPI_Allreduce(&nmissing,&all,1,MPI_INT,MPI_SUM,world);
@@ -317,7 +315,7 @@ void NeighBondKokkos<DeviceType>::operator()(TagNeighBondBondAll, const int &i,
     int atom1 = map_array(bond_atom(i,m));
     if (atom1 == -1) {
       nmissing++;
-      if (lostbond == ERROR) return;
+      if (lostbond == Thermo::ERROR) return;
       continue;
     }
     atom1 = closest_image(i,atom1);
@@ -383,7 +381,7 @@ void NeighBondKokkos<DeviceType>::bond_partial()
     }
   } while (h_fail_flag());
 
-  if (nmissing && lostbond == ERROR) {
+  if (nmissing && lostbond == Thermo::ERROR) {
     char str[128];
     sprintf(str,"Bond atoms missing on proc %d at step " BIGINT_FORMAT,
             me,update->ntimestep);
@@ -391,7 +389,7 @@ void NeighBondKokkos<DeviceType>::bond_partial()
   }
 
   if (neighbor->cluster_check) bond_check();
-  if (lostbond == IGNORE) return;
+  if (lostbond == Thermo::IGNORE) return;
 
   int all;
   MPI_Allreduce(&nmissing,&all,1,MPI_INT,MPI_SUM,world);
@@ -413,7 +411,7 @@ void NeighBondKokkos<DeviceType>::operator()(TagNeighBondBondPartial, const int
     int atom1 = map_array(bond_atom(i,m));
     if (atom1 == -1) {
       nmissing++;
-      if (lostbond == ERROR) return;
+      if (lostbond == Thermo::ERROR) return;
       continue;
     }
     atom1 = closest_image(i,atom1);
@@ -505,7 +503,7 @@ void NeighBondKokkos<DeviceType>::angle_all()
     }
   } while (h_fail_flag());
 
-  if (nmissing && lostbond == ERROR) {
+  if (nmissing && lostbond == Thermo::ERROR) {
     char str[128];
     sprintf(str,"Angle atoms missing on proc %d at step " BIGINT_FORMAT,
             me,update->ntimestep);
@@ -513,7 +511,7 @@ void NeighBondKokkos<DeviceType>::angle_all()
   }
 
   if (neighbor->cluster_check) angle_check();
-  if (lostbond == IGNORE) return;
+  if (lostbond == Thermo::IGNORE) return;
 
   int all;
   MPI_Allreduce(&nmissing,&all,1,MPI_INT,MPI_SUM,world);
@@ -536,7 +534,7 @@ void NeighBondKokkos<DeviceType>::operator()(TagNeighBondAngleAll, const int &i,
     int atom3 = map_array(angle_atom3(i,m));
     if (atom1 == -1 || atom2 == -1 || atom3 == -1) {
       nmissing++;
-      if (lostbond == ERROR) return;
+      if (lostbond == Thermo::ERROR) return;
       continue;
     }
     atom1 = closest_image(i,atom1);
@@ -607,7 +605,7 @@ void NeighBondKokkos<DeviceType>::angle_partial()
     }
   } while (h_fail_flag());
 
-  if (nmissing && lostbond == ERROR) {
+  if (nmissing && lostbond == Thermo::ERROR) {
     char str[128];
     sprintf(str,"Angle atoms missing on proc %d at step " BIGINT_FORMAT,
             me,update->ntimestep);
@@ -615,7 +613,7 @@ void NeighBondKokkos<DeviceType>::angle_partial()
   }
 
   if (neighbor->cluster_check) angle_check();
-  if (lostbond == IGNORE) return;
+  if (lostbond == Thermo::IGNORE) return;
 
   int all;
   MPI_Allreduce(&nmissing,&all,1,MPI_INT,MPI_SUM,world);
@@ -639,7 +637,7 @@ void NeighBondKokkos<DeviceType>::operator()(TagNeighBondAnglePartial, const int
     int atom3 = map_array(angle_atom3(i,m));
     if (atom1 == -1 || atom2 == -1 || atom3 == -1) {
       nmissing++;
-      if (lostbond == ERROR) return;
+      if (lostbond == Thermo::ERROR) return;
       continue;
     }
     atom1 = closest_image(i,atom1);
@@ -749,7 +747,7 @@ void NeighBondKokkos<DeviceType>::dihedral_all()
     }
   } while (h_fail_flag());
 
-  if (nmissing && lostbond == ERROR) {
+  if (nmissing && lostbond == Thermo::ERROR) {
     char str[128];
     sprintf(str,"Dihedral atoms missing on proc %d at step " BIGINT_FORMAT,
             me,update->ntimestep);
@@ -757,7 +755,7 @@ void NeighBondKokkos<DeviceType>::dihedral_all()
   }
 
   if (neighbor->cluster_check) dihedral_check(neighbor->ndihedrallist,v_dihedrallist);
-  if (lostbond == IGNORE) return;
+  if (lostbond == Thermo::IGNORE) return;
 
   int all;
   MPI_Allreduce(&nmissing,&all,1,MPI_INT,MPI_SUM,world);
@@ -781,7 +779,7 @@ void NeighBondKokkos<DeviceType>::operator()(TagNeighBondDihedralAll, const int
     int atom4 = map_array(dihedral_atom4(i,m));
     if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) {
       nmissing++;
-      if (lostbond == ERROR) return;
+      if (lostbond == Thermo::ERROR) return;
       continue;
     }
     atom1 = closest_image(i,atom1);
@@ -856,7 +854,7 @@ void NeighBondKokkos<DeviceType>::dihedral_partial()
     }
   } while (h_fail_flag());
 
-  if (nmissing && lostbond == ERROR) {
+  if (nmissing && lostbond == Thermo::ERROR) {
     char str[128];
     sprintf(str,"Dihedral atoms missing on proc %d at step " BIGINT_FORMAT,
             me,update->ntimestep);
@@ -864,7 +862,7 @@ void NeighBondKokkos<DeviceType>::dihedral_partial()
   }
 
   if (neighbor->cluster_check) dihedral_check(neighbor->ndihedrallist,v_dihedrallist);
-  if (lostbond == IGNORE) return;
+  if (lostbond == Thermo::IGNORE) return;
 
   int all;
   MPI_Allreduce(&nmissing,&all,1,MPI_INT,MPI_SUM,world);
@@ -889,7 +887,7 @@ void NeighBondKokkos<DeviceType>::operator()(TagNeighBondDihedralPartial, const
     int atom4 = map_array(dihedral_atom4(i,m));
     if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) {
       nmissing++;
-      if (lostbond == ERROR) return;
+      if (lostbond == Thermo::ERROR) return;
       continue;
     }
     atom1 = closest_image(i,atom1);
@@ -1020,7 +1018,7 @@ void NeighBondKokkos<DeviceType>::improper_all()
     }
   } while (h_fail_flag());
 
-  if (nmissing && lostbond == ERROR) {
+  if (nmissing && lostbond == Thermo::ERROR) {
     char str[128];
     sprintf(str,"Improper atoms missing on proc %d at step " BIGINT_FORMAT,
             me,update->ntimestep);
@@ -1028,7 +1026,7 @@ void NeighBondKokkos<DeviceType>::improper_all()
   }
 
   if (neighbor->cluster_check) dihedral_check(neighbor->nimproperlist,v_improperlist);
-  if (lostbond == IGNORE) return;
+  if (lostbond == Thermo::IGNORE) return;
 
   int all;
   MPI_Allreduce(&nmissing,&all,1,MPI_INT,MPI_SUM,world);
@@ -1052,7 +1050,7 @@ void NeighBondKokkos<DeviceType>::operator()(TagNeighBondImproperAll, const int
     int atom4 = map_array(improper_atom4(i,m));
     if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) {
       nmissing++;
-      if (lostbond == ERROR) return;
+      if (lostbond == Thermo::ERROR) return;
       continue;
     }
     atom1 = closest_image(i,atom1);
@@ -1127,7 +1125,7 @@ void NeighBondKokkos<DeviceType>::improper_partial()
     }
   } while (h_fail_flag());
 
-  if (nmissing && lostbond == ERROR) {
+  if (nmissing && lostbond == Thermo::ERROR) {
     char str[128];
     sprintf(str,"Improper atoms missing on proc %d at step " BIGINT_FORMAT,
             me,update->ntimestep);
@@ -1135,7 +1133,7 @@ void NeighBondKokkos<DeviceType>::improper_partial()
   }
 
   if (neighbor->cluster_check) dihedral_check(neighbor->nimproperlist,v_improperlist);
-  if (lostbond == IGNORE) return;
+  if (lostbond == Thermo::IGNORE) return;
 
   int all;
   MPI_Allreduce(&nmissing,&all,1,MPI_INT,MPI_SUM,world);
@@ -1160,7 +1158,7 @@ void NeighBondKokkos<DeviceType>::operator()(TagNeighBondImproperPartial, const
     int atom4 = map_array(improper_atom4(i,m));
     if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) {
       nmissing++;
-      if (lostbond == ERROR) return;
+      if (lostbond == Thermo::ERROR) return;
       continue;
     }
     atom1 = closest_image(i,atom1);
diff --git a/src/domain.cpp b/src/domain.cpp
index eae4f3926df72c1c587785e78db2f79efdb12bcf..df6f0369c3b1900044636bc148b6a8f0303a0808 100644
--- a/src/domain.cpp
+++ b/src/domain.cpp
@@ -45,7 +45,6 @@ using namespace LAMMPS_NS;
 using namespace MathConst;
 
 enum{NO_REMAP,X_REMAP,V_REMAP};    // same as fix_deform.cpp
-enum{IGNORE,WARN,ERROR};           // same as thermo.cpp
 enum{LAYOUT_UNIFORM,LAYOUT_NONUNIFORM,LAYOUT_TILED};    // several files
 
 #define BIG   1.0e20
@@ -762,7 +761,7 @@ void Domain::image_check()
 
       if (k == -1) {
         nmissing++;
-        if (lostbond == ERROR)
+        if (lostbond == Thermo::ERROR)
           error->one(FLERR,"Bond atom missing in image check");
         continue;
       }
@@ -785,7 +784,7 @@ void Domain::image_check()
   if (flagall && comm->me == 0)
     error->warning(FLERR,"Inconsistent image flags");
 
-  if (lostbond == WARN) {
+  if (lostbond == Thermo::WARN) {
     int all;
     MPI_Allreduce(&nmissing,&all,1,MPI_INT,MPI_SUM,world);
     if (all && comm->me == 0)
@@ -861,7 +860,7 @@ void Domain::box_too_small_check()
 
       if (k == -1) {
         nmissing++;
-        if (lostbond == ERROR)
+        if (lostbond == Thermo::ERROR)
           error->one(FLERR,"Bond atom missing in box size check");
         continue;
       }
@@ -875,7 +874,7 @@ void Domain::box_too_small_check()
     }
   }
 
-  if (lostbond == WARN) {
+  if (lostbond == Thermo::WARN) {
     int all;
     MPI_Allreduce(&nmissing,&all,1,MPI_INT,MPI_SUM,world);
     if (all && comm->me == 0)
diff --git a/src/ntopo.h b/src/ntopo.h
index 9512606ba49a3ebd45ca87fbab91f2513f625f22..b115b329654c7468d7d41057d03c3a83fb89912b 100644
--- a/src/ntopo.h
+++ b/src/ntopo.h
@@ -31,8 +31,6 @@ class NTopo : protected Pointers {
   bigint memory_usage();
 
  protected:
-  enum{IGNORE,WARN,ERROR};       // same as thermo.cpp
-
   int me,nprocs;
   int maxbond,maxangle,maxdihedral,maximproper;
   int cluster_check;             // copy from Neighbor
diff --git a/src/ntopo_angle_all.cpp b/src/ntopo_angle_all.cpp
index 3a079ab4677533c46902cf337702c7dec60d74b5..2a358c8ce574e4291ec8a492e7904402d7622a90 100644
--- a/src/ntopo_angle_all.cpp
+++ b/src/ntopo_angle_all.cpp
@@ -58,7 +58,7 @@ void NTopoAngleAll::build()
       atom3 = atom->map(angle_atom3[i][m]);
       if (atom1 == -1 || atom2 == -1 || atom3 == -1) {
         nmissing++;
-        if (lostbond == ERROR) {
+        if (lostbond == Thermo::ERROR) {
           char str[128];
           sprintf(str,"Angle atoms "
                   TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT
@@ -86,7 +86,7 @@ void NTopoAngleAll::build()
     }
 
   if (cluster_check) angle_check();
-  if (lostbond == IGNORE) return;
+  if (lostbond == Thermo::IGNORE) return;
 
   int all;
   MPI_Allreduce(&nmissing,&all,1,MPI_INT,MPI_SUM,world);
diff --git a/src/ntopo_angle_partial.cpp b/src/ntopo_angle_partial.cpp
index f1d668a3ba2503e0c3992078b518a3239d3d24b6..c82110cda5309f01f3a223c1c4eabc6d3e615051 100644
--- a/src/ntopo_angle_partial.cpp
+++ b/src/ntopo_angle_partial.cpp
@@ -59,7 +59,7 @@ void NTopoAnglePartial::build()
       atom3 = atom->map(angle_atom3[i][m]);
       if (atom1 == -1 || atom2 == -1 || atom3 == -1) {
         nmissing++;
-        if (lostbond == ERROR) {
+        if (lostbond == Thermo::ERROR) {
           char str[128];
           sprintf(str,"Angle atoms "
                   TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT
@@ -87,7 +87,7 @@ void NTopoAnglePartial::build()
     }
 
   if (cluster_check) angle_check();
-  if (lostbond == IGNORE) return;
+  if (lostbond == Thermo::IGNORE) return;
 
   int all;
   MPI_Allreduce(&nmissing,&all,1,MPI_INT,MPI_SUM,world);
diff --git a/src/ntopo_angle_template.cpp b/src/ntopo_angle_template.cpp
index 05d5de28a473389bb7c791ce56cf0095b70a2a63..15a8b658f328357e0a27368a22d888bc6b9f9387 100644
--- a/src/ntopo_angle_template.cpp
+++ b/src/ntopo_angle_template.cpp
@@ -76,7 +76,7 @@ void NTopoAngleTemplate::build()
       atom3 = atom->map(angle_atom3[iatom][m]+tagprev);
       if (atom1 == -1 || atom2 == -1 || atom3 == -1) {
         nmissing++;
-        if (lostbond == ERROR) {
+        if (lostbond == Thermo::ERROR) {
           char str[128];
           sprintf(str,"Angle atoms "
                   TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT
@@ -106,7 +106,7 @@ void NTopoAngleTemplate::build()
   }
 
   if (cluster_check) angle_check();
-  if (lostbond == IGNORE) return;
+  if (lostbond == Thermo::IGNORE) return;
 
   int all;
   MPI_Allreduce(&nmissing,&all,1,MPI_INT,MPI_SUM,world);
diff --git a/src/ntopo_bond_all.cpp b/src/ntopo_bond_all.cpp
index 03cb2ad86bc83027190c34386adbc5a1d062b503..42e9e2303d7af91b2bf3086f14defc3465bf48b0 100644
--- a/src/ntopo_bond_all.cpp
+++ b/src/ntopo_bond_all.cpp
@@ -55,7 +55,7 @@ void NTopoBondAll::build()
       atom1 = atom->map(bond_atom[i][m]);
       if (atom1 == -1) {
         nmissing++;
-        if (lostbond == ERROR) {
+        if (lostbond == Thermo::ERROR) {
           char str[128];
           sprintf(str,"Bond atoms " TAGINT_FORMAT " " TAGINT_FORMAT
                   " missing on proc %d at step " BIGINT_FORMAT,
@@ -78,7 +78,7 @@ void NTopoBondAll::build()
     }
 
   if (cluster_check) bond_check();
-  if (lostbond == IGNORE) return;
+  if (lostbond == Thermo::IGNORE) return;
 
   int all;
   MPI_Allreduce(&nmissing,&all,1,MPI_INT,MPI_SUM,world);
diff --git a/src/ntopo_bond_partial.cpp b/src/ntopo_bond_partial.cpp
index cda4bdcf09cbd0150dacd076392e8e5630839c37..5a1acd9191b7a1485d435382fcc1c909622d336d 100644
--- a/src/ntopo_bond_partial.cpp
+++ b/src/ntopo_bond_partial.cpp
@@ -56,7 +56,7 @@ void NTopoBondPartial::build()
       atom1 = atom->map(bond_atom[i][m]);
       if (atom1 == -1) {
         nmissing++;
-        if (lostbond == ERROR) {
+        if (lostbond == Thermo::ERROR) {
           char str[128];
           sprintf(str,"Bond atoms " TAGINT_FORMAT " " TAGINT_FORMAT
                   " missing on proc %d at step " BIGINT_FORMAT,
@@ -79,7 +79,7 @@ void NTopoBondPartial::build()
     }
 
   if (cluster_check) bond_check();
-  if (lostbond == IGNORE) return;
+  if (lostbond == Thermo::IGNORE) return;
 
   int all;
   MPI_Allreduce(&nmissing,&all,1,MPI_INT,MPI_SUM,world);
diff --git a/src/ntopo_bond_template.cpp b/src/ntopo_bond_template.cpp
index de16d78585cf65175babe696dafb14aa4bd5a2d6..fa98658ad0d640023e80149bdd2b878906120930 100644
--- a/src/ntopo_bond_template.cpp
+++ b/src/ntopo_bond_template.cpp
@@ -72,7 +72,7 @@ void NTopoBondTemplate::build()
       atom1 = atom->map(bond_atom[iatom][m]+tagprev);
       if (atom1 == -1) {
         nmissing++;
-        if (lostbond == ERROR) {
+        if (lostbond == Thermo::ERROR) {
           char str[128];
           sprintf(str,"Bond atoms " TAGINT_FORMAT " " TAGINT_FORMAT
                   " missing on proc %d at step " BIGINT_FORMAT,
@@ -96,7 +96,7 @@ void NTopoBondTemplate::build()
   }
 
   if (cluster_check) bond_check();
-  if (lostbond == IGNORE) return;
+  if (lostbond == Thermo::IGNORE) return;
 
   int all;
   MPI_Allreduce(&nmissing,&all,1,MPI_INT,MPI_SUM,world);
diff --git a/src/ntopo_dihedral_all.cpp b/src/ntopo_dihedral_all.cpp
index 7a5b350fa018096a7bd46cea5226003d5248ca83..9c94fb10f959e93a9f56db10474039f62feb39b1 100644
--- a/src/ntopo_dihedral_all.cpp
+++ b/src/ntopo_dihedral_all.cpp
@@ -60,7 +60,7 @@ void NTopoDihedralAll::build()
       atom4 = atom->map(dihedral_atom4[i][m]);
       if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) {
         nmissing++;
-        if (lostbond == ERROR) {
+        if (lostbond == Thermo::ERROR) {
           char str[128];
           sprintf(str,"Dihedral atoms "
                   TAGINT_FORMAT " " TAGINT_FORMAT " "
@@ -93,7 +93,7 @@ void NTopoDihedralAll::build()
     }
 
   if (cluster_check) dihedral_check(ndihedrallist,dihedrallist);
-  if (lostbond == IGNORE) return;
+  if (lostbond == Thermo::IGNORE) return;
 
   int all;
   MPI_Allreduce(&nmissing,&all,1,MPI_INT,MPI_SUM,world);
diff --git a/src/ntopo_dihedral_partial.cpp b/src/ntopo_dihedral_partial.cpp
index 603c81e68c674487f48fdd241c93516e9cc47439..14749e6511d74d26fc09ee55cedfab9b272c0443 100644
--- a/src/ntopo_dihedral_partial.cpp
+++ b/src/ntopo_dihedral_partial.cpp
@@ -62,7 +62,7 @@ void NTopoDihedralPartial::build()
       atom4 = atom->map(dihedral_atom4[i][m]);
       if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) {
         nmissing++;
-        if (lostbond == ERROR) {
+        if (lostbond == Thermo::ERROR) {
           char str[128];
           sprintf(str,"Dihedral atoms "
                   TAGINT_FORMAT " " TAGINT_FORMAT " "
@@ -95,7 +95,7 @@ void NTopoDihedralPartial::build()
     }
 
   if (cluster_check) dihedral_check(ndihedrallist,dihedrallist);
-  if (lostbond == IGNORE) return;
+  if (lostbond == Thermo::IGNORE) return;
 
   int all;
   MPI_Allreduce(&nmissing,&all,1,MPI_INT,MPI_SUM,world);
diff --git a/src/ntopo_dihedral_template.cpp b/src/ntopo_dihedral_template.cpp
index 38d319fb9643b6ed5c18cb185f2eea22fbffed5a..8ea860c2e21fdb9b5ee4bc548866b13c2d91a6c0 100644
--- a/src/ntopo_dihedral_template.cpp
+++ b/src/ntopo_dihedral_template.cpp
@@ -78,7 +78,7 @@ void NTopoDihedralTemplate::build()
       atom4 = atom->map(dihedral_atom4[iatom][m]+tagprev);
       if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) {
         nmissing++;
-        if (lostbond == ERROR) {
+        if (lostbond == Thermo::ERROR) {
           char str[128];
           sprintf(str,"Dihedral atoms "
                   TAGINT_FORMAT " " TAGINT_FORMAT " "
@@ -114,7 +114,7 @@ void NTopoDihedralTemplate::build()
   }
 
   if (cluster_check) dihedral_check(ndihedrallist,dihedrallist);
-  if (lostbond == IGNORE) return;
+  if (lostbond == Thermo::IGNORE) return;
 
   int all;
   MPI_Allreduce(&nmissing,&all,1,MPI_INT,MPI_SUM,world);
diff --git a/src/ntopo_improper_all.cpp b/src/ntopo_improper_all.cpp
index ada3927e79c7f70cd2188b46bd40886412e74035..6c478dec527c8e3d75e6c1bdfe0a3dfe5c7396a6 100644
--- a/src/ntopo_improper_all.cpp
+++ b/src/ntopo_improper_all.cpp
@@ -60,7 +60,7 @@ void NTopoImproperAll::build()
       atom4 = atom->map(improper_atom4[i][m]);
       if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) {
         nmissing++;
-        if (lostbond == ERROR) {
+        if (lostbond == Thermo::ERROR) {
           char str[128];
           sprintf(str,"Improper atoms "
                   TAGINT_FORMAT " " TAGINT_FORMAT " "
@@ -93,7 +93,7 @@ void NTopoImproperAll::build()
     }
 
   if (cluster_check) dihedral_check(nimproperlist,improperlist);
-  if (lostbond == IGNORE) return;
+  if (lostbond == Thermo::IGNORE) return;
 
   int all;
   MPI_Allreduce(&nmissing,&all,1,MPI_INT,MPI_SUM,world);
diff --git a/src/ntopo_improper_partial.cpp b/src/ntopo_improper_partial.cpp
index 072a2aa76790d0f762e070c8034dc78e0b73607c..2c37668ca850eb80bcb661ad7857c89bdc185162 100644
--- a/src/ntopo_improper_partial.cpp
+++ b/src/ntopo_improper_partial.cpp
@@ -62,7 +62,7 @@ void NTopoImproperPartial::build()
       atom4 = atom->map(improper_atom4[i][m]);
       if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) {
         nmissing++;
-        if (lostbond == ERROR) {
+        if (lostbond == Thermo::ERROR) {
           char str[128];
           sprintf(str,"Improper atoms "
                   TAGINT_FORMAT " " TAGINT_FORMAT " "
@@ -95,7 +95,7 @@ void NTopoImproperPartial::build()
     }
 
   if (cluster_check) dihedral_check(nimproperlist,improperlist);
-  if (lostbond == IGNORE) return;
+  if (lostbond == Thermo::IGNORE) return;
 
   int all;
   MPI_Allreduce(&nmissing,&all,1,MPI_INT,MPI_SUM,world);
diff --git a/src/ntopo_improper_template.cpp b/src/ntopo_improper_template.cpp
index cb15a077d5a30e928cbd35fc20fdac0ce1322a84..953e010d89a0bd5f1e2f862349216edfdaf97a91 100644
--- a/src/ntopo_improper_template.cpp
+++ b/src/ntopo_improper_template.cpp
@@ -78,7 +78,7 @@ void NTopoImproperTemplate::build()
       atom4 = atom->map(improper_atom4[iatom][m]+tagprev);
       if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) {
         nmissing++;
-        if (lostbond == ERROR) {
+        if (lostbond == Thermo::ERROR) {
           char str[128];
           sprintf(str,"Improper atoms "
                   TAGINT_FORMAT " " TAGINT_FORMAT " "
@@ -114,7 +114,7 @@ void NTopoImproperTemplate::build()
   }
 
   if (cluster_check) dihedral_check(nimproperlist,improperlist);
-  if (lostbond == IGNORE) return;
+  if (lostbond == Thermo::IGNORE) return;
 
   int all;
   MPI_Allreduce(&nmissing,&all,1,MPI_INT,MPI_SUM,world);
diff --git a/src/thermo.cpp b/src/thermo.cpp
index fb3d1abc485df6cd975a68835dd99d771247b287..ade7a3c333ab893fdd14a17adaa94a966328b64a 100644
--- a/src/thermo.cpp
+++ b/src/thermo.cpp
@@ -72,7 +72,6 @@ using namespace MathConst;
 #define ONE "step temp epair emol etotal press"
 #define MULTI "etotal ke temp pe ebond eangle edihed eimp evdwl ecoul elong press"
 
-enum{IGNORE,WARN,ERROR};           // same as several files
 enum{ONELINE,MULTILINE};
 enum{INT,FLOAT,BIGINT};
 enum{SCALAR,VECTOR,ARRAY};
@@ -98,7 +97,7 @@ Thermo::Thermo(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
   modified = 0;
   normuserflag = 0;
   lineflag = ONELINE;
-  lostflag = lostbond = ERROR;
+  lostflag = lostbond = Thermo::ERROR;
   lostbefore = 0;
   flushflag = 0;
 
@@ -427,14 +426,14 @@ bigint Thermo::lost_check()
   if (ntotal == atom->natoms) return ntotal;
 
   // if not checking or already warned, just return
-  if (lostflag == IGNORE) return ntotal;
-  if (lostflag == WARN && lostbefore == 1) {
+  if (lostflag == Thermo::IGNORE) return ntotal;
+  if (lostflag == Thermo::WARN && lostbefore == 1) {
     return ntotal;
   }
 
   // error message
 
-  if (lostflag == ERROR) {
+  if (lostflag == Thermo::ERROR) {
     char str[64];
     sprintf(str,
             "Lost atoms: original " BIGINT_FORMAT " current " BIGINT_FORMAT,
@@ -536,17 +535,17 @@ void Thermo::modify_params(int narg, char **arg)
 
     } else if (strcmp(arg[iarg],"lost") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal thermo_modify command");
-      if (strcmp(arg[iarg+1],"ignore") == 0) lostflag = IGNORE;
-      else if (strcmp(arg[iarg+1],"warn") == 0) lostflag = WARN;
-      else if (strcmp(arg[iarg+1],"error") == 0) lostflag = ERROR;
+      if (strcmp(arg[iarg+1],"ignore") == 0) lostflag = Thermo::IGNORE;
+      else if (strcmp(arg[iarg+1],"warn") == 0) lostflag = Thermo::WARN;
+      else if (strcmp(arg[iarg+1],"error") == 0) lostflag = Thermo::ERROR;
       else error->all(FLERR,"Illegal thermo_modify command");
       iarg += 2;
 
     } else if (strcmp(arg[iarg],"lost/bond") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal thermo_modify command");
-      if (strcmp(arg[iarg+1],"ignore") == 0) lostbond = IGNORE;
-      else if (strcmp(arg[iarg+1],"warn") == 0) lostbond = WARN;
-      else if (strcmp(arg[iarg+1],"error") == 0) lostbond = ERROR;
+      if (strcmp(arg[iarg+1],"ignore") == 0) lostbond = Thermo::IGNORE;
+      else if (strcmp(arg[iarg+1],"warn") == 0) lostbond = Thermo::WARN;
+      else if (strcmp(arg[iarg+1],"error") == 0) lostbond = Thermo::ERROR;
       else error->all(FLERR,"Illegal thermo_modify command");
       iarg += 2;
 
diff --git a/src/thermo.h b/src/thermo.h
index 8023a8867cf337b17b73059775d7e3314b6559d6..8c32f24d3c2142f4953126e97dbd6bdd38921928 100644
--- a/src/thermo.h
+++ b/src/thermo.h
@@ -33,6 +33,8 @@ class Thermo : protected Pointers {
   int lostflag;          // IGNORE,WARN,ERROR
   int lostbond;          // ditto for atoms in bonds
 
+  enum {IGNORE,WARN,ERROR};
+
   Thermo(class LAMMPS *, int, char **);
   ~Thermo();
   void init();
diff --git a/src/write_data.cpp b/src/write_data.cpp
index 85fbe6e5c7cd3f4fa309f8ee470feb1ae87214cc..96bf081157eaf13096dd215477950a5ee0792201 100644
--- a/src/write_data.cpp
+++ b/src/write_data.cpp
@@ -36,7 +36,6 @@
 
 using namespace LAMMPS_NS;
 
-enum{IGNORE,WARN,ERROR};                    // same as thermo.cpp
 enum{II,IJ};
 
 /* ---------------------------------------------------------------------- */
@@ -153,7 +152,7 @@ void WriteData::write(char *file)
   bigint nblocal = atom->nlocal;
   bigint natoms;
   MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
-  if (natoms != atom->natoms && output->thermo->lostflag == ERROR)
+  if (natoms != atom->natoms && output->thermo->lostflag == Thermo::ERROR)
     error->all(FLERR,"Atom count is inconsistent, cannot write data file");
 
   // sum up bond,angle,dihedral,improper counts
diff --git a/src/write_restart.cpp b/src/write_restart.cpp
index c82791e2c1c7c1d0f8a50e6faa695c39873e8c8a..69b731870d0c28fe6f389da0183f1905664a0400 100644
--- a/src/write_restart.cpp
+++ b/src/write_restart.cpp
@@ -63,8 +63,6 @@ enum{VERSION,SMALLINT,TAGINT,BIGINT,
      ATOM_ID,ATOM_MAP_STYLE,ATOM_MAP_USER,ATOM_SORTFREQ,ATOM_SORTBIN,
      COMM_MODE,COMM_CUTOFF,COMM_VEL,NO_PAIR};
 
-enum{IGNORE,WARN,ERROR};                    // same as thermo.cpp
-
 /* ---------------------------------------------------------------------- */
 
 WriteRestart::WriteRestart(LAMMPS *lmp) : Pointers(lmp)
@@ -252,7 +250,7 @@ void WriteRestart::write(char *file)
 
   bigint nblocal = atom->nlocal;
   MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
-  if (natoms != atom->natoms && output->thermo->lostflag == ERROR)
+  if (natoms != atom->natoms && output->thermo->lostflag == Thermo::ERROR)
     error->all(FLERR,"Atom count is inconsistent, cannot write restart file");
 
   // open single restart file or base file for multiproc case