diff --git a/src/ASPHERE/compute_erotate_asphere.cpp b/src/ASPHERE/compute_erotate_asphere.cpp
index 31d500c4a3f0a0434964874f61669e0647719c4d..80c4083a9ff75b2dff274d185ec7899259446f9b 100644
--- a/src/ASPHERE/compute_erotate_asphere.cpp
+++ b/src/ASPHERE/compute_erotate_asphere.cpp
@@ -29,7 +29,7 @@ ComputeERotateAsphere::
 ComputeERotateAsphere(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Illegal compute erotate/asphere command");
+  if (narg != 3) error->all(FLERR,"Illegal compute erotate/asphere command");
 
   scalar_flag = 1;
   extscalar = 1;
@@ -38,7 +38,7 @@ ComputeERotateAsphere(LAMMPS *lmp, int narg, char **arg) :
 
   avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
   if (!avec) 
-    error->all("Compute erotate/asphere requires atom style ellipsoid");
+    error->all(FLERR,"Compute erotate/asphere requires atom style ellipsoid");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -55,7 +55,7 @@ void ComputeERotateAsphere::init()
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit)
       if (ellipsoid[i] < 0)
-	error->one("Compute erotate/asphere requires extended particles");
+	error->one(FLERR,"Compute erotate/asphere requires extended particles");
 
   pfactor = 0.5 * force->mvv2e;
 }
diff --git a/src/ASPHERE/compute_temp_asphere.cpp b/src/ASPHERE/compute_temp_asphere.cpp
index b4fb8c79f86663b80f29efcfb6cdcfe7fdbaa968..69139369cf2a7e62e45ac403705f8216e8b0ad82 100755
--- a/src/ASPHERE/compute_temp_asphere.cpp
+++ b/src/ASPHERE/compute_temp_asphere.cpp
@@ -41,7 +41,7 @@ enum{ROTATE,ALL};
 ComputeTempAsphere::ComputeTempAsphere(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg < 3) error->all("Illegal compute temp/asphere command");
+  if (narg < 3) error->all(FLERR,"Illegal compute temp/asphere command");
 
   scalar_flag = vector_flag = 1;
   size_vector = 6;
@@ -56,19 +56,19 @@ ComputeTempAsphere::ComputeTempAsphere(LAMMPS *lmp, int narg, char **arg) :
   int iarg = 3;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"bias") == 0) {
-      if (iarg+2 > narg) error->all("Illegal compute temp/asphere command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal compute temp/asphere command");
       tempbias = 1;
       int n = strlen(arg[iarg+1]) + 1;
       id_bias = new char[n];
       strcpy(id_bias,arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"dof") == 0) {
-      if (iarg+2 > narg) error->all("Illegal compute temp/asphere command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal compute temp/asphere command");
       if (strcmp(arg[iarg+1],"rotate") == 0) mode = ROTATE;
       else if (strcmp(arg[iarg+1],"all") == 0) mode = ALL;
-      else error->all("Illegal compute temp/asphere command");
+      else error->all(FLERR,"Illegal compute temp/asphere command");
       iarg += 2;
-    } else error->all("Illegal compute temp/asphere command");
+    } else error->all(FLERR,"Illegal compute temp/asphere command");
   }
 
   vector = new double[6];
@@ -77,7 +77,7 @@ ComputeTempAsphere::ComputeTempAsphere(LAMMPS *lmp, int narg, char **arg) :
 
   avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
   if (!avec) 
-    error->all("Compute temp/asphere requires atom style ellipsoid");
+    error->all(FLERR,"Compute temp/asphere requires atom style ellipsoid");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -101,18 +101,18 @@ void ComputeTempAsphere::init()
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit)
       if (ellipsoid[i] < 0)
-	error->one("Compute temp/asphere requires extended particles");
+	error->one(FLERR,"Compute temp/asphere requires extended particles");
 
   if (tempbias) {
     int i = modify->find_compute(id_bias);
-    if (i < 0) error->all("Could not find compute ID for temperature bias");
+    if (i < 0) error->all(FLERR,"Could not find compute ID for temperature bias");
     tbias = modify->compute[i];
     if (tbias->tempflag == 0)
-      error->all("Bias compute does not calculate temperature");
+      error->all(FLERR,"Bias compute does not calculate temperature");
     if (tbias->tempbias == 0)
-      error->all("Bias compute does not calculate a velocity bias");
+      error->all(FLERR,"Bias compute does not calculate a velocity bias");
     if (tbias->igroup != igroup)
-      error->all("Bias compute group does not match compute group");
+      error->all(FLERR,"Bias compute group does not match compute group");
     tbias->init();
     if (strcmp(tbias->style,"temp/region") == 0) tempbias = 2;
     else tempbias = 1;
diff --git a/src/ASPHERE/fix_nh_asphere.cpp b/src/ASPHERE/fix_nh_asphere.cpp
index bc58472bb561a49a82d377ca56bc257868624741..3d912623454147e3980eb5b5d04e88834d6bd732 100644
--- a/src/ASPHERE/fix_nh_asphere.cpp
+++ b/src/ASPHERE/fix_nh_asphere.cpp
@@ -35,7 +35,7 @@ FixNHAsphere::FixNHAsphere(LAMMPS *lmp, int narg, char **arg) :
 {
   avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
   if (!avec) 
-    error->all("Compute nvt/nph/npt asphere requires atom style ellipsoid");
+    error->all(FLERR,"Compute nvt/nph/npt asphere requires atom style ellipsoid");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -52,7 +52,7 @@ void FixNHAsphere::init()
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit)
       if (ellipsoid[i] < 0)
-	error->one("Fix nvt/nph/npt asphere requires extended particles");
+	error->one(FLERR,"Fix nvt/nph/npt asphere requires extended particles");
 
   FixNH::init();
 }
diff --git a/src/ASPHERE/fix_nph_asphere.cpp b/src/ASPHERE/fix_nph_asphere.cpp
index 025137def2246fff30ded52826c977abca375286..094e0f06a6faa3650bd9dc675c474baf30e66fec 100644
--- a/src/ASPHERE/fix_nph_asphere.cpp
+++ b/src/ASPHERE/fix_nph_asphere.cpp
@@ -24,9 +24,9 @@ FixNPHAsphere::FixNPHAsphere(LAMMPS *lmp, int narg, char **arg) :
   FixNHAsphere(lmp, narg, arg)
 {
   if (tstat_flag)
-    error->all("Temperature control can not be used with fix nph/asphere");
+    error->all(FLERR,"Temperature control can not be used with fix nph/asphere");
   if (!pstat_flag)
-    error->all("Pressure control must be used with fix nph/asphere");
+    error->all(FLERR,"Pressure control must be used with fix nph/asphere");
 
   // create a new compute temp style
   // id = fix-ID + temp
diff --git a/src/ASPHERE/fix_npt_asphere.cpp b/src/ASPHERE/fix_npt_asphere.cpp
index 44ed01ea45bb19156f3e51d060086ea0849f46d7..2c3c70e9487c1404c8d2d1d8a117e99132052b12 100755
--- a/src/ASPHERE/fix_npt_asphere.cpp
+++ b/src/ASPHERE/fix_npt_asphere.cpp
@@ -24,9 +24,9 @@ FixNPTAsphere::FixNPTAsphere(LAMMPS *lmp, int narg, char **arg) :
   FixNHAsphere(lmp, narg, arg)
 {
   if (!tstat_flag)
-    error->all("Temperature control must be used with fix npt/asphere");
+    error->all(FLERR,"Temperature control must be used with fix npt/asphere");
   if (!pstat_flag)
-    error->all("Pressure control must be used with fix npt/asphere");
+    error->all(FLERR,"Pressure control must be used with fix npt/asphere");
 
   // create a new compute temp style
   // id = fix-ID + temp
diff --git a/src/ASPHERE/fix_nve_asphere.cpp b/src/ASPHERE/fix_nve_asphere.cpp
index e078d2fb7542cd9399bc6a47d095b9e88a15bbdc..17ae8950e14a9f38154981d946fc159d65fabb0f 100755
--- a/src/ASPHERE/fix_nve_asphere.cpp
+++ b/src/ASPHERE/fix_nve_asphere.cpp
@@ -38,7 +38,7 @@ FixNVEAsphere::FixNVEAsphere(LAMMPS *lmp, int narg, char **arg) :
 {
   avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
   if (!avec) 
-    error->all("Compute nve/asphere requires atom style ellipsoid");
+    error->all(FLERR,"Compute nve/asphere requires atom style ellipsoid");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -55,7 +55,7 @@ void FixNVEAsphere::init()
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit)
       if (ellipsoid[i] < 0)
-	error->one("Fix nve/asphere requires extended particles");
+	error->one(FLERR,"Fix nve/asphere requires extended particles");
 
   FixNVE::init();
 }
diff --git a/src/ASPHERE/fix_nvt_asphere.cpp b/src/ASPHERE/fix_nvt_asphere.cpp
index 4137941be9bdb788d918b975e8768432434bf535..8578da033ea5e26332ec57b03247543ea721c6d2 100755
--- a/src/ASPHERE/fix_nvt_asphere.cpp
+++ b/src/ASPHERE/fix_nvt_asphere.cpp
@@ -25,9 +25,9 @@ FixNVTAsphere::FixNVTAsphere(LAMMPS *lmp, int narg, char **arg) :
   FixNHAsphere(lmp, narg, arg)
 {
   if (!tstat_flag)
-    error->all("Temperature control must be used with fix nvt/asphere");
+    error->all(FLERR,"Temperature control must be used with fix nvt/asphere");
   if (pstat_flag)
-    error->all("Pressure control can not be used with fix nvt/asphere");
+    error->all(FLERR,"Pressure control can not be used with fix nvt/asphere");
 
   // create a new compute temp style
   // id = fix-ID + temp
diff --git a/src/ASPHERE/pair_gayberne.cpp b/src/ASPHERE/pair_gayberne.cpp
index 97a7bc56b30064b3ea1d566ea1dcc3abf7b768c9..19dfdecde84d1783839dd9e0ff79c96ae3340643 100755
--- a/src/ASPHERE/pair_gayberne.cpp
+++ b/src/ASPHERE/pair_gayberne.cpp
@@ -31,9 +31,6 @@
 #include "memory.h"
 #include "error.h"
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 using namespace LAMMPS_NS;
 
 enum{SPHERE_SPHERE,SPHERE_ELLIPSE,ELLIPSE_SPHERE,ELLIPSE_ELLIPSE};
@@ -43,7 +40,7 @@ enum{SPHERE_SPHERE,SPHERE_ELLIPSE,ELLIPSE_SPHERE,ELLIPSE_ELLIPSE};
 PairGayBerne::PairGayBerne(LAMMPS *lmp) : Pair(lmp)
 {
   avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
-  if (!avec) error->all("Pair gayberne requires atom style ellipsoid");
+  if (!avec) error->all(FLERR,"Pair gayberne requires atom style ellipsoid");
 
   single_enable = 0;
 }
@@ -262,7 +259,7 @@ void PairGayBerne::allocate()
 
 void PairGayBerne::settings(int narg, char **arg)
 {
-  if (narg != 4) error->all("Illegal pair_style command");
+  if (narg != 4) error->all(FLERR,"Illegal pair_style command");
 
   gamma = force->numeric(arg[0]);
   upsilon = force->numeric(arg[1])/2.0;
@@ -286,7 +283,7 @@ void PairGayBerne::settings(int narg, char **arg)
 void PairGayBerne::coeff(int narg, char **arg)
 {
   if (narg < 10 || narg > 11)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -330,7 +327,7 @@ void PairGayBerne::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 
@@ -348,7 +345,7 @@ void PairGayBerne::init_style()
 
   for (int i = 1; i <= atom->ntypes; i++) {
     if (!atom->shape_consistency(i,shape1[i][0],shape1[i][1],shape1[i][2]))
-      error->all("Pair gayberne requires atoms with same type have same shape");
+      error->all(FLERR,"Pair gayberne requires atoms with same type have same shape");
     if (shape1[i][0] == 0.0)
       shape1[i][0] = shape1[i][1] = shape1[i][2] = 1.0;
     shape2[i][0] = shape1[i][0]*shape1[i][0];
@@ -366,7 +363,7 @@ void PairGayBerne::init_style()
 double PairGayBerne::init_one(int i, int j)
 {
   if (setwell[i] == 0 || setwell[j] == 0)
-    error->all("Pair gayberne epsilon a,b,c coeffs are not all set");
+    error->all(FLERR,"Pair gayberne epsilon a,b,c coeffs are not all set");
 
   if (setflag[i][j] == 0) {
     epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j],
@@ -545,7 +542,7 @@ double PairGayBerne::gayberne_analytic(const int i,const int j,double a1[3][3],
   MathExtra::plus3(g1,g2,g12);
   double kappa[3];
   int ierror = MathExtra::mldivide3(g12,r12,kappa);
-  if (ierror) error->all("Bad matrix inversion in mldivide3");
+  if (ierror) error->all(FLERR,"Bad matrix inversion in mldivide3");
 
   // tempv = G12^-1*r12hat
 
@@ -576,7 +573,7 @@ double PairGayBerne::gayberne_analytic(const int i,const int j,double a1[3][3],
   double iota[3];
   MathExtra::plus3(b1,b2,b12);
   ierror = MathExtra::mldivide3(b12,r12,iota);
-  if (ierror) error->all("Bad matrix inversion in mldivide3");
+  if (ierror) error->all(FLERR,"Bad matrix inversion in mldivide3");
 
   // tempv = G12^-1*r12hat
 
@@ -726,7 +723,7 @@ double PairGayBerne::gayberne_lj(const int i,const int j,double a1[3][3],
   g12[1][2] = g1[1][2]; g12[2][1] = g1[2][1];
   double kappa[3];
   int ierror = MathExtra::mldivide3(g12,r12,kappa);
-  if (ierror) error->all("Bad matrix inversion in mldivide3");
+  if (ierror) error->all(FLERR,"Bad matrix inversion in mldivide3");
 
   // tempv = G12^-1*r12hat
 
@@ -762,7 +759,7 @@ double PairGayBerne::gayberne_lj(const int i,const int j,double a1[3][3],
   b12[0][2] = b1[0][2]; b12[2][0] = b1[2][0];
   b12[1][2] = b1[1][2]; b12[2][1] = b1[2][1];
   ierror = MathExtra::mldivide3(b12,r12,iota);
-  if (ierror) error->all("Bad matrix inversion in mldivide3");
+  if (ierror) error->all(FLERR,"Bad matrix inversion in mldivide3");
 
   // tempv = G12^-1*r12hat
 
diff --git a/src/ASPHERE/pair_resquared.cpp b/src/ASPHERE/pair_resquared.cpp
index 41d964a4e7fa550116d9d6652502b3027e6d0099..20457226d5a5721abcf7d0ae0818ca1b4fc6c2a5 100755
--- a/src/ASPHERE/pair_resquared.cpp
+++ b/src/ASPHERE/pair_resquared.cpp
@@ -31,9 +31,6 @@
 #include "memory.h"
 #include "error.h"
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 using namespace LAMMPS_NS;
 
 enum{SPHERE_SPHERE,SPHERE_ELLIPSE,ELLIPSE_SPHERE,ELLIPSE_ELLIPSE};
@@ -45,7 +42,7 @@ PairRESquared::PairRESquared(LAMMPS *lmp) : Pair(lmp),
                                             cr60(pow(60.0,1.0/3.0))
 {
   avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
-  if (!avec) error->all("Pair resquared requires atom style ellipsoid");
+  if (!avec) error->all(FLERR,"Pair resquared requires atom style ellipsoid");
 
   single_enable = 0;
 
@@ -250,7 +247,7 @@ void PairRESquared::allocate()
 
 void PairRESquared::settings(int narg, char **arg)
 {
-  if (narg != 1) error->all("Illegal pair_style command");
+  if (narg != 1) error->all(FLERR,"Illegal pair_style command");
 
   cut_global = force->numeric(arg[0]);
   
@@ -271,7 +268,7 @@ void PairRESquared::settings(int narg, char **arg)
 void PairRESquared::coeff(int narg, char **arg)
 {
   if (narg < 10 || narg > 11)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -315,7 +312,7 @@ void PairRESquared::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -331,7 +328,7 @@ void PairRESquared::init_style()
 
   for (int i = 1; i <= atom->ntypes; i++) {
     if (!atom->shape_consistency(i,shape1[i][0],shape1[i][1],shape1[i][2]))
-      error->all("Pair gayberne requires atoms with same type have same shape");
+      error->all(FLERR,"Pair gayberne requires atoms with same type have same shape");
     if (setwell[i]) {
       shape2[i][0] = shape1[i][0]*shape1[i][0];
       shape2[i][1] = shape1[i][1]*shape1[i][1];
@@ -348,7 +345,7 @@ void PairRESquared::init_style()
 double PairRESquared::init_one(int i, int j)
 {
   if (setwell[i] == 0 || setwell[j] == 0)
-    error->all("Pair resquared epsilon a,b,c coeffs are not all set");
+    error->all(FLERR,"Pair resquared epsilon a,b,c coeffs are not all set");
 
   int ishape = 0;
   if (shape1[i][0] != 0.0 && shape1[i][1] != 0.0 && shape1[i][2] != 0.0) 
@@ -381,7 +378,7 @@ double PairRESquared::init_one(int i, int j)
         sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]);
         cut[i][j] = mix_distance(cut[i][i],cut[j][j]);
       } else
-        error->all("Pair resquared epsilon and sigma coeffs are not all set");
+        error->all(FLERR,"Pair resquared epsilon and sigma coeffs are not all set");
     }
     epsilon[i][j] = epsilon[j][i];
     sigma[i][j] = sigma[j][i];
@@ -612,7 +609,7 @@ double PairRESquared::resquared_analytic(const int i, const int j,
   double temp[3][3];
   MathExtra::plus3(wi.gamma,wj.gamma,temp);
   int ierror = MathExtra::mldivide3(temp,rhat,s);
-  if (ierror) error->all("Bad matrix inversion in mldivide3");
+  if (ierror) error->all(FLERR,"Bad matrix inversion in mldivide3");
 
   sigma12 = 1.0/sqrt(0.5*MathExtra::dot3(s,rhat));
   MathExtra::matvec(wi.A,rhat,z1);
@@ -644,7 +641,7 @@ double PairRESquared::resquared_analytic(const int i, const int j,
   MathExtra::times3(wj.aTe,wj.A,temp2);
   MathExtra::plus3(temp,temp2,temp);
   ierror = MathExtra::mldivide3(temp,rhat,w);
-  if (ierror) error->all("Bad matrix inversion in mldivide3");
+  if (ierror) error->all(FLERR,"Bad matrix inversion in mldivide3");
 
   h12 = rnorm-sigma12;
   eta = lambda/nu;
@@ -898,7 +895,7 @@ double PairRESquared::resquared_lj(const int i, const int j,
   // energy
 
   int ierror = MathExtra::mldivide3(gamma,rhat,s);
-  if (ierror) error->all("Bad matrix inversion in mldivide3");
+  if (ierror) error->all(FLERR,"Bad matrix inversion in mldivide3");
 
   sigma12 = 1.0/sqrt(0.5*MathExtra::dot3(s,rhat));
   double temp[3][3];
@@ -907,7 +904,7 @@ double PairRESquared::resquared_lj(const int i, const int j,
   temp[1][1] += 1.0;
   temp[2][2] += 1.0;
   ierror = MathExtra::mldivide3(temp,rhat,w);
-  if (ierror) error->all("Bad matrix inversion in mldivide3");
+  if (ierror) error->all(FLERR,"Bad matrix inversion in mldivide3");
 
   h12 = rnorm-sigma12;
   chi = 2.0*MathExtra::dot3(rhat,w);
diff --git a/src/CLASS2/angle_class2.cpp b/src/CLASS2/angle_class2.cpp
index ed9f16285c33a5dd52823cb1ed0c1b0fa02083e6..ca69cca5b2ed559fb657c992ed103f95c50be51d 100644
--- a/src/CLASS2/angle_class2.cpp
+++ b/src/CLASS2/angle_class2.cpp
@@ -267,7 +267,7 @@ void AngleClass2::allocate()
 
 void AngleClass2::coeff(int narg, char **arg)
 {
-  if (narg < 2) error->all("Incorrect args for angle coefficients");
+  if (narg < 2) error->all(FLERR,"Incorrect args for angle coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -276,7 +276,7 @@ void AngleClass2::coeff(int narg, char **arg)
   int count = 0;
 
   if (strcmp(arg[1],"bb") == 0) {
-    if (narg != 5) error->all("Incorrect args for angle coefficients");
+    if (narg != 5) error->all(FLERR,"Incorrect args for angle coefficients");
 
     double bb_k_one = force->numeric(arg[2]);
     double bb_r1_one = force->numeric(arg[3]);
@@ -291,7 +291,7 @@ void AngleClass2::coeff(int narg, char **arg)
     }
 
   } else if (strcmp(arg[1],"ba") == 0) {
-    if (narg != 6) error->all("Incorrect args for angle coefficients");
+    if (narg != 6) error->all(FLERR,"Incorrect args for angle coefficients");
 
     double ba_k1_one = force->numeric(arg[2]);
     double ba_k2_one = force->numeric(arg[3]);
@@ -308,7 +308,7 @@ void AngleClass2::coeff(int narg, char **arg)
     }
 
   } else {
-    if (narg != 5) error->all("Incorrect args for angle coefficients");
+    if (narg != 5) error->all(FLERR,"Incorrect args for angle coefficients");
 
     double theta0_one = force->numeric(arg[1]);
     double k2_one = force->numeric(arg[2]);
@@ -327,7 +327,7 @@ void AngleClass2::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for angle coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for angle coefficients");
 
   for (int i = ilo; i <= ihi; i++)
     if (setflag_a[i] == 1 && setflag_bb[i] == 1 && setflag_ba[i] == 1)
diff --git a/src/CLASS2/bond_class2.cpp b/src/CLASS2/bond_class2.cpp
index 39e797ad9e1356a6f2ecd745a59077b60b0a2a8e..f18d687fe7e044a1bf6814690ace3ab7c209a3bd 100644
--- a/src/CLASS2/bond_class2.cpp
+++ b/src/CLASS2/bond_class2.cpp
@@ -129,7 +129,7 @@ void BondClass2::allocate()
 
 void BondClass2::coeff(int narg, char **arg)
 {
-  if (narg != 5) error->all("Incorrect args for bond coefficients");
+  if (narg != 5) error->all(FLERR,"Incorrect args for bond coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -150,7 +150,7 @@ void BondClass2::coeff(int narg, char **arg)
     count++;
   }
 
-  if (count == 0) error->all("Incorrect args for bond coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for bond coefficients");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/CLASS2/dihedral_class2.cpp b/src/CLASS2/dihedral_class2.cpp
index 695333a565511f8b9828a7c1b57ca2633f052baf..d6e31696d7b7dfa2949eb31d1bc1c16c8f08edde 100644
--- a/src/CLASS2/dihedral_class2.cpp
+++ b/src/CLASS2/dihedral_class2.cpp
@@ -31,9 +31,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 #define TOLERANCE 0.05
 #define SMALL     0.0000001
 
@@ -214,7 +211,7 @@ void DihedralClass2::compute(int eflag, int vflag)
 	sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
 		me,update->ntimestep,
 		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(str,0);
+	error->warning(FLERR,str,0);
 	fprintf(screen,"  1st atom: %d %g %g %g\n",
 		me,x[i1][0],x[i1][1],x[i1][2]);
 	fprintf(screen,"  2nd atom: %d %g %g %g\n",
@@ -629,7 +626,7 @@ void DihedralClass2::allocate()
 
 void DihedralClass2::coeff(int narg, char **arg)
 {
-  if (narg < 2) error->all("Invalid coeffs for this dihedral style");
+  if (narg < 2) error->all(FLERR,"Invalid coeffs for this dihedral style");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -638,7 +635,7 @@ void DihedralClass2::coeff(int narg, char **arg)
   int count = 0;
 
   if (strcmp(arg[1],"mbt") == 0) {
-    if (narg != 6) error->all("Incorrect args for dihedral coefficients");
+    if (narg != 6) error->all(FLERR,"Incorrect args for dihedral coefficients");
 
     double f1_one = force->numeric(arg[2]);
     double f2_one = force->numeric(arg[3]);
@@ -655,7 +652,7 @@ void DihedralClass2::coeff(int narg, char **arg)
     }
 
   } else if (strcmp(arg[1],"ebt") == 0) {
-    if (narg != 10) error->all("Incorrect args for dihedral coefficients");
+    if (narg != 10) error->all(FLERR,"Incorrect args for dihedral coefficients");
 
     double f1_1_one = force->numeric(arg[2]);
     double f2_1_one = force->numeric(arg[3]);
@@ -680,7 +677,7 @@ void DihedralClass2::coeff(int narg, char **arg)
     }
 
   } else if (strcmp(arg[1],"at") == 0) {
-    if (narg != 10) error->all("Incorrect args for dihedral coefficients");
+    if (narg != 10) error->all(FLERR,"Incorrect args for dihedral coefficients");
 
     double f1_1_one = force->numeric(arg[2]);
     double f2_1_one = force->numeric(arg[3]);
@@ -707,7 +704,7 @@ void DihedralClass2::coeff(int narg, char **arg)
     }
 
   } else if (strcmp(arg[1],"aat") == 0) {
-    if (narg != 5) error->all("Incorrect args for dihedral coefficients");
+    if (narg != 5) error->all(FLERR,"Incorrect args for dihedral coefficients");
 
     double k_one = force->numeric(arg[2]);
     double theta0_1_one = force->numeric(arg[3]);
@@ -724,7 +721,7 @@ void DihedralClass2::coeff(int narg, char **arg)
     }
 
   } else if (strcmp(arg[1],"bb13") == 0) {
-    if (narg != 5) error->all("Incorrect args for dihedral coefficients");
+    if (narg != 5) error->all(FLERR,"Incorrect args for dihedral coefficients");
 
     double k_one = force->numeric(arg[2]);
     double r10_one = force->numeric(arg[3]);
@@ -739,7 +736,7 @@ void DihedralClass2::coeff(int narg, char **arg)
     }
 
   } else {
-    if (narg != 7) error->all("Incorrect args for dihedral coefficients");
+    if (narg != 7) error->all(FLERR,"Incorrect args for dihedral coefficients");
 
     double k1_one = force->numeric(arg[1]);
     double phi1_one = force->numeric(arg[2]);
@@ -762,7 +759,7 @@ void DihedralClass2::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for dihedral coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for dihedral coefficients");
 
   for (int i = ilo; i <= ihi; i++)
     if (setflag_d[i] == 1 && setflag_mbt[i] == 1 && setflag_ebt[i] == 1 &&
diff --git a/src/CLASS2/improper_class2.cpp b/src/CLASS2/improper_class2.cpp
index 152c29bfa3e3cda7b883315b62823115a3dbefce..7329870aec80e19633721bd1adc8c0500655b05c 100644
--- a/src/CLASS2/improper_class2.cpp
+++ b/src/CLASS2/improper_class2.cpp
@@ -162,7 +162,7 @@ void ImproperClass2::compute(int eflag, int vflag)
 		  "Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
 		  me,update->ntimestep,
 		  atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	  error->warning(str,0);
+	  error->warning(FLERR,str,0);
 	  fprintf(screen,"  1st atom: %d %g %g %g\n",
 		  me,x[i1][0],x[i1][1],x[i1][2]);
 	  fprintf(screen,"  2nd atom: %d %g %g %g\n",
@@ -526,7 +526,7 @@ void ImproperClass2::allocate()
 
 void ImproperClass2::coeff(int narg, char **arg)
 {
-  if (narg < 2) error->all("Incorrect args for improper coefficients");
+  if (narg < 2) error->all(FLERR,"Incorrect args for improper coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -535,7 +535,7 @@ void ImproperClass2::coeff(int narg, char **arg)
   int count = 0;
 
   if (strcmp(arg[1],"aa") == 0) {
-    if (narg != 8) error->all("Incorrect args for improper coefficients");
+    if (narg != 8) error->all(FLERR,"Incorrect args for improper coefficients");
 
     double k1_one = force->numeric(arg[2]);
     double k2_one = force->numeric(arg[3]);
@@ -558,7 +558,7 @@ void ImproperClass2::coeff(int narg, char **arg)
     }
 
   } else {
-    if (narg != 3) error->all("Incorrect args for improper coefficients");
+    if (narg != 3) error->all(FLERR,"Incorrect args for improper coefficients");
 
     double k0_one = force->numeric(arg[1]);
     double chi0_one = force->numeric(arg[2]);
@@ -573,7 +573,7 @@ void ImproperClass2::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for improper coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for improper coefficients");
 
   for (int i = ilo; i <= ihi; i++)
     if (setflag_i[i] == 1 && setflag_aa[i] == 1) setflag[i] = 1;
diff --git a/src/CLASS2/pair_lj_class2.cpp b/src/CLASS2/pair_lj_class2.cpp
index c77443081f7eb370437d6ee88f673f7626064400..aba3715cc11905075421a9a9fc539709fbdd833f 100644
--- a/src/CLASS2/pair_lj_class2.cpp
+++ b/src/CLASS2/pair_lj_class2.cpp
@@ -24,9 +24,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairLJClass2::PairLJClass2(LAMMPS *lmp) : Pair(lmp) {}
@@ -161,7 +158,7 @@ void PairLJClass2::allocate()
 
 void PairLJClass2::settings(int narg, char **arg)
 {
-  if (narg != 1) error->all("Illegal pair_style command");
+  if (narg != 1) error->all(FLERR,"Illegal pair_style command");
 
   cut_global = force->numeric(arg[0]);
 
@@ -181,7 +178,7 @@ void PairLJClass2::settings(int narg, char **arg)
 
 void PairLJClass2::coeff(int narg, char **arg)
 {
-  if (narg < 4 || narg > 5) error->all("Incorrect args for pair coefficients");
+  if (narg < 4 || narg > 5) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -205,7 +202,7 @@ void PairLJClass2::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/CLASS2/pair_lj_class2_coul_cut.cpp b/src/CLASS2/pair_lj_class2_coul_cut.cpp
index c7107077d2ac6c3570d7314cd552a789034645bf..b6dc7d8018cf6bc8a307da752d8474f6f8723e1e 100644
--- a/src/CLASS2/pair_lj_class2_coul_cut.cpp
+++ b/src/CLASS2/pair_lj_class2_coul_cut.cpp
@@ -25,9 +25,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairLJClass2CoulCut::PairLJClass2CoulCut(LAMMPS *lmp) : Pair(lmp) {}
@@ -187,7 +184,7 @@ void PairLJClass2CoulCut::allocate()
 
 void PairLJClass2CoulCut::settings(int narg, char **arg)
 {
-  if (narg < 1 || narg > 2) error->all("Illegal pair_style command");
+  if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command");
 
   cut_lj_global = force->numeric(arg[0]);
   if (narg == 1) cut_coul_global = cut_lj_global;
@@ -212,7 +209,7 @@ void PairLJClass2CoulCut::settings(int narg, char **arg)
 
 void PairLJClass2CoulCut::coeff(int narg, char **arg)
 {
-  if (narg < 4 || narg > 6) error->all("Incorrect args for pair coefficients");
+  if (narg < 4 || narg > 6) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -239,7 +236,7 @@ void PairLJClass2CoulCut::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -249,7 +246,7 @@ void PairLJClass2CoulCut::coeff(int narg, char **arg)
 void PairLJClass2CoulCut::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style lj/class2/coul/cut requires atom attribute q");
+    error->all(FLERR,"Pair style lj/class2/coul/cut requires atom attribute q");
 
   neighbor->request(this);
 }
diff --git a/src/CLASS2/pair_lj_class2_coul_long.cpp b/src/CLASS2/pair_lj_class2_coul_long.cpp
index 280dacad01eaeaff8103db24748d8a3530712476..b9423c47282a25e00b3f70bc7ae595bd8e26d3f9 100644
--- a/src/CLASS2/pair_lj_class2_coul_long.cpp
+++ b/src/CLASS2/pair_lj_class2_coul_long.cpp
@@ -27,9 +27,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define EWALD_F   1.12837917
 #define EWALD_P   0.3275911
 #define A1        0.254829592
@@ -202,7 +199,7 @@ void PairLJClass2CoulLong::allocate()
 
 void PairLJClass2CoulLong::settings(int narg, char **arg)
 {
-  if (narg < 1 || narg > 2) error->all("Illegal pair_style command");
+  if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command");
 
   cut_lj_global = force->numeric(arg[0]);
   if (narg == 1) cut_coul = cut_lj_global;
@@ -224,7 +221,7 @@ void PairLJClass2CoulLong::settings(int narg, char **arg)
 
 void PairLJClass2CoulLong::coeff(int narg, char **arg)
 {
-  if (narg < 4 || narg > 6) error->all("Incorrect args for pair coefficients");
+  if (narg < 4 || narg > 6) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -248,7 +245,7 @@ void PairLJClass2CoulLong::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -258,7 +255,7 @@ void PairLJClass2CoulLong::coeff(int narg, char **arg)
 void PairLJClass2CoulLong::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style lj/class2/coul/long requires atom attribute q");
+    error->all(FLERR,"Pair style lj/class2/coul/long requires atom attribute q");
 
   neighbor->request(this);
 
@@ -267,7 +264,7 @@ void PairLJClass2CoulLong::init_style()
   // insure use of KSpace long-range solver, set g_ewald
 
  if (force->kspace == NULL) 
-    error->all("Pair style is incompatible with KSpace style");
+    error->all(FLERR,"Pair style is incompatible with KSpace style");
   g_ewald = force->kspace->g_ewald;
 }
 
diff --git a/src/COLLOID/fix_wall_colloid.cpp b/src/COLLOID/fix_wall_colloid.cpp
index 7627fca708c5b868ed94d3a644ce2c5f0f5844f6..e4267358c87e37fd3c6ac2f32a5b8e4c1866ba73 100644
--- a/src/COLLOID/fix_wall_colloid.cpp
+++ b/src/COLLOID/fix_wall_colloid.cpp
@@ -36,7 +36,7 @@ FixWallColloid::FixWallColloid(LAMMPS *lmp, int narg, char **arg) :
 void FixWallColloid::init()
 {
   if (!atom->sphere_flag) 
-    error->all("Fix wall/colloid requires atom style sphere");
+    error->all(FLERR,"Fix wall/colloid requires atom style sphere");
 
   // insure all particles in group are extended particles
 
@@ -51,7 +51,7 @@ void FixWallColloid::init()
 
   int flagall;
   MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
-  if (flagall) error->all("Fix wall/colloid requires extended particles");
+  if (flagall) error->all(FLERR,"Fix wall/colloid requires extended particles");
 
   FixWall::init();
 }
@@ -154,5 +154,5 @@ void FixWallColloid::wall_particle(int m, int which, double coord)
       ewall[m+1] += fwall;
     }
 
-  if (onflag) error->one("Particle on or inside fix wall surface");
+  if (onflag) error->one(FLERR,"Particle on or inside fix wall surface");
 }
diff --git a/src/COLLOID/pair_colloid.cpp b/src/COLLOID/pair_colloid.cpp
index db0c612aeca7f270f4143712439ff837851eaa8d..1965e98ac0adabbc182b41767c629028cded3141 100644
--- a/src/COLLOID/pair_colloid.cpp
+++ b/src/COLLOID/pair_colloid.cpp
@@ -30,9 +30,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 enum{SMALL_SMALL,SMALL_LARGE,LARGE_LARGE};
 
 /* ---------------------------------------------------------------------- */
@@ -144,7 +141,7 @@ void PairColloid::compute(int eflag, int vflag)
 	  evdwl = 2.0/9.0*fR * 
 	    (1.0-(K[1]*(K[1]*(K[1]/3.0+3.0*K[2])+4.2*K[4])+K[2]*K[4]) *
 	     sigma6[itype][jtype]/K[6]) - offset[itype][jtype];
-	if (rsq <= K[1]) error->one("Overlapping small/large in pair colloid");
+	if (rsq <= K[1]) error->one(FLERR,"Overlapping small/large in pair colloid");
 	break;
 
       case LARGE_LARGE:
@@ -182,7 +179,7 @@ void PairColloid::compute(int eflag, int vflag)
 	if (eflag)
 	  evdwl += a12[itype][jtype]/6.0 * 
 	    (2.0*K[0]*(K[7]+K[8])-log(K[8]/K[7])) - offset[itype][jtype];
-	if (r <= K[1]) error->one("Overlapping large/large in pair colloid");
+	if (r <= K[1]) error->one(FLERR,"Overlapping large/large in pair colloid");
 	break;
       }
       
@@ -245,7 +242,7 @@ void PairColloid::allocate()
 
 void PairColloid::settings(int narg, char **arg)
 {
-  if (narg != 1) error->all("Illegal pair_style command");
+  if (narg != 1) error->all(FLERR,"Illegal pair_style command");
 
   cut_global = force->numeric(arg[0]);
 
@@ -265,7 +262,7 @@ void PairColloid::settings(int narg, char **arg)
 
 void PairColloid::coeff(int narg, char **arg)
 {
-  if (narg < 6 || narg > 7) error->all("Incorrect args for pair coefficients");
+  if (narg < 6 || narg > 7) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -281,7 +278,7 @@ void PairColloid::coeff(int narg, char **arg)
   if (narg == 7) cut_one = force->numeric(arg[6]);
 
   if (d1_one < 0.0 || d2_one < 0.0) 
-    error->all("Invalid d1 or d2 value for pair colloid coeff");
+    error->all(FLERR,"Invalid d1 or d2 value for pair colloid coeff");
 
   int count = 0;
   for (int i = ilo; i <= ihi; i++) {
@@ -289,7 +286,7 @@ void PairColloid::coeff(int narg, char **arg)
       a12[i][j] = a12_one;
       sigma[i][j] = sigma_one;
       if (i == j && d1_one != d2_one)
-	error->all("Invalid d1 or d2 value for pair colloid coeff");
+	error->all(FLERR,"Invalid d1 or d2 value for pair colloid coeff");
       d1[i][j] = d1_one;
       d2[i][j] = d2_one;
       diameter[i][j] = 0.5*(d1_one+d2_one);
@@ -299,7 +296,7 @@ void PairColloid::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/COLLOID/pair_lubricate.cpp b/src/COLLOID/pair_lubricate.cpp
index 4975c4f7e236dba93223f45dc0ad1211ae4b6d6c..5eb072b93e2a6b8198b927b3f56142ee325a50f3 100644
--- a/src/COLLOID/pair_lubricate.cpp
+++ b/src/COLLOID/pair_lubricate.cpp
@@ -34,9 +34,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairLubricate::PairLubricate(LAMMPS *lmp) : Pair(lmp)
@@ -305,7 +302,7 @@ void PairLubricate::allocate()
 
 void PairLubricate::settings(int narg, char **arg)
 {
-  if (narg != 9) error->all("Illegal pair_style command");
+  if (narg != 9) error->all(FLERR,"Illegal pair_style command");
 
   mu = force->numeric(arg[0]);
   flag1 = force->inumeric(arg[1]);
@@ -319,7 +316,7 @@ void PairLubricate::settings(int narg, char **arg)
 
   // initialize Marsaglia RNG with processor-unique seed
 
-  if (seed <= 0) error->all("Illegal pair_style command");
+  if (seed <= 0) error->all(FLERR,"Illegal pair_style command");
   delete random;
   random = new RanMars(lmp,seed + comm->me);
 
@@ -343,7 +340,7 @@ void PairLubricate::settings(int narg, char **arg)
 void PairLubricate::coeff(int narg, char **arg)
 {
   if (narg != 2 && narg != 4)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   if (!allocated) allocate();
 
@@ -368,7 +365,7 @@ void PairLubricate::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -378,9 +375,9 @@ void PairLubricate::coeff(int narg, char **arg)
 void PairLubricate::init_style()
 {
   if (!atom->sphere_flag)
-    error->all("Pair lubricate requires atom style sphere");
+    error->all(FLERR,"Pair lubricate requires atom style sphere");
   if (comm->ghost_velocity == 0)
-    error->all("Pair lubricate requires ghost atoms store velocity");
+    error->all(FLERR,"Pair lubricate requires ghost atoms store velocity");
 
   neighbor->request(this);
 
@@ -390,9 +387,9 @@ void PairLubricate::init_style()
   double rad,radtype;
   for (int i = 1; i <= atom->ntypes; i++) {
     if (!atom->radius_consistency(i,radtype))
-      error->all("Pair lubricate requires monodisperse particles");
+      error->all(FLERR,"Pair lubricate requires monodisperse particles");
     if (i > 1 && radtype != rad)
-      error->all("Pair lubricate requires monodisperse particles");
+      error->all(FLERR,"Pair lubricate requires monodisperse particles");
     rad = radtype;
   }
 }
diff --git a/src/COLLOID/pair_yukawa_colloid.cpp b/src/COLLOID/pair_yukawa_colloid.cpp
index 10ef116386fd6852a30da629d63d9757d47e16f0..ca68a56c9c9621bdc1f01b5a25e320fdc52babb5 100644
--- a/src/COLLOID/pair_yukawa_colloid.cpp
+++ b/src/COLLOID/pair_yukawa_colloid.cpp
@@ -122,7 +122,7 @@ void PairYukawaColloid::compute(int eflag, int vflag)
 void PairYukawaColloid::init_style()
 {
   if (!atom->sphere_flag)
-    error->all("Pair yukawa/colloid requires atom style sphere");
+    error->all(FLERR,"Pair yukawa/colloid requires atom style sphere");
   
   neighbor->request(this);
 
@@ -130,7 +130,7 @@ void PairYukawaColloid::init_style()
 
   for (int i = 1; i <= atom->ntypes; i++)
     if (!atom->radius_consistency(i,rad[i]))
-      error->all("Pair yukawa/colloid requires atoms with same type "
+      error->all(FLERR,"Pair yukawa/colloid requires atoms with same type "
 		 "have same radius");
 }
 
diff --git a/src/DIPOLE/atom_vec_dipole.cpp b/src/DIPOLE/atom_vec_dipole.cpp
index cde9b0c806653174a1f4b68d2d3e2b0185074197..64ec41d5896e1f485dc736fd5bcd8c7fbef855b3 100644
--- a/src/DIPOLE/atom_vec_dipole.cpp
+++ b/src/DIPOLE/atom_vec_dipole.cpp
@@ -60,7 +60,7 @@ void AtomVecDipole::grow(int n)
   else nmax = n;
   atom->nmax = nmax;
   if (nmax < 0 || nmax > MAXSMALLINT)
-    error->one("Per-processor system is too big");
+    error->one(FLERR,"Per-processor system is too big");
 
   tag = memory->grow(atom->tag,nmax,"atom:tag");
   type = memory->grow(atom->type,nmax,"atom:type");
@@ -762,11 +762,11 @@ void AtomVecDipole::data_atom(double *coord, int imagetmp, char **values)
 
   tag[nlocal] = atoi(values[0]);
   if (tag[nlocal] <= 0)
-    error->one("Invalid atom ID in Atoms section of data file");
+    error->one(FLERR,"Invalid atom ID in Atoms section of data file");
 
   type[nlocal] = atoi(values[1]);
   if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
-    error->one("Invalid atom type in Atoms section of data file");
+    error->one(FLERR,"Invalid atom type in Atoms section of data file");
 
   q[nlocal] = atof(values[2]);
 
diff --git a/src/DIPOLE/pair_dipole_cut.cpp b/src/DIPOLE/pair_dipole_cut.cpp
index 3f9e79332ef091a8bdb70f10ca98116e65bacb18..f443854b9032923bc863ad66b836ad84398599c3 100644
--- a/src/DIPOLE/pair_dipole_cut.cpp
+++ b/src/DIPOLE/pair_dipole_cut.cpp
@@ -24,9 +24,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairDipoleCut::PairDipoleCut(LAMMPS *lmp) : Pair(lmp)
@@ -294,7 +291,7 @@ void PairDipoleCut::allocate()
 void PairDipoleCut::settings(int narg, char **arg)
 {
   if (narg < 1 || narg > 2)
-    error->all("Incorrect args in pair_style command");
+    error->all(FLERR,"Incorrect args in pair_style command");
 
   cut_lj_global = force->numeric(arg[0]);
   if (narg == 1) cut_coul_global = cut_lj_global;
@@ -320,7 +317,7 @@ void PairDipoleCut::settings(int narg, char **arg)
 void PairDipoleCut::coeff(int narg, char **arg)
 {
   if (narg < 4 || narg > 6) 
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -347,7 +344,7 @@ void PairDipoleCut::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -357,7 +354,7 @@ void PairDipoleCut::coeff(int narg, char **arg)
 void PairDipoleCut::init_style()
 {
   if (!atom->q_flag || !atom->mu_flag || !atom->torque_flag)
-    error->all("Pair dipole/cut requires atom attributes q, mu, torque");
+    error->all(FLERR,"Pair dipole/cut requires atom attributes q, mu, torque");
 
   neighbor->request(this);
 }
diff --git a/src/GPU/fix_gpu.cpp b/src/GPU/fix_gpu.cpp
index cdcaaa84585ae0fce6dbc774ac3cb819943e7a67..a44498670117faaba9d3112f68d2c526b6a982ef 100644
--- a/src/GPU/fix_gpu.cpp
+++ b/src/GPU/fix_gpu.cpp
@@ -43,10 +43,10 @@ extern double lmp_gpu_forces(double **f, double **tor, double *eatom,
 FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (lmp->cuda) error->all("Cannot use fix GPU with USER-CUDA mode enabled");
+  if (lmp->cuda) error->all(FLERR,"Cannot use fix GPU with USER-CUDA mode enabled");
 
-  if (narg < 7) error->all("Illegal fix GPU command");
-  if (strcmp(arg[1],"all") != 0) error->all("Illegal fix GPU command");
+  if (narg < 7) error->all(FLERR,"Illegal fix GPU command");
+  if (strcmp(arg[1],"all") != 0) error->all(FLERR,"Illegal fix GPU command");
 
   int first_gpu, last_gpu;
 
@@ -55,16 +55,16 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) :
   else if (strcmp(arg[3],"force/neigh") == 0) {
     _gpu_mode = GPU_NEIGH;
     if (domain->triclinic)
-      error->all("Cannot use force/neigh with triclinic box");
+      error->all(FLERR,"Cannot use force/neigh with triclinic box");
   } else
-    error->all("Illegal fix GPU command");
+    error->all(FLERR,"Illegal fix GPU command");
 
   first_gpu = atoi(arg[4]);
   last_gpu = atoi(arg[5]);
 
   _particle_split = force->numeric(arg[6]);
   if (_particle_split==0 || _particle_split>1)
-    error->all("Illegal fix GPU command");
+    error->all(FLERR,"Illegal fix GPU command");
     
   int nthreads = 1;
   int threads_per_atom = -1;
@@ -74,16 +74,16 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) :
     else if (strcmp(arg[7],"nthreads") == 0)
       nthreads = atoi(arg[8]);
     else
-      error->all("Illegal fix GPU command");
+      error->all(FLERR,"Illegal fix GPU command");
   } else if (narg != 7)
-    error->all("Illegal fix GPU command");
+    error->all(FLERR,"Illegal fix GPU command");
 
   if (nthreads < 1)
-    error->all("Illegal fix GPU command");
+    error->all(FLERR,"Illegal fix GPU command");
     
   #ifndef _OPENMP
   if (nthreads > 1)
-    error->all("No OpenMP support compiled in");
+    error->all(FLERR,"No OpenMP support compiled in");
   #endif
 
   int gpu_flag = lmp_init_device(universe->uworld, world, first_gpu, last_gpu,
@@ -115,16 +115,16 @@ void FixGPU::init()
 {
   // Can only have 1 gpu fix that must be the first fix for a run
   if ((void*)modify->fix[0] != (void*)this)
-    error->all("GPU is not the first fix for this run");
+    error->all(FLERR,"GPU is not the first fix for this run");
   // Hybrid cannot be used with force/neigh option
   if (_gpu_mode == GPU_NEIGH)
     if (force->pair_match("hybrid",1) != NULL ||
 	force->pair_match("hybrid/overlay",1) != NULL)
-      error->all("Cannot use pair hybrid with GPU neighbor builds");
+      error->all(FLERR,"Cannot use pair hybrid with GPU neighbor builds");
   if (_particle_split < 0)
     if (force->pair_match("hybrid",1) != NULL ||
 	force->pair_match("hybrid/overlay",1) != NULL)
-      error->all("Fix GPU split must be positive for hybrid pair styles");
+      error->all(FLERR,"Fix GPU split must be positive for hybrid pair styles");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/GPU/gpu_extra.h b/src/GPU/gpu_extra.h
index 9fa2d83a128ef25562628b4e5d0655b46f3ab096..d9bbb7eaa6873551bc018f3e15fa5abf1b7a29a6 100644
--- a/src/GPU/gpu_extra.h
+++ b/src/GPU/gpu_extra.h
@@ -28,17 +28,19 @@ namespace GPU_EXTRA {
     MPI_Allreduce(&error_flag, &all_success, 1, MPI_INT, MPI_MIN, world);
     if (all_success != 0) {
       if (all_success == -1)
-	error->all("Accelerated style in input script but no fix gpu"); 
+	error->all(FLERR,"Accelerated style in input script but no fix gpu"); 
       else if (all_success == -2)
-	error->all("Could not find/initialize a specified accelerator device");
+	error->all(FLERR,
+		   "Could not find/initialize a specified accelerator device");
       else if (all_success == -3)
-	error->all("Insufficient memory on accelerator");
+	error->all(FLERR,"Insufficient memory on accelerator");
       else if (all_success == -4)
-	error->all("GPU library not compiled for this accelerator");
+	error->all(FLERR,"GPU library not compiled for this accelerator");
       else if (all_success == -5)
-	error->all("Double precision is not supported on this accelerator");
+	error->all(FLERR,
+		   "Double precision is not supported on this accelerator");
       else
-	error->all("Unknown error in GPU library");
+	error->all(FLERR,"Unknown error in GPU library");
     }
   }
 
diff --git a/src/GPU/pair_cg_cmm_coul_long_gpu.cpp b/src/GPU/pair_cg_cmm_coul_long_gpu.cpp
index d19b2d65129db38a67820b9f5460c9ec13304447..27aedd4192bf148d90fb73ae22d4bfde3f1fd11d 100644
--- a/src/GPU/pair_cg_cmm_coul_long_gpu.cpp
+++ b/src/GPU/pair_cg_cmm_coul_long_gpu.cpp
@@ -37,9 +37,6 @@
 #include "kspace.h"
 #include "gpu_extra.h"
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define EWALD_F   1.12837917
 #define EWALD_P   0.3275911
 #define A1        0.254829592
@@ -126,7 +123,7 @@ void PairCGCMMCoulLongGPU::compute(int eflag, int vflag)
 		     atom->nlocal, domain->boxlo, domain->prd);
   }
   if (!success)
-    error->one("Out of memory on GPGPU");
+    error->one(FLERR,"Out of memory on GPGPU");
 
   if (host_start<inum) {
     cpu_time = MPI_Wtime();
@@ -144,9 +141,9 @@ void PairCGCMMCoulLongGPU::init_style()
   cut_respa = NULL;
 
   if (!atom->q_flag)
-    error->all("Pair style cg/cmm/coul/long/gpu requires atom attribute q");
+    error->all(FLERR,"Pair style cg/cmm/coul/long/gpu requires atom attribute q");
   if (force->newton_pair) 
-    error->all("Cannot use newton pair with cg/cmm/coul/long/gpu pair style");
+    error->all(FLERR,"Cannot use newton pair with cg/cmm/coul/long/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
   double maxcut = -1.0;
@@ -168,7 +165,7 @@ void PairCGCMMCoulLongGPU::init_style()
   // insure use of KSpace long-range solver, set g_ewald
 
   if (force->kspace == NULL)
-    error->all("Pair style is incompatible with KSpace style");
+    error->all(FLERR,"Pair style is incompatible with KSpace style");
   g_ewald = force->kspace->g_ewald;
 
   // setup force tables
diff --git a/src/GPU/pair_cg_cmm_coul_msm.cpp b/src/GPU/pair_cg_cmm_coul_msm.cpp
index d1e9b227752ae4e0031219915d5b0dd0f1810bde..5321945eb28a3f717855ddebf873d02f0c3908f0 100644
--- a/src/GPU/pair_cg_cmm_coul_msm.cpp
+++ b/src/GPU/pair_cg_cmm_coul_msm.cpp
@@ -16,19 +16,17 @@
    Contributing author: Mike Brown <brownw@ornl.gov>
 ------------------------------------------------------------------------- */
 
+#include "string.h"
 #include "pair_cg_cmm_coul_msm.h"
 #include "memory.h"
 #include "atom.h"
 #include "force.h"
 #include "kspace.h"
 
-#include "string.h"
+using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
 enum {C3=0,C4=1};
 
-using namespace LAMMPS_NS;
-
 /* ---------------------------------------------------------------------- */
 
 PairCGCMMCoulMSM::PairCGCMMCoulMSM(LAMMPS *lmp) : PairCMMCommon(lmp)
@@ -73,13 +71,13 @@ void PairCGCMMCoulMSM::settings(int narg, char **arg)
 {
   // strip off smoothing type and send args to parent
 
-  if (narg < 1) error->all("Illegal pair_style command");
+  if (narg < 1) error->all(FLERR,"Illegal pair_style command");
 
   if (strcmp(arg[0],"C3") == 0)
     _smooth = C3;
   else if (strcmp(arg[0],"C4") == 0)
     _smooth = C4;
-  else error->all("Illegal pair_style command");
+  else error->all(FLERR,"Illegal pair_style command");
 
   PairCMMCommon::settings(narg-1,&arg[1]);
 }
@@ -89,7 +87,7 @@ void PairCGCMMCoulMSM::settings(int narg, char **arg)
 void PairCGCMMCoulMSM::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style cg/cut/coul/msm requires atom attribute q");
+    error->all(FLERR,"Pair style cg/cut/coul/msm requires atom attribute q");
   
   PairCMMCommon::init_style();
   _ia=-1.0/cut_coul_global;
diff --git a/src/GPU/pair_cg_cmm_coul_msm_gpu.cpp b/src/GPU/pair_cg_cmm_coul_msm_gpu.cpp
index d946b739d5ea07a68fe06fa23d5003848519bb49..0d079304f18f550bec665f69d6f2b1d131a5d2c4 100644
--- a/src/GPU/pair_cg_cmm_coul_msm_gpu.cpp
+++ b/src/GPU/pair_cg_cmm_coul_msm_gpu.cpp
@@ -36,10 +36,6 @@
 #include "kspace.h"
 #include "gpu_extra.h"
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-enum {C3=0,C4=1};
-
 // External functions from cuda library for atom decomposition
 
 int cmmm_gpu_init(const int ntypes, double **cutsq, int **cg_type,
@@ -69,6 +65,8 @@ double cmmm_gpu_bytes();
 
 using namespace LAMMPS_NS;
 
+enum {C3=0,C4=1};
+
 /* ---------------------------------------------------------------------- */
 
 PairCGCMMCoulMSMGPU::PairCGCMMCoulMSMGPU(LAMMPS *lmp) : PairCGCMMCoulMSM(lmp),
@@ -119,7 +117,7 @@ void PairCGCMMCoulMSMGPU::compute(int eflag, int vflag)
 		     atom->nlocal, domain->boxlo, domain->prd);
   }
   if (!success)
-    error->one("Out of memory on GPGPU");
+    error->one(FLERR,"Out of memory on GPGPU");
 
   if (host_start<inum) {
     cpu_time = MPI_Wtime();
@@ -136,7 +134,7 @@ void PairCGCMMCoulMSMGPU::init_style()
 {
   PairCGCMMCoulMSM::init_style();
   if (force->newton_pair) 
-    error->all("Cannot use newton pair with cg/cmm/coul/msm/gpu pair style");
+    error->all(FLERR,"Cannot use newton pair with cg/cmm/coul/msm/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
   double maxcut = -1.0;
diff --git a/src/GPU/pair_cg_cmm_gpu.cpp b/src/GPU/pair_cg_cmm_gpu.cpp
index 4ccea3242141aafddaf1c3b4d96fa038b28d0dc9..b7f7ccd3303bbb8d8e2d19015e4b48f339525531 100644
--- a/src/GPU/pair_cg_cmm_gpu.cpp
+++ b/src/GPU/pair_cg_cmm_gpu.cpp
@@ -36,9 +36,6 @@
 #include "string.h"
 #include "gpu_extra.h"
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 // External functions from cuda library for atom decomposition
 
 int cmm_gpu_init(const int ntypes, double **cutsq, int **cg_types, 
@@ -111,7 +108,7 @@ void PairCGCMMGPU::compute(int eflag, int vflag)
 		    vflag_atom, host_start, cpu_time, success);
   }
   if (!success)
-    error->one("Out of memory on GPGPU");
+    error->one(FLERR,"Out of memory on GPGPU");
 
   if (host_start<inum) {
     cpu_time = MPI_Wtime();
@@ -129,7 +126,7 @@ void PairCGCMMGPU::init_style()
   cut_respa = NULL;
 
   if (force->newton_pair) 
-    error->all("Cannot use newton pair with GPU CGCMM pair style");
+    error->all(FLERR,"Cannot use newton pair with GPU CGCMM pair style");
 
   // Repeat cutsq calculation because done after call to init_style
   double maxcut = -1.0;
diff --git a/src/GPU/pair_coul_long_gpu.cpp b/src/GPU/pair_coul_long_gpu.cpp
index 468821dcecf6f552cc10516b7ec000af10b07c37..8502e8ae5307c0eeaed8f7039c83924278f1bf31 100644
--- a/src/GPU/pair_coul_long_gpu.cpp
+++ b/src/GPU/pair_coul_long_gpu.cpp
@@ -37,9 +37,6 @@
 #include "kspace.h"
 #include "gpu_extra.h"
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define EWALD_F   1.12837917
 #define EWALD_P   0.3275911
 #define A1        0.254829592
@@ -123,7 +120,7 @@ void PairCoulLongGPU::compute(int eflag, int vflag)
 		   atom->nlocal, domain->boxlo, domain->prd);
   }
   if (!success)
-    error->one("Out of memory on GPGPU");
+    error->one(FLERR,"Out of memory on GPGPU");
 
   if (host_start<inum) {
     cpu_time = MPI_Wtime();
@@ -141,9 +138,9 @@ void PairCoulLongGPU::init_style()
   cut_respa = NULL;
 
   if (!atom->q_flag)
-    error->all("Pair style coul/long/gpu requires atom attribute q");
+    error->all(FLERR,"Pair style coul/long/gpu requires atom attribute q");
   if (force->newton_pair) 
-    error->all("Cannot use newton pair with coul/long/gpu pair style");
+    error->all(FLERR,"Cannot use newton pair with coul/long/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
   double cell_size = sqrt(cut_coul) + neighbor->skin;
@@ -153,7 +150,7 @@ void PairCoulLongGPU::init_style()
   // insure use of KSpace long-range solver, set g_ewald
 
   if (force->kspace == NULL)
-    error->all("Pair style is incompatible with KSpace style");
+    error->all(FLERR,"Pair style is incompatible with KSpace style");
   g_ewald = force->kspace->g_ewald;
 
   // setup force tables
diff --git a/src/GPU/pair_gayberne_gpu.cpp b/src/GPU/pair_gayberne_gpu.cpp
index c137f0f67c5ea640527735b2dd9f49bf8e1748f6..eb9fd0094c87b0d5e64fb6291ef3756416fca5a3 100644
--- a/src/GPU/pair_gayberne_gpu.cpp
+++ b/src/GPU/pair_gayberne_gpu.cpp
@@ -38,9 +38,6 @@
 #include "string.h"
 #include "gpu_extra.h"
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 // External functions from cuda library for atom decomposition
 
 int gb_gpu_init(const int ntypes, const double gamma, const double upsilon,
@@ -77,7 +74,7 @@ PairGayBerneGPU::PairGayBerneGPU(LAMMPS *lmp) : PairGayBerne(lmp),
 {
   avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
   if (!avec) 
-    error->all("Pair gayberne requires atom style ellipsoid");
+    error->all(FLERR,"Pair gayberne requires atom style ellipsoid");
   quat_nmax = 0;
   quat = NULL;
 }
@@ -140,7 +137,7 @@ void PairGayBerneGPU::compute(int eflag, int vflag)
 			   cpu_time, success, quat);
   }
   if (!success)
-    error->one("Out of memory on GPGPU");
+    error->one(FLERR,"Out of memory on GPGPU");
 
   if (host_start < inum) {
     cpu_time = MPI_Wtime();
@@ -156,9 +153,9 @@ void PairGayBerneGPU::compute(int eflag, int vflag)
 void PairGayBerneGPU::init_style()
 {
   if (force->newton_pair) 
-    error->all("Cannot use newton pair with gayberne/gpu pair style");
+    error->all(FLERR,"Cannot use newton pair with gayberne/gpu pair style");
   if (!atom->ellipsoid_flag)
-    error->all("Pair gayberne/gpu requires atom style ellipsoid");
+    error->all(FLERR,"Pair gayberne/gpu requires atom style ellipsoid");
 
   // per-type shape precalculations
   // require that atom shapes are identical within each type
@@ -166,7 +163,7 @@ void PairGayBerneGPU::init_style()
 
   for (int i = 1; i <= atom->ntypes; i++) {
     if (!atom->shape_consistency(i,shape1[i][0],shape1[i][1],shape1[i][2]))
-      error->all("Pair gayberne/gpu requires atoms with same type have same shape");
+      error->all(FLERR,"Pair gayberne/gpu requires atoms with same type have same shape");
     if (shape1[i][0] == 0.0)
       shape1[i][0] = shape1[i][1] = shape1[i][2] = 1.0;
     shape2[i][0] = shape1[i][0]*shape1[i][0];
diff --git a/src/GPU/pair_lj96_cut_gpu.cpp b/src/GPU/pair_lj96_cut_gpu.cpp
index ce51b12a7bb582cf05d237a205b9209346fc98ab..f09e4636f947c4dff3503456ca01b511ef7ea61d 100644
--- a/src/GPU/pair_lj96_cut_gpu.cpp
+++ b/src/GPU/pair_lj96_cut_gpu.cpp
@@ -36,9 +36,6 @@
 #include "string.h"
 #include "gpu_extra.h"
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 // External functions from cuda library for atom decomposition
 
 int lj96_gpu_init(const int ntypes, double **cutsq, double **host_lj1,
@@ -110,7 +107,7 @@ void PairLJ96CutGPU::compute(int eflag, int vflag)
 		     vflag_atom, host_start, cpu_time, success);
   }
   if (!success)
-    error->one("Out of memory on GPGPU");
+    error->one(FLERR,"Out of memory on GPGPU");
 
   if (host_start<inum) {
     cpu_time = MPI_Wtime();
@@ -128,7 +125,7 @@ void PairLJ96CutGPU::init_style()
   cut_respa = NULL;
 
   if (force->newton_pair) 
-    error->all("Cannot use newton pair with lj96/cut/gpu pair style");
+    error->all(FLERR,"Cannot use newton pair with lj96/cut/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
   double maxcut = -1.0;
diff --git a/src/GPU/pair_lj_charmm_coul_long_gpu.cpp b/src/GPU/pair_lj_charmm_coul_long_gpu.cpp
index fa48db0d9ae426f2ce4edd0cb8789e47634ba6df..a1a30bfb173a68ffa099ec64b2c8d6979a22d2aa 100644
--- a/src/GPU/pair_lj_charmm_coul_long_gpu.cpp
+++ b/src/GPU/pair_lj_charmm_coul_long_gpu.cpp
@@ -37,9 +37,6 @@
 #include "kspace.h"
 #include "gpu_extra.h"
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define EWALD_F   1.12837917
 #define EWALD_P   0.3275911
 #define A1        0.254829592
@@ -129,7 +126,7 @@ void PairLJCharmmCoulLongGPU::compute(int eflag, int vflag)
 		     atom->nlocal, domain->boxlo, domain->prd);
   }
   if (!success)
-    error->one("Out of memory on GPGPU");
+    error->one(FLERR,"Out of memory on GPGPU");
 
   if (host_start<inum) {
     cpu_time = MPI_Wtime();
@@ -147,9 +144,9 @@ void PairLJCharmmCoulLongGPU::init_style()
   cut_respa = NULL;
 
   if (!atom->q_flag)
-    error->all("Pair style lj/charmm/coul/long/gpu requires atom attribute q");
+    error->all(FLERR,"Pair style lj/charmm/coul/long/gpu requires atom attribute q");
   if (force->newton_pair) 
-    error->all("Cannot use newton pair with lj/charmm/coul/long/gpu pair style");
+    error->all(FLERR,"Cannot use newton pair with lj/charmm/coul/long/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
   double cut;
@@ -173,7 +170,7 @@ void PairLJCharmmCoulLongGPU::init_style()
   // insure use of KSpace long-range solver, set g_ewald
 
   if (force->kspace == NULL)
-    error->all("Pair style is incompatible with KSpace style");
+    error->all(FLERR,"Pair style is incompatible with KSpace style");
   g_ewald = force->kspace->g_ewald;
 
   // setup force tables
diff --git a/src/GPU/pair_lj_class2_coul_long_gpu.cpp b/src/GPU/pair_lj_class2_coul_long_gpu.cpp
index 2c7ea415311f964fcb84d785c043051705d0bce8..568cec2bf8acab479a526fee322de3ffba1f6e47 100644
--- a/src/GPU/pair_lj_class2_coul_long_gpu.cpp
+++ b/src/GPU/pair_lj_class2_coul_long_gpu.cpp
@@ -37,9 +37,6 @@
 #include "kspace.h"
 #include "gpu_extra.h"
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define EWALD_F   1.12837917
 #define EWALD_P   0.3275911
 #define A1        0.254829592
@@ -126,7 +123,7 @@ void PairLJClass2CoulLongGPU::compute(int eflag, int vflag)
 		     atom->nlocal, domain->boxlo, domain->prd);
   }
   if (!success)
-    error->one("Out of memory on GPGPU");
+    error->one(FLERR,"Out of memory on GPGPU");
 
   if (host_start<inum) {
     cpu_time = MPI_Wtime();
@@ -142,9 +139,9 @@ void PairLJClass2CoulLongGPU::compute(int eflag, int vflag)
 void PairLJClass2CoulLongGPU::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style lj/class2/coul/long/gpu requires atom attribute q");
+    error->all(FLERR,"Pair style lj/class2/coul/long/gpu requires atom attribute q");
   if (force->newton_pair) 
-    error->all("Cannot use newton pair with lj/class2/coul/long/gpu pair style");
+    error->all(FLERR,"Cannot use newton pair with lj/class2/coul/long/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
   double maxcut = -1.0;
@@ -168,7 +165,7 @@ void PairLJClass2CoulLongGPU::init_style()
   // insure use of KSpace long-range solver, set g_ewald
 
   if (force->kspace == NULL)
-    error->all("Pair style is incompatible with KSpace style");
+    error->all(FLERR,"Pair style is incompatible with KSpace style");
   g_ewald = force->kspace->g_ewald;
 
   int maxspecial=0;
diff --git a/src/GPU/pair_lj_class2_gpu.cpp b/src/GPU/pair_lj_class2_gpu.cpp
index c45fb5bfdbc9e1636bdc4e9d9e77b2a11776d72c..349c043cde55f54e72dcde1883d06efbf2c4ed04 100644
--- a/src/GPU/pair_lj_class2_gpu.cpp
+++ b/src/GPU/pair_lj_class2_gpu.cpp
@@ -36,9 +36,6 @@
 #include "string.h"
 #include "gpu_extra.h"
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 // External functions from cuda library for atom decomposition
 
 int lj96_gpu_init(const int ntypes, double **cutsq, double **host_lj1,
@@ -109,7 +106,7 @@ void PairLJClass2GPU::compute(int eflag, int vflag)
 		     vflag_atom, host_start, cpu_time, success);
   }
   if (!success)
-    error->one("Out of memory on GPGPU");
+    error->one(FLERR,"Out of memory on GPGPU");
 
   if (host_start<inum) {
     cpu_time = MPI_Wtime();
@@ -125,7 +122,7 @@ void PairLJClass2GPU::compute(int eflag, int vflag)
 void PairLJClass2GPU::init_style()
 {
   if (force->newton_pair) 
-    error->all("Cannot use newton pair with lj/class2/gpu pair style");
+    error->all(FLERR,"Cannot use newton pair with lj/class2/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
   double maxcut = -1.0;
diff --git a/src/GPU/pair_lj_cut_coul_cut_gpu.cpp b/src/GPU/pair_lj_cut_coul_cut_gpu.cpp
index cd19e81ca26304b07ac2b50e092a1a0f64fccf80..66dbbed46cb52fcfce51fc51c0c4961982cca6ac 100644
--- a/src/GPU/pair_lj_cut_coul_cut_gpu.cpp
+++ b/src/GPU/pair_lj_cut_coul_cut_gpu.cpp
@@ -36,9 +36,6 @@
 #include "string.h"
 #include "gpu_extra.h"
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 // External functions from cuda library for atom decomposition
 
 int ljc_gpu_init(const int ntypes, double **cutsq, double **host_lj1,
@@ -117,7 +114,7 @@ void PairLJCutCoulCutGPU::compute(int eflag, int vflag)
 		    atom->nlocal, domain->boxlo, domain->prd);
   }
   if (!success)
-    error->one("Out of memory on GPGPU");
+    error->one(FLERR,"Out of memory on GPGPU");
 
   if (host_start<inum) {
     cpu_time = MPI_Wtime();
@@ -133,10 +130,10 @@ void PairLJCutCoulCutGPU::compute(int eflag, int vflag)
 void PairLJCutCoulCutGPU::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style lj/cut/coul/cut/gpu requires atom attribute q");
+    error->all(FLERR,"Pair style lj/cut/coul/cut/gpu requires atom attribute q");
 
   if (force->newton_pair) 
-    error->all("Cannot use newton pair with lj/cut/coul/cut/gpu pair style");
+    error->all(FLERR,"Cannot use newton pair with lj/cut/coul/cut/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
   double maxcut = -1.0;
diff --git a/src/GPU/pair_lj_cut_coul_long_gpu.cpp b/src/GPU/pair_lj_cut_coul_long_gpu.cpp
index 2b3a915f0ee11c5914e5f65bb56244d34a9ad2f5..80c792627205733d8cc838a3bda0698d13b9c5f3 100644
--- a/src/GPU/pair_lj_cut_coul_long_gpu.cpp
+++ b/src/GPU/pair_lj_cut_coul_long_gpu.cpp
@@ -37,9 +37,6 @@
 #include "kspace.h"
 #include "gpu_extra.h"
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define EWALD_F   1.12837917
 #define EWALD_P   0.3275911
 #define A1        0.254829592
@@ -127,7 +124,7 @@ void PairLJCutCoulLongGPU::compute(int eflag, int vflag)
 		     atom->nlocal, domain->boxlo, domain->prd);
   }
   if (!success)
-    error->one("Out of memory on GPGPU");
+    error->one(FLERR,"Out of memory on GPGPU");
 
   if (host_start<inum) {
     cpu_time = MPI_Wtime();
@@ -145,9 +142,9 @@ void PairLJCutCoulLongGPU::init_style()
   cut_respa = NULL;
 
   if (!atom->q_flag)
-    error->all("Pair style lj/cut/coul/long/gpu requires atom attribute q");
+    error->all(FLERR,"Pair style lj/cut/coul/long/gpu requires atom attribute q");
   if (force->newton_pair) 
-    error->all("Cannot use newton pair with lj/cut/could/cut/gpu pair style");
+    error->all(FLERR,"Cannot use newton pair with lj/cut/could/cut/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
   double maxcut = -1.0;
@@ -171,7 +168,7 @@ void PairLJCutCoulLongGPU::init_style()
   // insure use of KSpace long-range solver, set g_ewald
 
   if (force->kspace == NULL)
-    error->all("Pair style is incompatible with KSpace style");
+    error->all(FLERR,"Pair style is incompatible with KSpace style");
   g_ewald = force->kspace->g_ewald;
 
   // setup force tables
diff --git a/src/GPU/pair_lj_cut_gpu.cpp b/src/GPU/pair_lj_cut_gpu.cpp
index 63a908d3e79636bdaf4595b81f320ff0cee8687f..198328274ec9b80d11448cf6f15a001874dede31 100644
--- a/src/GPU/pair_lj_cut_gpu.cpp
+++ b/src/GPU/pair_lj_cut_gpu.cpp
@@ -36,9 +36,6 @@
 #include "string.h"
 #include "gpu_extra.h"
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 // External functions from cuda library for atom decomposition
 
 int ljl_gpu_init(const int ntypes, double **cutsq, double **host_lj1,
@@ -110,7 +107,7 @@ void PairLJCutGPU::compute(int eflag, int vflag)
 		    vflag_atom, host_start, cpu_time, success);
   }
   if (!success)
-    error->one("Out of memory on GPGPU");
+    error->one(FLERR,"Out of memory on GPGPU");
 
   if (host_start<inum) {
     cpu_time = MPI_Wtime();
@@ -128,7 +125,7 @@ void PairLJCutGPU::init_style()
   cut_respa = NULL;
 
   if (force->newton_pair) 
-    error->all("Cannot use newton pair with lj/cut/gpu pair style");
+    error->all(FLERR,"Cannot use newton pair with lj/cut/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
   double maxcut = -1.0;
diff --git a/src/GPU/pair_lj_cut_tgpu.cpp b/src/GPU/pair_lj_cut_tgpu.cpp
index 043cf0e5bb2e5cc15da6daeb39524fb6ced3a8bd..7b9aa9af0b0b8a027347a79942a1aa61d7a9b860 100644
--- a/src/GPU/pair_lj_cut_tgpu.cpp
+++ b/src/GPU/pair_lj_cut_tgpu.cpp
@@ -35,9 +35,6 @@
 #include "string.h"
 #include "gpu_extra.h"
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 // External functions from cuda library for atom decomposition
 
 int ljl_gpu_init(const int ntypes, double **cutsq, double **host_lj1,
@@ -115,7 +112,7 @@ void PairLJCutTGPU::compute(int eflag, int vflag)
 		    vflag_atom, host_start, cpu_time, success);
   }
   if (!success)
-    error->one("Out of memory on GPGPU");
+    error->one(FLERR,"Out of memory on GPGPU");
 
   if (host_start<inum) {
     cpu_time = MPI_Wtime();
@@ -140,7 +137,7 @@ void PairLJCutTGPU::init_style()
   cut_respa = NULL;
 
   if (force->newton_pair) 
-    error->all("Cannot use newton pair with lj/cut/tgpu pair style");
+    error->all(FLERR,"Cannot use newton pair with lj/cut/tgpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
   double maxcut = -1.0;
diff --git a/src/GPU/pair_lj_expand_gpu.cpp b/src/GPU/pair_lj_expand_gpu.cpp
index f45429a9db4c03474f761fa9f9dc15795fb0cd98..b610e02bc355f5e94aada3fc069620c942b3ecc8 100644
--- a/src/GPU/pair_lj_expand_gpu.cpp
+++ b/src/GPU/pair_lj_expand_gpu.cpp
@@ -36,9 +36,6 @@
 #include "string.h"
 #include "gpu_extra.h"
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 // External functions from cuda library for atom decomposition
 
 int lje_gpu_init(const int ntypes, double **cutsq, double **host_lj1,
@@ -111,7 +108,7 @@ void PairLJExpandGPU::compute(int eflag, int vflag)
 		    vflag_atom, host_start, cpu_time, success);
   }
   if (!success)
-    error->one("Out of memory on GPGPU");
+    error->one(FLERR,"Out of memory on GPGPU");
 
   if (host_start<inum) {
     cpu_time = MPI_Wtime();
@@ -127,7 +124,7 @@ void PairLJExpandGPU::compute(int eflag, int vflag)
 void PairLJExpandGPU::init_style()
 {
   if (force->newton_pair) 
-    error->all("Cannot use newton pair with lj/expand/gpu pair style");
+    error->all(FLERR,"Cannot use newton pair with lj/expand/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
   double maxcut = -1.0;
diff --git a/src/GPU/pair_morse_gpu.cpp b/src/GPU/pair_morse_gpu.cpp
index ae5fcdfe64cfb716e0f091d1bc0b40d3907488ae..8ede76217b5b409da0e05297cb731b2bde7dccc7 100644
--- a/src/GPU/pair_morse_gpu.cpp
+++ b/src/GPU/pair_morse_gpu.cpp
@@ -36,9 +36,6 @@
 #include "string.h"
 #include "gpu_extra.h"
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 // External functions from cuda library for atom decomposition
 
 int mor_gpu_init(const int ntypes, double **cutsq, double **host_morse1,
@@ -109,7 +106,7 @@ void PairMorseGPU::compute(int eflag, int vflag)
 		    vflag_atom, host_start, cpu_time, success);
   }
   if (!success)
-    error->one("Out of memory on GPGPU");
+    error->one(FLERR,"Out of memory on GPGPU");
 
   if (host_start<inum) {
     cpu_time = MPI_Wtime();
@@ -125,7 +122,7 @@ void PairMorseGPU::compute(int eflag, int vflag)
 void PairMorseGPU::init_style()
 {
   if (force->newton_pair) 
-    error->all("Cannot use newton pair with morse/gpu pair style");
+    error->all(FLERR,"Cannot use newton pair with morse/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
   double maxcut = -1.0;
diff --git a/src/GPU/pair_resquared_gpu.cpp b/src/GPU/pair_resquared_gpu.cpp
index 69b60603940580caff45c859e53d61e782dcd2c5..f50d1feda66d6e4978d4c06c601bc758bedc21c3 100644
--- a/src/GPU/pair_resquared_gpu.cpp
+++ b/src/GPU/pair_resquared_gpu.cpp
@@ -38,9 +38,6 @@
 #include "string.h"
 #include "gpu_extra.h"
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 // External functions from cuda library for atom decomposition
 
 int re_gpu_init(const int ntypes, double **shape, double **well,
@@ -76,7 +73,7 @@ PairRESquaredGPU::PairRESquaredGPU(LAMMPS *lmp) : PairRESquared(lmp),
 {
   avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
   if (!avec) 
-    error->all("Pair gayberne requires atom style ellipsoid");
+    error->all(FLERR,"Pair gayberne requires atom style ellipsoid");
   quat_nmax = 0;
   quat = NULL;
 }
@@ -139,7 +136,7 @@ void PairRESquaredGPU::compute(int eflag, int vflag)
 			   cpu_time, success, quat);
   }
   if (!success)
-    error->one("Out of memory on GPGPU");
+    error->one(FLERR,"Out of memory on GPGPU");
 
   if (host_start < inum) {
     cpu_time = MPI_Wtime();
@@ -155,9 +152,9 @@ void PairRESquaredGPU::compute(int eflag, int vflag)
 void PairRESquaredGPU::init_style()
 {
   if (force->newton_pair) 
-    error->all("Cannot use newton pair with resquared/gpu pair style");
+    error->all(FLERR,"Cannot use newton pair with resquared/gpu pair style");
   if (!atom->ellipsoid_flag)
-    error->all("Pair resquared/gpu requires atom style ellipsoid");
+    error->all(FLERR,"Pair resquared/gpu requires atom style ellipsoid");
 
   // per-type shape precalculations
   // require that atom shapes are identical within each type
@@ -165,7 +162,7 @@ void PairRESquaredGPU::init_style()
 
   for (int i = 1; i <= atom->ntypes; i++) {
     if (!atom->shape_consistency(i,shape1[i][0],shape1[i][1],shape1[i][2]))
-      error->all("Pair resquared/gpu requires atoms with same type have same shape");
+      error->all(FLERR,"Pair resquared/gpu requires atoms with same type have same shape");
     if (setwell[i]) {
       shape2[i][0] = shape1[i][0]*shape1[i][0];
       shape2[i][1] = shape1[i][1]*shape1[i][1];
diff --git a/src/GPU/pppm_gpu.cpp b/src/GPU/pppm_gpu.cpp
index f9a929a30a7aef92c70ffc32e517bba032cc7f2d..044d018c2880e2dd7cfcecdd4dc3d97e5ebd80ba 100644
--- a/src/GPU/pppm_gpu.cpp
+++ b/src/GPU/pppm_gpu.cpp
@@ -52,9 +52,6 @@ using namespace LAMMPS_NS;
 #define ONEF  1.0
 #endif
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 
 // External functions from cuda library for atom decomposition
 #ifdef FFT_SINGLE
@@ -82,7 +79,7 @@ double PPPM_GPU_API(bytes)();
 
 PPPMGPU::PPPMGPU(LAMMPS *lmp, int narg, char **arg) : PPPM(lmp, narg, arg)
 {
-  if (narg != 1) error->all("Illegal kspace_style pppm/gpu command");
+  if (narg != 1) error->all(FLERR,"Illegal kspace_style pppm/gpu command");
 
   density_brick_gpu = vd_brick = NULL;
 }
@@ -106,7 +103,7 @@ void PPPMGPU::init()
   
   // GPU precision specific init.
   if (order>8)
-    error->all("Cannot use order greater than 8 with pppm/gpu.");
+    error->all(FLERR,"Cannot use order greater than 8 with pppm/gpu.");
   PPPM_GPU_API(clear)(poisson_time);
 
   int success;
@@ -140,9 +137,9 @@ void PPPMGPU::compute(int eflag, int vflag)
 			     atom->q, domain->boxlo, delxinv, delyinv,
 			     delzinv);
   if (!success)
-    error->one("Out of memory on GPGPU");
+    error->one(FLERR,"Out of memory on GPGPU");
   if (flag != 0)
-    error->one("Out of range atoms - cannot compute PPPM");
+    error->one(FLERR,"Out of range atoms - cannot compute PPPM");
 
   int i;
 
diff --git a/src/GRANULAR/fix_freeze.cpp b/src/GRANULAR/fix_freeze.cpp
index 997337a67bd90d439f0abed3dfb7ef104f1c00db..848574e5feac69a5ba17321aee11f6ffbaee38cb 100644
--- a/src/GRANULAR/fix_freeze.cpp
+++ b/src/GRANULAR/fix_freeze.cpp
@@ -27,10 +27,10 @@ using namespace LAMMPS_NS;
 FixFreeze::FixFreeze(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Illegal fix freeze command");
+  if (narg != 3) error->all(FLERR,"Illegal fix freeze command");
 
   if (!atom->torque_flag)
-    error->all("Fix freeze requires atom attribute torque");
+    error->all(FLERR,"Fix freeze requires atom attribute torque");
 
   vector_flag = 1;
   size_vector = 3;
@@ -61,7 +61,7 @@ void FixFreeze::init()
   int count = 0;
   for (int i = 0; i < modify->nfix; i++)
     if (strcmp(modify->fix[i]->style,"freeze") == 0) count++;
-  if (count > 1) error->all("More than one fix freeze");
+  if (count > 1) error->all(FLERR,"More than one fix freeze");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/GRANULAR/fix_pour.cpp b/src/GRANULAR/fix_pour.cpp
index 1248c05db071ca82281bda1a107c8f6d7f3b03f2..4dcf9fc3bc762190e1683ba9af835564420090f0 100644
--- a/src/GRANULAR/fix_pour.cpp
+++ b/src/GRANULAR/fix_pour.cpp
@@ -39,12 +39,12 @@ using namespace LAMMPS_NS;
 FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 6) error->all("Illegal fix pour command");
+  if (narg < 6) error->all(FLERR,"Illegal fix pour command");
 
   time_depend = 1;
 
   if (!atom->radius_flag || !atom->rmass_flag)
-    error->all("Fix pour requires atom attributes radius, rmass");
+    error->all(FLERR,"Fix pour requires atom attributes radius, rmass");
 
   // required args
 
@@ -52,7 +52,7 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
   ntype = atoi(arg[4]);
   seed = atoi(arg[5]);
 
-  if (seed <= 0) error->all("Illegal fix pour command");
+  if (seed <= 0) error->all(FLERR,"Illegal fix pour command");
 
   PI = 4.0*atan(1.0);
 
@@ -71,32 +71,32 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
   int iarg = 6;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"region") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix pour command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix pour command");
       iregion = domain->find_region(arg[iarg+1]);
-      if (iregion == -1) error->all("Fix pour region ID does not exist");
+      if (iregion == -1) error->all(FLERR,"Fix pour region ID does not exist");
       iarg += 2;
     } else if (strcmp(arg[iarg],"diam") == 0) {
-      if (iarg+3 > narg) error->all("Illegal fix pour command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal fix pour command");
       radius_lo = 0.5 * atof(arg[iarg+1]);
       radius_hi = 0.5 * atof(arg[iarg+2]);
       iarg += 3;
     } else if (strcmp(arg[iarg],"dens") == 0) {
-      if (iarg+3 > narg) error->all("Illegal fix pour command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal fix pour command");
       density_lo = atof(arg[iarg+1]);
       density_hi = atof(arg[iarg+2]);
       iarg += 3;
     } else if (strcmp(arg[iarg],"vol") == 0) {
-      if (iarg+3 > narg) error->all("Illegal fix pour command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal fix pour command");
       volfrac = atof(arg[iarg+1]);
       maxattempt = atoi(arg[iarg+2]);
       iarg += 3;
     } else if (strcmp(arg[iarg],"rate") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix pour command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix pour command");
       rate = atof(arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"vel") == 0) {
       if (domain->dimension == 3) {
-	if (iarg+6 > narg) error->all("Illegal fix pour command");
+	if (iarg+6 > narg) error->all(FLERR,"Illegal fix pour command");
 	vxlo = atof(arg[iarg+1]);
 	vxhi = atof(arg[iarg+2]);
 	vylo = atof(arg[iarg+3]);
@@ -104,23 +104,23 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
 	vz = atof(arg[iarg+5]);
 	iarg += 6;
       } else {
-	if (iarg+4 > narg) error->all("Illegal fix pour command");
+	if (iarg+4 > narg) error->all(FLERR,"Illegal fix pour command");
 	vxlo = atof(arg[iarg+1]);
 	vxhi = atof(arg[iarg+2]);
 	vy = atof(arg[iarg+3]);
 	vz = 0.0;
 	iarg += 4;
       }
-    } else error->all("Illegal fix pour command");
+    } else error->all(FLERR,"Illegal fix pour command");
   }
 
   // error checks on region and its extent being inside simulation box
 
-  if (iregion == -1) error->all("Must specify a region in fix pour");
+  if (iregion == -1) error->all(FLERR,"Must specify a region in fix pour");
   if (domain->regions[iregion]->bboxflag == 0)
-    error->all("Fix pour region does not support a bounding box");
+    error->all(FLERR,"Fix pour region does not support a bounding box");
   if (domain->regions[iregion]->dynamic_check())
-    error->all("Fix pour region cannot be dynamic");
+    error->all(FLERR,"Fix pour region cannot be dynamic");
 
   if (strcmp(domain->regions[iregion]->style,"block") == 0) {
     region_style = 1;
@@ -133,7 +133,7 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
     if (xlo < domain->boxlo[0] || xhi > domain->boxhi[0] || 
 	ylo < domain->boxlo[1] || yhi > domain->boxhi[1] || 
 	zlo < domain->boxlo[2] || zhi > domain->boxhi[2])
-      error->all("Insertion region extends outside simulation box");
+      error->all(FLERR,"Insertion region extends outside simulation box");
   } else if (strcmp(domain->regions[iregion]->style,"cylinder") == 0) {
     region_style = 2;
     char axis = ((RegCylinder *) domain->regions[iregion])->axis;
@@ -143,15 +143,15 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
     zlo = ((RegCylinder *) domain->regions[iregion])->lo;
     zhi = ((RegCylinder *) domain->regions[iregion])->hi;
     if (axis != 'z')
-      error->all("Must use a z-axis cylinder with fix pour");
+      error->all(FLERR,"Must use a z-axis cylinder with fix pour");
     if (xc-rc < domain->boxlo[0] || xc+rc > domain->boxhi[0] || 
 	yc-rc < domain->boxlo[1] || yc+rc > domain->boxhi[1] || 
 	zlo < domain->boxlo[2] || zhi > domain->boxhi[2])
-      error->all("Insertion region extends outside simulation box");
-  } else error->all("Must use a block or cylinder region with fix pour");
+      error->all(FLERR,"Insertion region extends outside simulation box");
+  } else error->all(FLERR,"Must use a block or cylinder region with fix pour");
 
   if (region_style == 2 && domain->dimension == 2)
-    error->all("Must use a block region with fix pour for 2d simulations");
+    error->all(FLERR,"Must use a block region with fix pour for 2d simulations");
 
   // random number generator, same for all procs
 
@@ -171,7 +171,7 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
   for (ifix = 0; ifix < modify->nfix; ifix++)
     if (strcmp(modify->fix[ifix]->style,"gravity") == 0) break;
   if (ifix == modify->nfix) 
-    error->all("No fix gravity defined for fix pour");
+    error->all(FLERR,"No fix gravity defined for fix pour");
   grav = - ((FixGravity *) modify->fix[ifix])->magnitude * force->ftm2v;
 
   // nfreq = timesteps between insertions
@@ -260,7 +260,7 @@ int FixPour::setmask()
 
 void FixPour::init()
 {
-  if (domain->triclinic) error->all("Cannot use fix pour with triclinic box");
+  if (domain->triclinic) error->all(FLERR,"Cannot use fix pour with triclinic box");
 
   // insure gravity fix exists
   // for 3d must point in -z, for 2d must point in -y
@@ -270,7 +270,7 @@ void FixPour::init()
   for (ifix = 0; ifix < modify->nfix; ifix++)
     if (strcmp(modify->fix[ifix]->style,"gravity") == 0) break;
   if (ifix == modify->nfix) 
-    error->all("No fix gravity defined for fix pour");
+    error->all(FLERR,"No fix gravity defined for fix pour");
 
   double xgrav = ((FixGravity *) modify->fix[ifix])->xgrav;
   double ygrav = ((FixGravity *) modify->fix[ifix])->ygrav;
@@ -279,16 +279,16 @@ void FixPour::init()
   if (domain->dimension == 3) {
     if (fabs(xgrav) > EPSILON || fabs(ygrav) > EPSILON ||
 	fabs(zgrav+1.0) > EPSILON)
-      error->all("Gravity must point in -z to use with fix pour in 3d");
+      error->all(FLERR,"Gravity must point in -z to use with fix pour in 3d");
   } else {
     if (fabs(xgrav) > EPSILON || fabs(ygrav+1.0) > EPSILON ||
 	fabs(zgrav) > EPSILON)
-      error->all("Gravity must point in -y to use with fix pour in 2d");
+      error->all(FLERR,"Gravity must point in -y to use with fix pour in 2d");
   }
 
   double gnew = - ((FixGravity *) modify->fix[ifix])->magnitude * force->ftm2v;
   if (gnew != grav)
-    error->all("Gravity changed since fix pour was created");
+    error->all(FLERR,"Gravity changed since fix pour was created");
 }
 
 /* ----------------------------------------------------------------------
@@ -415,7 +415,7 @@ void FixPour::pre_exchange()
 
   ninserted += nnear-nprevious;
   if (nnear - nprevious < nnew && me == 0)
-    error->warning("Less insertions than requested",0);
+    error->warning(FLERR,"Less insertions than requested",0);
 
   // check if new atom is in my sub-box or above it if I'm highest proc
   // if so, add to my list via create_atom()
@@ -573,5 +573,5 @@ void FixPour::xyz_random(double h, double *coord)
 
 void FixPour::reset_dt()
 {
-  error->all("Cannot change timestep with fix pour");
+  error->all(FLERR,"Cannot change timestep with fix pour");
 }
diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp
index 97582833993c09d7121c4bc67a7016e41cb936c0..a23f70c44d082e83e39014e70eabb8cfdb0f7581 100644
--- a/src/GRANULAR/fix_wall_gran.cpp
+++ b/src/GRANULAR/fix_wall_gran.cpp
@@ -36,18 +36,15 @@ enum{HOOKE,HOOKE_HISTORY,HERTZ_HISTORY};
 
 #define BIG 1.0e20
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 10) error->all("Illegal fix wall/gran command");
+  if (narg < 10) error->all(FLERR,"Illegal fix wall/gran command");
 
   if (!atom->sphere_flag)
-    error->all("Fix wall/gran requires atom style sphere");
+    error->all(FLERR,"Fix wall/gran requires atom style sphere");
 
   restart_peratom = 1;
   create_attribute = 1;
@@ -69,7 +66,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) :
 
   if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 || 
       xmu < 0.0 || xmu > 1.0 || dampflag < 0 || dampflag > 1)
-    error->all("Illegal fix wall/gran command");
+    error->all(FLERR,"Illegal fix wall/gran command");
 
   // convert Kn and Kt from pressure units to force/distance^2 if Hertzian
 
@@ -82,7 +79,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) :
 
   int iarg = 9;
   if (strcmp(arg[iarg],"xplane") == 0) {
-    if (narg < iarg+3) error->all("Illegal fix wall/gran command");
+    if (narg < iarg+3) error->all(FLERR,"Illegal fix wall/gran command");
     wallstyle = XPLANE;
     if (strcmp(arg[iarg+1],"NULL") == 0) lo = -BIG;
     else lo = atof(arg[iarg+1]);
@@ -90,7 +87,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) :
     else hi = atof(arg[iarg+2]);
     iarg += 3;
   } else if (strcmp(arg[iarg],"yplane") == 0) {
-    if (narg < iarg+3) error->all("Illegal fix wall/gran command");
+    if (narg < iarg+3) error->all(FLERR,"Illegal fix wall/gran command");
     wallstyle = YPLANE;
     if (strcmp(arg[iarg+1],"NULL") == 0) lo = -BIG;
     else lo = atof(arg[iarg+1]);
@@ -98,7 +95,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) :
     else hi = atof(arg[iarg+2]);
     iarg += 3;
   } else if (strcmp(arg[iarg],"zplane") == 0) {
-    if (narg < iarg+3) error->all("Illegal fix wall/gran command");
+    if (narg < iarg+3) error->all(FLERR,"Illegal fix wall/gran command");
     wallstyle = ZPLANE;
     if (strcmp(arg[iarg+1],"NULL") == 0) lo = -BIG;
     else lo = atof(arg[iarg+1]);
@@ -106,7 +103,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) :
     else hi = atof(arg[iarg+2]);
     iarg += 3;
   } else if (strcmp(arg[iarg],"zcylinder") == 0) {
-    if (narg < iarg+2) error->all("Illegal fix wall/gran command");
+    if (narg < iarg+2) error->all(FLERR,"Illegal fix wall/gran command");
     wallstyle = ZCYLINDER;
     lo = hi = 0.0;
     cylradius = atof(arg[iarg+1]);
@@ -120,45 +117,45 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) :
 
   while (iarg < narg) {
     if (strcmp(arg[iarg],"wiggle") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix wall/gran command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix wall/gran command");
       if (strcmp(arg[iarg+1],"x") == 0) axis = 0;
       else if (strcmp(arg[iarg+1],"y") == 0) axis = 1;
       else if (strcmp(arg[iarg+1],"z") == 0) axis = 2;
-      else error->all("Illegal fix wall/gran command");
+      else error->all(FLERR,"Illegal fix wall/gran command");
       amplitude = atof(arg[iarg+2]);
       period = atof(arg[iarg+3]);
       wiggle = 1;
       iarg += 4;
     } else if (strcmp(arg[iarg],"shear") == 0) {
-      if (iarg+3 > narg) error->all("Illegal fix wall/gran command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal fix wall/gran command");
       if (strcmp(arg[iarg+1],"x") == 0) axis = 0;
       else if (strcmp(arg[iarg+1],"y") == 0) axis = 1;
       else if (strcmp(arg[iarg+1],"z") == 0) axis = 2;
-      else error->all("Illegal fix wall/gran command");
+      else error->all(FLERR,"Illegal fix wall/gran command");
       vshear = atof(arg[iarg+2]);
       wshear = 1;
       iarg += 3;
-    } else error->all("Illegal fix wall/gran command");
+    } else error->all(FLERR,"Illegal fix wall/gran command");
   }
 
   if (wallstyle == XPLANE && domain->xperiodic)
-    error->all("Cannot use wall in periodic dimension");
+    error->all(FLERR,"Cannot use wall in periodic dimension");
   if (wallstyle == YPLANE && domain->yperiodic)
-    error->all("Cannot use wall in periodic dimension");
+    error->all(FLERR,"Cannot use wall in periodic dimension");
   if (wallstyle == ZPLANE && domain->zperiodic)
-    error->all("Cannot use wall in periodic dimension");
+    error->all(FLERR,"Cannot use wall in periodic dimension");
   if (wallstyle == ZCYLINDER && (domain->xperiodic || domain->yperiodic))
-    error->all("Cannot use wall in periodic dimension");
+    error->all(FLERR,"Cannot use wall in periodic dimension");
 
-  if (wiggle && wshear) error->all("Cannot wiggle and shear fix wall/gran");
+  if (wiggle && wshear) error->all(FLERR,"Cannot wiggle and shear fix wall/gran");
   if (wiggle && wallstyle == ZCYLINDER && axis != 2)
-    error->all("Invalid wiggle direction for fix wall/gran");
+    error->all(FLERR,"Invalid wiggle direction for fix wall/gran");
   if (wshear && wallstyle == XPLANE && axis == 0)
-    error->all("Invalid shear direction for fix wall/gran");
+    error->all(FLERR,"Invalid shear direction for fix wall/gran");
   if (wshear && wallstyle == YPLANE && axis == 1)
-    error->all("Invalid shear direction for fix wall/gran");
+    error->all(FLERR,"Invalid shear direction for fix wall/gran");
   if (wshear && wallstyle == ZPLANE && axis == 2)
-    error->all("Invalid shear direction for fix wall/gran");
+    error->all(FLERR,"Invalid shear direction for fix wall/gran");
 
   // setup oscillations
 
@@ -226,7 +223,7 @@ void FixWallGran::init()
     pairstyle = HOOKE_HISTORY;
   else if (force->pair_match("gran/hertz/history",1))
     pairstyle = HERTZ_HISTORY;
-  else error->all("Fix wall/gran is incompatible with Pair style");
+  else error->all(FLERR,"Fix wall/gran is incompatible with Pair style");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/GRANULAR/pair_gran_hertz_history.cpp b/src/GRANULAR/pair_gran_hertz_history.cpp
index 6c193e3517cd026a4bf8edbc9c2fda1798990730..a418e9352d2d4a6b3e2a6b196f30a2fc6c22f032 100644
--- a/src/GRANULAR/pair_gran_hertz_history.cpp
+++ b/src/GRANULAR/pair_gran_hertz_history.cpp
@@ -28,9 +28,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairGranHertzHistory::PairGranHertzHistory(LAMMPS *lmp) :
@@ -256,7 +253,7 @@ void PairGranHertzHistory::compute(int eflag, int vflag)
 
 void PairGranHertzHistory::settings(int narg, char **arg)
 {
-  if (narg != 6) error->all("Illegal pair_style command");
+  if (narg != 6) error->all(FLERR,"Illegal pair_style command");
 
   kn = force->numeric(arg[0]);
   if (strcmp(arg[1],"NULL") == 0) kt = kn * 2.0/7.0;
@@ -272,7 +269,7 @@ void PairGranHertzHistory::settings(int narg, char **arg)
 
   if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 || 
       xmu < 0.0 || xmu > 1.0 || dampflag < 0 || dampflag > 1)
-    error->all("Illegal pair_style command");
+    error->all(FLERR,"Illegal pair_style command");
 
   // convert Kn and Kt from pressure units to force/distance^2
 
diff --git a/src/GRANULAR/pair_gran_hooke.cpp b/src/GRANULAR/pair_gran_hooke.cpp
index 542bbaa5820450623a6586208745cf8ec6321f15..95651e7606e20fd3cd938140668e269862f74f91 100644
--- a/src/GRANULAR/pair_gran_hooke.cpp
+++ b/src/GRANULAR/pair_gran_hooke.cpp
@@ -25,9 +25,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairGranHooke::PairGranHooke(LAMMPS *lmp) : PairGranHookeHistory(lmp)
diff --git a/src/GRANULAR/pair_gran_hooke_history.cpp b/src/GRANULAR/pair_gran_hooke_history.cpp
index 149fa696f01f89cffc281b62748cde2702d5647b..6ab64ee3714c43b978d847037d549d5a48da20bb 100644
--- a/src/GRANULAR/pair_gran_hooke_history.cpp
+++ b/src/GRANULAR/pair_gran_hooke_history.cpp
@@ -38,9 +38,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairGranHookeHistory::PairGranHookeHistory(LAMMPS *lmp) : Pair(lmp)
@@ -311,7 +308,7 @@ void PairGranHookeHistory::allocate()
 
 void PairGranHookeHistory::settings(int narg, char **arg)
 {
-  if (narg != 6) error->all("Illegal pair_style command");
+  if (narg != 6) error->all(FLERR,"Illegal pair_style command");
 
   kn = force->numeric(arg[0]);
   if (strcmp(arg[1],"NULL") == 0) kt = kn * 2.0/7.0;
@@ -327,7 +324,7 @@ void PairGranHookeHistory::settings(int narg, char **arg)
 
   if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 || 
       xmu < 0.0 || xmu > 1.0 || dampflag < 0 || dampflag > 1)
-    error->all("Illegal pair_style command");
+    error->all(FLERR,"Illegal pair_style command");
 }
 
 /* ----------------------------------------------------------------------
@@ -336,7 +333,7 @@ void PairGranHookeHistory::settings(int narg, char **arg)
 
 void PairGranHookeHistory::coeff(int narg, char **arg)
 {
-  if (narg > 2) error->all("Incorrect args for pair coefficients");
+  if (narg > 2) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -351,7 +348,7 @@ void PairGranHookeHistory::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -365,9 +362,9 @@ void PairGranHookeHistory::init_style()
   // error and warning checks
 
   if (!atom->sphere_flag)
-    error->all("Pair granular requires atom style sphere");
+    error->all(FLERR,"Pair granular requires atom style sphere");
   if (comm->ghost_velocity == 0)
-    error->all("Pair granular requires ghost atoms store velocity");
+    error->all(FLERR,"Pair granular requires ghost atoms store velocity");
 
   // need a half neigh list and optionally a granular history neigh list
 
@@ -389,7 +386,7 @@ void PairGranHookeHistory::init_style()
   // if first init, create Fix needed for storing shear history
 
   if (history && force->newton_pair == 1)
-    error->all("Pair granular with shear history requires newton pair off");
+    error->all(FLERR,"Pair granular with shear history requires newton pair off");
 
   if (history && fix_history == NULL) {
     char **fixarg = new char*[3];
diff --git a/src/KSPACE/ewald.cpp b/src/KSPACE/ewald.cpp
index ad7a5923ecfc124e6c5f191befe2fcafa4520ab8..5b6d46750a00b33d18af3d626bfa887c04e8709a 100644
--- a/src/KSPACE/ewald.cpp
+++ b/src/KSPACE/ewald.cpp
@@ -33,14 +33,11 @@ using namespace LAMMPS_NS;
 
 #define SMALL 0.00001
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 Ewald::Ewald(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg)
 {
-  if (narg != 1) error->all("Illegal kspace_style ewald command");
+  if (narg != 1) error->all(FLERR,"Illegal kspace_style ewald command");
 
   precision = atof(arg[0]);
   PI = 4.0*atan(1.0);
@@ -81,18 +78,18 @@ void Ewald::init()
 
   // error check
 
-  if (domain->triclinic) error->all("Cannot use Ewald with triclinic box");
+  if (domain->triclinic) error->all(FLERR,"Cannot use Ewald with triclinic box");
   if (domain->dimension == 2) 
-    error->all("Cannot use Ewald with 2d simulation");
+    error->all(FLERR,"Cannot use Ewald with 2d simulation");
 
-  if (!atom->q_flag) error->all("Kspace style requires atom attribute q");
+  if (!atom->q_flag) error->all(FLERR,"Kspace style requires atom attribute q");
 
   if (slabflag == 0 && domain->nonperiodic > 0)
-    error->all("Cannot use nonperiodic boundaries with Ewald");
+    error->all(FLERR,"Cannot use nonperiodic boundaries with Ewald");
   if (slabflag == 1) {
     if (domain->xperiodic != 1 || domain->yperiodic != 1 || 
 	domain->boundary[2][0] != 1 || domain->boundary[2][1] != 1)
-      error->all("Incorrect boundaries with slab Ewald");
+      error->all(FLERR,"Incorrect boundaries with slab Ewald");
   }
 
   // extract short-range Coulombic cutoff from pair style
@@ -101,11 +98,11 @@ void Ewald::init()
   scale = 1.0;
 
   if (force->pair == NULL)
-    error->all("KSpace style is incompatible with Pair style");
+    error->all(FLERR,"KSpace style is incompatible with Pair style");
   int itmp;
   double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp);
   if (p_cutoff == NULL)
-    error->all("KSpace style is incompatible with Pair style");
+    error->all(FLERR,"KSpace style is incompatible with Pair style");
   double cutoff = *p_cutoff;
 
   qsum = qsqsum = 0.0;
@@ -121,11 +118,11 @@ void Ewald::init()
   qsqsum = tmp;
 
   if (qsqsum == 0.0)
-    error->all("Cannot use kspace solver on system with no charge");
+    error->all(FLERR,"Cannot use kspace solver on system with no charge");
   if (fabs(qsum) > SMALL && comm->me == 0) {
     char str[128];
     sprintf(str,"System is not charge neutral, net charge = %g",qsum);
-    error->warning(str);
+    error->warning(FLERR,str);
   }
 
   // setup K-space resolution
diff --git a/src/KSPACE/fft3d_wrap.cpp b/src/KSPACE/fft3d_wrap.cpp
index fa0d232a108beb51e24bab00c0f109ba8b73a5bc..ef1298de40aa30888cc6665cd3db751289205f9a 100644
--- a/src/KSPACE/fft3d_wrap.cpp
+++ b/src/KSPACE/fft3d_wrap.cpp
@@ -30,7 +30,7 @@ FFT3d::FFT3d(LAMMPS *lmp, MPI_Comm comm, int nfast, int nmid, int nslow,
 			    in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi,
 			    out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi,
 			    scaled,permute,nbuf);
-  if (plan == NULL) error->one("Could not create 3d FFT plan");
+  if (plan == NULL) error->one(FLERR,"Could not create 3d FFT plan");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/KSPACE/pair_born_coul_long.cpp b/src/KSPACE/pair_born_coul_long.cpp
index fce0ce0846c79c4c2347779c02ee49c48ad7908a..44f3d73bf9bae5d5446c84ff09e720b0d399d672 100644
--- a/src/KSPACE/pair_born_coul_long.cpp
+++ b/src/KSPACE/pair_born_coul_long.cpp
@@ -31,9 +31,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define EWALD_F   1.12837917
 #define EWALD_P   0.3275911
 #define A1        0.254829592
@@ -213,7 +210,7 @@ void PairBornCoulLong::allocate()
 
 void PairBornCoulLong::settings(int narg, char **arg)
 {
-  if (narg < 1 || narg > 2) error->all("Illegal pair_style command");
+  if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command");
 
   cut_lj_global = force->numeric(arg[0]);
   if (narg == 1) cut_coul = cut_lj_global;
@@ -235,7 +232,7 @@ void PairBornCoulLong::settings(int narg, char **arg)
 
 void PairBornCoulLong::coeff(int narg, char **arg)
 {
-  if (narg < 7 || narg > 8) error->all("Incorrect args for pair coefficients");
+  if (narg < 7 || narg > 8) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -245,7 +242,7 @@ void PairBornCoulLong::coeff(int narg, char **arg)
   double a_one = force->numeric(arg[2]);
   double rho_one = force->numeric(arg[3]);
   double sigma_one = force->numeric(arg[4]);
-  if (rho_one <= 0) error->all("Incorrect args for pair coefficients");
+  if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients");
   double c_one = force->numeric(arg[5]);
   double d_one = force->numeric(arg[6]);
 
@@ -266,7 +263,7 @@ void PairBornCoulLong::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -275,7 +272,7 @@ void PairBornCoulLong::coeff(int narg, char **arg)
 
 double PairBornCoulLong::init_one(int i, int j)
 {
-  if (setflag[i][j] == 0) error->all("All pair coeffs are not set");
+  if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
 
   double cut = MAX(cut_lj[i][j],cut_coul);
   cut_ljsq[i][j] = cut_lj[i][j] * cut_lj[i][j];
@@ -345,14 +342,14 @@ double PairBornCoulLong::init_one(int i, int j)
 void PairBornCoulLong::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style born/coul/long requires atom attribute q");
+    error->all(FLERR,"Pair style born/coul/long requires atom attribute q");
 
   cut_coulsq = cut_coul * cut_coul;
 
   // insure use of KSpace long-range solver, set g_ewald
 
   if (force->kspace == NULL)
-    error->all("Pair style is incompatible with KSpace style");
+    error->all(FLERR,"Pair style is incompatible with KSpace style");
   g_ewald = force->kspace->g_ewald;
 
   neighbor->request(this);
diff --git a/src/KSPACE/pair_buck_coul_long.cpp b/src/KSPACE/pair_buck_coul_long.cpp
index ba18aff25e8b038ae317f1a1888b98bae0a03616..6b3e92b50db6dbc5be8a20a31392aebb9c76dcff 100644
--- a/src/KSPACE/pair_buck_coul_long.cpp
+++ b/src/KSPACE/pair_buck_coul_long.cpp
@@ -27,9 +27,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define EWALD_F   1.12837917
 #define EWALD_P   0.3275911
 #define A1        0.254829592
@@ -202,7 +199,7 @@ void PairBuckCoulLong::allocate()
 
 void PairBuckCoulLong::settings(int narg, char **arg)
 {
-  if (narg < 1 || narg > 2) error->all("Illegal pair_style command");
+  if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command");
 
   cut_lj_global = force->numeric(arg[0]);
   if (narg == 1) cut_coul = cut_lj_global;
@@ -224,7 +221,7 @@ void PairBuckCoulLong::settings(int narg, char **arg)
 
 void PairBuckCoulLong::coeff(int narg, char **arg)
 {
-  if (narg < 5 || narg > 6) error->all("Incorrect args for pair coefficients");
+  if (narg < 5 || narg > 6) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -233,7 +230,7 @@ void PairBuckCoulLong::coeff(int narg, char **arg)
 
   double a_one = force->numeric(arg[2]);
   double rho_one = force->numeric(arg[3]);
-  if (rho_one <= 0) error->all("Incorrect args for pair coefficients");
+  if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients");
   double c_one = force->numeric(arg[4]);
 
   double cut_lj_one = cut_lj_global;
@@ -251,7 +248,7 @@ void PairBuckCoulLong::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -260,7 +257,7 @@ void PairBuckCoulLong::coeff(int narg, char **arg)
 
 double PairBuckCoulLong::init_one(int i, int j)
 {
-  if (setflag[i][j] == 0) error->all("All pair coeffs are not set");
+  if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
 
   double cut = MAX(cut_lj[i][j],cut_coul);
   cut_ljsq[i][j] = cut_lj[i][j] * cut_lj[i][j];
@@ -322,14 +319,14 @@ double PairBuckCoulLong::init_one(int i, int j)
 void PairBuckCoulLong::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style buck/coul/long requires atom attribute q");
+    error->all(FLERR,"Pair style buck/coul/long requires atom attribute q");
 
   cut_coulsq = cut_coul * cut_coul;
 
   // insure use of KSpace long-range solver, set g_ewald
 
   if (force->kspace == NULL)
-    error->all("Pair style is incompatible with KSpace style");
+    error->all(FLERR,"Pair style is incompatible with KSpace style");
   g_ewald = force->kspace->g_ewald;
 
   neighbor->request(this);
diff --git a/src/KSPACE/pair_coul_long.cpp b/src/KSPACE/pair_coul_long.cpp
index dee833cb667a9275058c686063ea485640b11cc3..6a3f70b3510b7cc94beee889a753297109694e03 100644
--- a/src/KSPACE/pair_coul_long.cpp
+++ b/src/KSPACE/pair_coul_long.cpp
@@ -34,9 +34,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define EWALD_F   1.12837917
 #define EWALD_P   0.3275911
 #define A1        0.254829592
@@ -199,7 +196,7 @@ void PairCoulLong::allocate()
 
 void PairCoulLong::settings(int narg, char **arg)
 {
-  if (narg != 1) error->all("Illegal pair_style command");
+  if (narg != 1) error->all(FLERR,"Illegal pair_style command");
 
   cut_coul = force->numeric(arg[0]);
 }
@@ -210,7 +207,7 @@ void PairCoulLong::settings(int narg, char **arg)
 
 void PairCoulLong::coeff(int narg, char **arg)
 {
-  if (narg != 2) error->all("Incorrect args for pair coefficients");
+  if (narg != 2) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -226,7 +223,7 @@ void PairCoulLong::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -236,7 +233,7 @@ void PairCoulLong::coeff(int narg, char **arg)
 void PairCoulLong::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style lj/cut/coul/long requires atom attribute q");
+    error->all(FLERR,"Pair style lj/cut/coul/long requires atom attribute q");
 
   neighbor->request(this);
 
@@ -248,13 +245,13 @@ void PairCoulLong::init_style()
       ((Respa *) update->integrate)->level_inner >= 0) {
     cut_respa = ((Respa *) update->integrate)->cutoff;
     if (cut_coul < cut_respa[3])
-      error->all("Pair cutoff < Respa interior cutoff");
+      error->all(FLERR,"Pair cutoff < Respa interior cutoff");
   } else cut_respa = NULL;
 
   // insure use of KSpace long-range solver, set g_ewald
 
  if (force->kspace == NULL) 
-    error->all("Pair style is incompatible with KSpace style");
+    error->all(FLERR,"Pair style is incompatible with KSpace style");
   g_ewald = force->kspace->g_ewald;
 
   // setup force tables
diff --git a/src/KSPACE/pair_lj_charmm_coul_long.cpp b/src/KSPACE/pair_lj_charmm_coul_long.cpp
index 539cf34f73f0b8a7100f8520c45cc798139e19b2..1ff61a5ec003e8df071aad7dd0b75c99f6ee52a3 100644
--- a/src/KSPACE/pair_lj_charmm_coul_long.cpp
+++ b/src/KSPACE/pair_lj_charmm_coul_long.cpp
@@ -37,9 +37,6 @@ using namespace LAMMPS_NS;
 
 enum{GEOMETRIC,ARITHMETIC,SIXTHPOWER};   // same as in pair.cpp
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define EWALD_F   1.12837917
 #define EWALD_P   0.3275911
 #define A1        0.254829592
@@ -656,7 +653,7 @@ void PairLJCharmmCoulLong::allocate()
 
 void PairLJCharmmCoulLong::settings(int narg, char **arg)
 {
-  if (narg != 2 && narg != 3) error->all("Illegal pair_style command");
+  if (narg != 2 && narg != 3) error->all(FLERR,"Illegal pair_style command");
 
   cut_lj_inner = force->numeric(arg[0]);
   cut_lj = force->numeric(arg[1]);
@@ -670,7 +667,7 @@ void PairLJCharmmCoulLong::settings(int narg, char **arg)
 
 void PairLJCharmmCoulLong::coeff(int narg, char **arg)
 {
-  if (narg != 4 && narg != 6) error->all("Illegal pair_coeff command");
+  if (narg != 4 && narg != 6) error->all(FLERR,"Illegal pair_coeff command");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -698,7 +695,7 @@ void PairLJCharmmCoulLong::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -708,7 +705,7 @@ void PairLJCharmmCoulLong::coeff(int narg, char **arg)
 void PairLJCharmmCoulLong::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style lj/charmm/coul/long requires atom attribute q");
+    error->all(FLERR,"Pair style lj/charmm/coul/long requires atom attribute q");
 
   // request regular or rRESPA neighbor lists
 
@@ -749,7 +746,7 @@ void PairLJCharmmCoulLong::init_style()
   // require cut_lj_inner < cut_lj
 
   if (cut_lj_inner >= cut_lj) 
-    error->all("Pair inner cutoff >= Pair outer cutoff");
+    error->all(FLERR,"Pair inner cutoff >= Pair outer cutoff");
 
   cut_lj_innersq = cut_lj_inner * cut_lj_inner;
   cut_ljsq = cut_lj * cut_lj;
@@ -765,15 +762,15 @@ void PairLJCharmmCoulLong::init_style()
       ((Respa *) update->integrate)->level_inner >= 0) {
     cut_respa = ((Respa *) update->integrate)->cutoff;
     if (MIN(cut_lj,cut_coul) < cut_respa[3])
-      error->all("Pair cutoff < Respa interior cutoff");
+      error->all(FLERR,"Pair cutoff < Respa interior cutoff");
     if (cut_lj_inner < cut_respa[1])
-      error->all("Pair inner cutoff < Respa interior cutoff");
+      error->all(FLERR,"Pair inner cutoff < Respa interior cutoff");
   } else cut_respa = NULL;
 
   // insure use of KSpace long-range solver, set g_ewald
 
   if (force->kspace == NULL)
-    error->all("Pair style is incompatible with KSpace style");
+    error->all(FLERR,"Pair style is incompatible with KSpace style");
   g_ewald = force->kspace->g_ewald;
   
   // setup force tables
diff --git a/src/KSPACE/pair_lj_cut_coul_long.cpp b/src/KSPACE/pair_lj_cut_coul_long.cpp
index 7ab653b58b060b73bbf5f07a2e6c2d3983bd56d5..ba9e390baa66bd786244723ee618824f9cfaa663 100644
--- a/src/KSPACE/pair_lj_cut_coul_long.cpp
+++ b/src/KSPACE/pair_lj_cut_coul_long.cpp
@@ -35,9 +35,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define EWALD_F   1.12837917
 #define EWALD_P   0.3275911
 #define A1        0.254829592
@@ -593,7 +590,7 @@ void PairLJCutCoulLong::allocate()
 
 void PairLJCutCoulLong::settings(int narg, char **arg)
 {
- if (narg < 1 || narg > 2) error->all("Illegal pair_style command");
+ if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command");
 
   cut_lj_global = force->numeric(arg[0]);
   if (narg == 1) cut_coul = cut_lj_global;
@@ -615,7 +612,7 @@ void PairLJCutCoulLong::settings(int narg, char **arg)
 
 void PairLJCutCoulLong::coeff(int narg, char **arg)
 {
-  if (narg < 4 || narg > 5) error->all("Incorrect args for pair coefficients");
+  if (narg < 4 || narg > 5) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -639,7 +636,7 @@ void PairLJCutCoulLong::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -649,7 +646,7 @@ void PairLJCutCoulLong::coeff(int narg, char **arg)
 void PairLJCutCoulLong::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style lj/cut/coul/long requires atom attribute q");
+    error->all(FLERR,"Pair style lj/cut/coul/long requires atom attribute q");
 
   // request regular or rRESPA neighbor lists
 
@@ -699,7 +696,7 @@ void PairLJCutCoulLong::init_style()
   // insure use of KSpace long-range solver, set g_ewald
 
   if (force->kspace == NULL)
-    error->all("Pair style is incompatible with KSpace style");
+    error->all(FLERR,"Pair style is incompatible with KSpace style");
   g_ewald = force->kspace->g_ewald;
 
   // setup force tables
@@ -756,7 +753,7 @@ double PairLJCutCoulLong::init_one(int i, int j)
   // check interior rRESPA cutoff
 
   if (cut_respa && MIN(cut_lj[i][j],cut_coul) < cut_respa[3])
-    error->all("Pair cutoff < Respa interior cutoff");
+    error->all(FLERR,"Pair cutoff < Respa interior cutoff");
 
   // compute I,J contribution to long-range tail correction
   // count total # of atoms of type I and J via Allreduce
diff --git a/src/KSPACE/pair_lj_cut_coul_long_tip4p.cpp b/src/KSPACE/pair_lj_cut_coul_long_tip4p.cpp
index 2df4235f5945a8ef2ebf9b6cbb17895fb41f2434..bc3cfc98dd2e0e5e9531c80283cb818440d3dc5c 100644
--- a/src/KSPACE/pair_lj_cut_coul_long_tip4p.cpp
+++ b/src/KSPACE/pair_lj_cut_coul_long_tip4p.cpp
@@ -37,9 +37,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define EWALD_F   1.12837917
 #define EWALD_P   0.3275911
 #define A1        0.254829592
@@ -369,7 +366,7 @@ void PairLJCutCoulLongTIP4P::compute(int eflag, int vflag)
 
 void PairLJCutCoulLongTIP4P::settings(int narg, char **arg)
 {
-  if (narg < 6 || narg > 7) error->all("Illegal pair_style command");
+  if (narg < 6 || narg > 7) error->all(FLERR,"Illegal pair_style command");
 
   typeO = force->inumeric(arg[0]);
   typeH = force->inumeric(arg[1]);
@@ -398,17 +395,17 @@ void PairLJCutCoulLongTIP4P::settings(int narg, char **arg)
 void PairLJCutCoulLongTIP4P::init_style()
 {
   if (atom->tag_enable == 0)
-    error->all("Pair style lj/cut/coul/long/tip4p requires atom IDs");
+    error->all(FLERR,"Pair style lj/cut/coul/long/tip4p requires atom IDs");
   if (!force->newton_pair) 
-    error->all("Pair style lj/cut/coul/long/tip4p requires newton pair on");
+    error->all(FLERR,"Pair style lj/cut/coul/long/tip4p requires newton pair on");
   if (!atom->q_flag)
-    error->all("Pair style lj/cut/coul/long/tip4p requires atom attribute q");
+    error->all(FLERR,"Pair style lj/cut/coul/long/tip4p requires atom attribute q");
   if (strcmp(force->kspace_style,"pppm/tip4p") != 0)
-    error->all("Pair style is incompatible with KSpace style");
+    error->all(FLERR,"Pair style is incompatible with KSpace style");
   if (force->bond == NULL)
-    error->all("Must use a bond style with TIP4P potential");
+    error->all(FLERR,"Must use a bond style with TIP4P potential");
   if (force->angle == NULL)
-    error->all("Must use an angle style with TIP4P potential");
+    error->all(FLERR,"Must use an angle style with TIP4P potential");
 
   PairLJCutCoulLong::init_style();
 
@@ -482,9 +479,9 @@ void PairLJCutCoulLongTIP4P::find_M(int i, int &iH1, int &iH2, double *xM)
   iH1 = atom->map(atom->tag[i] + 1);
   iH2 = atom->map(atom->tag[i] + 2);
 
-  if (iH1 == -1 || iH2 == -1) error->one("TIP4P hydrogen is missing");
+  if (iH1 == -1 || iH2 == -1) error->one(FLERR,"TIP4P hydrogen is missing");
   if (atom->type[iH1] != typeH || atom->type[iH2] != typeH)
-    error->one("TIP4P hydrogen has incorrect atom type");
+    error->one(FLERR,"TIP4P hydrogen has incorrect atom type");
 
   double **x = atom->x; 
 
diff --git a/src/KSPACE/pppm.cpp b/src/KSPACE/pppm.cpp
index 40730df6ff13152cca91bcf14ca285cd5f69e82d..cc92e1719f5c80917ef7686c5814dcf545ea8712 100644
--- a/src/KSPACE/pppm.cpp
+++ b/src/KSPACE/pppm.cpp
@@ -51,14 +51,11 @@ using namespace LAMMPS_NS;
 #define ONEF  1.0
 #endif
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PPPM::PPPM(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg)
 {
-  if (narg < 1) error->all("Illegal kspace_style pppm command");
+  if (narg < 1) error->all(FLERR,"Illegal kspace_style pppm command");
 
   precision = atof(arg[0]);
   PI = 4.0*atan(1.0);
@@ -115,23 +112,23 @@ void PPPM::init()
   // error check
 
   if (domain->triclinic)
-    error->all("Cannot (yet) use PPPM with triclinic box");
-  if (domain->dimension == 2) error->all("Cannot use PPPM with 2d simulation");
+    error->all(FLERR,"Cannot (yet) use PPPM with triclinic box");
+  if (domain->dimension == 2) error->all(FLERR,"Cannot use PPPM with 2d simulation");
 
-  if (!atom->q_flag) error->all("Kspace style requires atom attribute q");
+  if (!atom->q_flag) error->all(FLERR,"Kspace style requires atom attribute q");
 
   if (slabflag == 0 && domain->nonperiodic > 0)
-    error->all("Cannot use nonperiodic boundaries with PPPM");
+    error->all(FLERR,"Cannot use nonperiodic boundaries with PPPM");
   if (slabflag == 1) {
     if (domain->xperiodic != 1 || domain->yperiodic != 1 || 
 	domain->boundary[2][0] != 1 || domain->boundary[2][1] != 1)
-      error->all("Incorrect boundaries with slab PPPM");
+      error->all(FLERR,"Incorrect boundaries with slab PPPM");
   }
 
   if (order > MAXORDER) {
     char str[128];
     sprintf(str,"PPPM order cannot be greater than %d",MAXORDER);
-    error->all(str);
+    error->all(FLERR,str);
   }
 
   // free all arrays previously allocated
@@ -144,11 +141,11 @@ void PPPM::init()
   scale = 1.0;
 
   if (force->pair == NULL)
-    error->all("KSpace style is incompatible with Pair style");
+    error->all(FLERR,"KSpace style is incompatible with Pair style");
   int itmp;
   double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp);
   if (p_cutoff == NULL)
-    error->all("KSpace style is incompatible with Pair style");
+    error->all(FLERR,"KSpace style is incompatible with Pair style");
   cutoff = *p_cutoff;
 
   // if kspace is TIP4P, extract TIP4P params from pair style
@@ -158,14 +155,14 @@ void PPPM::init()
 
   if (strcmp(force->kspace_style,"pppm/tip4p") == 0) {
     if (force->pair == NULL)
-      error->all("KSpace style is incompatible with Pair style");
+      error->all(FLERR,"KSpace style is incompatible with Pair style");
     double *p_qdist = (double *) force->pair->extract("qdist",itmp);
     int *p_typeO = (int *) force->pair->extract("typeO",itmp);
     int *p_typeH = (int *) force->pair->extract("typeH",itmp);
     int *p_typeA = (int *) force->pair->extract("typeA",itmp);
     int *p_typeB = (int *) force->pair->extract("typeB",itmp);
     if (!p_qdist || !p_typeO || !p_typeH || !p_typeA || !p_typeB)
-      error->all("KSpace style is incompatible with Pair style");
+      error->all(FLERR,"KSpace style is incompatible with Pair style");
     qdist = *p_qdist;
     typeO = *p_typeO;
     typeH = *p_typeH;
@@ -173,13 +170,13 @@ void PPPM::init()
     int typeB = *p_typeB;
 
     if (force->angle == NULL || force->bond == NULL)
-      error->all("Bond and angle potentials must be defined for TIP4P");
+      error->all(FLERR,"Bond and angle potentials must be defined for TIP4P");
     if (typeA < 1 || typeA > atom->nangletypes || 
 	force->angle->setflag[typeA] == 0)
-      error->all("Bad TIP4P angle type for PPPM/TIP4P");
+      error->all(FLERR,"Bad TIP4P angle type for PPPM/TIP4P");
     if (typeB < 1 || typeB > atom->nbondtypes || 
 	force->bond->setflag[typeB] == 0)
-      error->all("Bad TIP4P bond type for PPPM/TIP4P");
+      error->all(FLERR,"Bad TIP4P bond type for PPPM/TIP4P");
     double theta = force->angle->equilibrium_angle(typeA);
     double blen = force->bond->equilibrium_distance(typeB);
     alpha = qdist / (cos(0.5*theta) * blen);
@@ -200,11 +197,11 @@ void PPPM::init()
   qsqsum = tmp;
 
   if (qsqsum == 0.0)
-    error->all("Cannot use kspace solver on system with no charge");
+    error->all(FLERR,"Cannot use kspace solver on system with no charge");
   if (fabs(qsum) > SMALL && me == 0) {
     char str[128];
     sprintf(str,"System is not charge neutral, net charge = %g",qsum);
-    error->warning(str);
+    error->warning(FLERR,str);
   }
 
   // setup FFT grid resolution and g_ewald
@@ -216,14 +213,14 @@ void PPPM::init()
   while (order > 0) {
 
     if (iteration && me == 0)
-      error->warning("Reducing PPPM order b/c stencil extends "
+      error->warning(FLERR,"Reducing PPPM order b/c stencil extends "
 		     "beyond neighbor processor");
     iteration++;
 
     set_grid();
 
     if (nx_pppm >= OFFSET || ny_pppm >= OFFSET || nz_pppm >= OFFSET)
-      error->all("PPPM grid is too large");
+      error->all(FLERR,"PPPM grid is too large");
 
     // global indices of PPPM grid range from 0 to N-1
     // nlo_in,nhi_in = lower/upper limits of the 3d sub-brick of
@@ -394,7 +391,7 @@ void PPPM::init()
     order--;
   }
 
-  if (order == 0) error->all("PPPM order has been reduced to 0");
+  if (order == 0) error->all(FLERR,"PPPM order has been reduced to 0");
 
   // decomposition of FFT mesh
   // global indices range from 0 to N-1
@@ -946,7 +943,7 @@ void PPPM::set_grid()
     g_ewald = gew2;
     fmid = diffpr(h_x,h_y,h_z,q2,acons);
 
-    if (f*fmid >= 0.0) error->all("Cannot compute PPPM G");
+    if (f*fmid >= 0.0) error->all(FLERR,"Cannot compute PPPM G");
     rtb = f < 0.0 ? (dgew=gew2-gew1,gew1) : (dgew=gew1-gew2,gew2);
     ncount = 0;
     while (fabs(dgew) > SMALL && fmid != 0.0) {
@@ -955,7 +952,7 @@ void PPPM::set_grid()
       fmid = diffpr(h_x,h_y,h_z,q2,acons);      
       if (fmid <= 0.0) rtb = g_ewald;
       ncount++;
-      if (ncount > LARGE) error->all("Cannot compute PPPM G");
+      if (ncount > LARGE) error->all(FLERR,"Cannot compute PPPM G");
     }
   }
 
@@ -1499,7 +1496,7 @@ void PPPM::particle_map()
 	nz+nlower < nzlo_out || nz+nupper > nzhi_out) flag = 1;
   }
 
-  if (flag) error->one("Out of range atoms - cannot compute PPPM");
+  if (flag) error->one(FLERR,"Out of range atoms - cannot compute PPPM");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/KSPACE/pppm_cg.cpp b/src/KSPACE/pppm_cg.cpp
index 74b29e46537d19b1357525f296e4f2296b86d773..12860f7aed9de8a7f6dc26143090e1c1430b3553 100644
--- a/src/KSPACE/pppm_cg.cpp
+++ b/src/KSPACE/pppm_cg.cpp
@@ -40,7 +40,7 @@ using namespace LAMMPS_NS;
 
 PPPMCG::PPPMCG(LAMMPS *lmp, int narg, char **arg) : PPPM(lmp, narg, arg)
 {
-  if ((narg < 1) || (narg > 2)) error->all("Illegal kspace_style pppm/cg command");
+  if ((narg < 1) || (narg > 2)) error->all(FLERR,"Illegal kspace_style pppm/cg command");
 
   if (narg == 2)
     smallq = atof(arg[1]);
@@ -232,7 +232,7 @@ void PPPMCG::particle_map()
 	nz+nlower < nzlo_out || nz+nupper > nzhi_out) flag = 1;
   }
 
-  if (flag) error->one("Out of range atoms - cannot compute PPPM");
+  if (flag) error->one(FLERR,"Out of range atoms - cannot compute PPPM");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/KSPACE/pppm_tip4p.cpp b/src/KSPACE/pppm_tip4p.cpp
index af0af92fad4dabec37963dfa0923f0799a82bb40..a191fa742ce95fc533c11e59065fbf7c662cb88b 100644
--- a/src/KSPACE/pppm_tip4p.cpp
+++ b/src/KSPACE/pppm_tip4p.cpp
@@ -82,7 +82,7 @@ void PPPMTIP4P::particle_map()
 
   int flag_all;
   MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_SUM,world);
-  if (flag_all) error->all("Out of range atoms - cannot compute PPPM");
+  if (flag_all) error->all(FLERR,"Out of range atoms - cannot compute PPPM");
 }
 
 /* ----------------------------------------------------------------------
@@ -253,9 +253,9 @@ void PPPMTIP4P::find_M(int i, int &iH1, int &iH2, double *xM)
   iH1 = atom->map(atom->tag[i] + 1);
   iH2 = atom->map(atom->tag[i] + 2);
 
-  if (iH1 == -1 || iH2 == -1) error->one("TIP4P hydrogen is missing");
+  if (iH1 == -1 || iH2 == -1) error->one(FLERR,"TIP4P hydrogen is missing");
   if (atom->type[iH1] != typeH || atom->type[iH2] != typeH)
-    error->one("TIP4P hydrogen has incorrect atom type");
+    error->one(FLERR,"TIP4P hydrogen has incorrect atom type");
 
   double **x = atom->x; 
 
diff --git a/src/KSPACE/remap_wrap.cpp b/src/KSPACE/remap_wrap.cpp
index 83631defe4fe10c464ea88133119010c9c9257c9..679c2a8365aeb6de4af220f5c9a58485a1e9f496 100644
--- a/src/KSPACE/remap_wrap.cpp
+++ b/src/KSPACE/remap_wrap.cpp
@@ -30,7 +30,7 @@ Remap::Remap(LAMMPS *lmp, MPI_Comm comm,
 			      in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi,
 			      out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi,
 			      nqty,permute,memory,precision);
-  if (plan == NULL) error->one("Could not create 3d remap plan");
+  if (plan == NULL) error->one(FLERR,"Could not create 3d remap plan");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/MANYBODY/fix_qeq_comb.cpp b/src/MANYBODY/fix_qeq_comb.cpp
index d1537f78bf1f30a487592f75865895db8d0512cb..7d36ee157e4c5aae23dd3e3d7bf8bbe8800cc2b5 100644
--- a/src/MANYBODY/fix_qeq_comb.cpp
+++ b/src/MANYBODY/fix_qeq_comb.cpp
@@ -32,14 +32,11 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 FixQEQComb::FixQEQComb(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
 {
-  if (narg < 5) error->all("Illegal fix qeq/comb command");
+  if (narg < 5) error->all(FLERR,"Illegal fix qeq/comb command");
 
   peratom_flag = 1;
   size_peratom_cols = 0;
@@ -49,7 +46,7 @@ FixQEQComb::FixQEQComb(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
   precision = force->numeric(arg[4]);
 
   if (nevery <= 0 || precision <= 0.0)
-    error->all("Illegal fix qeq/comb command");
+    error->all(FLERR,"Illegal fix qeq/comb command");
 
   MPI_Comm_rank(world,&me);
 
@@ -60,17 +57,17 @@ FixQEQComb::FixQEQComb(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
   int iarg = 5;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"file") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix qeq/comb command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix qeq/comb command");
       if (me == 0) {
 	fp = fopen(arg[iarg+1],"w");
 	if (fp == NULL) {
 	  char str[128];
 	  sprintf(str,"Cannot open fix qeq/comb file %s",arg[iarg+1]);
-	  error->one(str);
+	  error->one(FLERR,str);
 	}
       }
       iarg += 2;
-    } else error->all("Illegal fix qeq/comb command");
+    } else error->all(FLERR,"Illegal fix qeq/comb command");
   }
   
   nmax = atom->nmax;
@@ -111,16 +108,16 @@ int FixQEQComb::setmask()
 void FixQEQComb::init()
 {
   if (!atom->q_flag)
-    error->all("Fix qeq/comb requires atom attribute q");
+    error->all(FLERR,"Fix qeq/comb requires atom attribute q");
 
   comb = (PairComb *) force->pair_match("comb",1);
-  if (comb == NULL) error->all("Must use pair_style comb with fix qeq/comb");
+  if (comb == NULL) error->all(FLERR,"Must use pair_style comb with fix qeq/comb");
 
   if (strstr(update->integrate_style,"respa"))
     nlevels_respa = ((Respa *) update->integrate)->nlevels;
 
   ngroup = group->count(igroup);
-  if (ngroup == 0) error->all("Fix qeq/comb group has no atoms");
+  if (ngroup == 0) error->all(FLERR,"Fix qeq/comb group has no atoms");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/MANYBODY/pair_adp.cpp b/src/MANYBODY/pair_adp.cpp
index c2823c73e8fa8ad2ad04308ad6e58df5ec42c92b..0f6b0a6a9db24ff2a35c515be731e877cfa9c00d 100644
--- a/src/MANYBODY/pair_adp.cpp
+++ b/src/MANYBODY/pair_adp.cpp
@@ -31,9 +31,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define MAXLINE 1024
 
 /* ---------------------------------------------------------------------- */
@@ -423,7 +420,7 @@ void PairADP::allocate()
 
 void PairADP::settings(int narg, char **arg)
 {
-  if (narg > 0) error->all("Illegal pair_style command");
+  if (narg > 0) error->all(FLERR,"Illegal pair_style command");
 }
 
 /* ----------------------------------------------------------------------
@@ -438,12 +435,12 @@ void PairADP::coeff(int narg, char **arg)
   if (!allocated) allocate();
 
   if (narg != 3 + atom->ntypes)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   // insure I,J args are * *
 
   if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   // read ADP parameter file
 
@@ -472,7 +469,7 @@ void PairADP::coeff(int narg, char **arg)
     for (j = 0; j < setfl->nelements; j++)
       if (strcmp(arg[i],setfl->elements[j]) == 0) break;
     if (j < setfl->nelements) map[i-2] = j;
-    else error->all("No matching element in ADP potential file");
+    else error->all(FLERR,"No matching element in ADP potential file");
   }
 
   // clear setflag since coeff() called once with I,J = * *
@@ -496,7 +493,7 @@ void PairADP::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 
@@ -549,7 +546,7 @@ void PairADP::read_file(char *filename)
     if (fp == NULL) {
       char str[128];
       sprintf(str,"Cannot open ADP potential file %s",filename);
-      error->one(str);
+      error->one(FLERR,str);
     }
   }
 
@@ -570,7 +567,7 @@ void PairADP::read_file(char *filename)
   sscanf(line,"%d",&file->nelements);
   int nwords = atom->count_words(line);
   if (nwords != file->nelements + 1)
-    error->all("Incorrect element names in ADP potential file");
+    error->all(FLERR,"Incorrect element names in ADP potential file");
   
   char **words = new char*[file->nelements+1];
   nwords = 0;
diff --git a/src/MANYBODY/pair_airebo.cpp b/src/MANYBODY/pair_airebo.cpp
index 427495433c73902e11cd86eff54d267f181f446c..e8c623b47b565628147527fbe6106c47a6a6a63c 100644
--- a/src/MANYBODY/pair_airebo.cpp
+++ b/src/MANYBODY/pair_airebo.cpp
@@ -34,9 +34,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define MAXLINE 1024
 #define TOL 1.0e-9
 #define PGDELTA 1
@@ -135,7 +132,7 @@ void PairAIREBO::allocate()
 
 void PairAIREBO::settings(int narg, char **arg)
 {
-  if (narg != 1 && narg != 3) error->all("Illegal pair_style command");
+  if (narg != 1 && narg != 3) error->all(FLERR,"Illegal pair_style command");
 
   cutlj = force->numeric(arg[0]);
 
@@ -155,12 +152,12 @@ void PairAIREBO::coeff(int narg, char **arg)
   if (!allocated) allocate();
 
   if (narg != 3 + atom->ntypes)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   // insure I,J args are * *
 
   if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   // read args that map atom types to C and H
   // map[i] = which element (0,1) the Ith atom type is, -1 if NULL
@@ -173,7 +170,7 @@ void PairAIREBO::coeff(int narg, char **arg)
       map[i-2] = 0;
     } else if (strcmp(arg[i],"H") == 0) {
       map[i-2] = 1;
-    } else error->all("Incorrect args for pair coefficients");
+    } else error->all(FLERR,"Incorrect args for pair coefficients");
   }
 
   // read potential file and initialize fitting splines
@@ -198,7 +195,7 @@ void PairAIREBO::coeff(int narg, char **arg)
 	count++;
       }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -208,9 +205,9 @@ void PairAIREBO::coeff(int narg, char **arg)
 void PairAIREBO::init_style()
 {
   if (atom->tag_enable == 0)
-    error->all("Pair style AIREBO requires atom IDs");
+    error->all(FLERR,"Pair style AIREBO requires atom IDs");
   if (force->newton_pair == 0)
-    error->all("Pair style AIREBO requires newton pair on");
+    error->all(FLERR,"Pair style AIREBO requires newton pair on");
 
   // need a full neighbor list, including neighbors of ghosts
 
@@ -232,7 +229,7 @@ void PairAIREBO::init_style()
 
 double PairAIREBO::init_one(int i, int j)
 {
-  if (setflag[i][j] == 0) error->all("All pair coeffs are not set");
+  if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
 
   // convert to C,H types
 
@@ -371,7 +368,7 @@ void PairAIREBO::REBO_neigh()
     REBO_numneigh[i] = n;
     npnt += n;
     if (npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
   }
 }
 
@@ -3401,7 +3398,7 @@ void PairAIREBO::read_file(char *filename)
     if (fp == NULL) {
       char str[128];
       sprintf(str,"Cannot open AIREBO potential file %s",filename);
-      error->one(str);
+      error->one(FLERR,str);
     }
 
     // skip initial comment lines
diff --git a/src/MANYBODY/pair_comb.cpp b/src/MANYBODY/pair_comb.cpp
index 4b203731fd96d4808dd963f00c25d38b7caacbc5..5d0db94997b9101ff6614691364db58775a05f0a 100644
--- a/src/MANYBODY/pair_comb.cpp
+++ b/src/MANYBODY/pair_comb.cpp
@@ -417,7 +417,7 @@ void PairComb::allocate()
 
 void PairComb::settings(int narg, char **arg)
 {
-  if (narg > 0) error->all("Illegal pair_style command");
+  if (narg > 0) error->all(FLERR,"Illegal pair_style command");
 }
 
 /* ----------------------------------------------------------------------
@@ -431,12 +431,12 @@ void PairComb::coeff(int narg, char **arg)
   if (!allocated) allocate();
 
   if (narg != 3 + atom->ntypes)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   // insure I,J args are * *
 
   if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   // read args that map atom types to elements in potential file
   // map[i] = which element the Ith atom type is, -1 if NULL
@@ -502,7 +502,7 @@ void PairComb::coeff(int narg, char **arg)
 	count++;
       }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -512,11 +512,11 @@ void PairComb::coeff(int narg, char **arg)
 void PairComb::init_style()
 {
   if (atom->tag_enable == 0)
-    error->all("Pair style COMB requires atom IDs");
+    error->all(FLERR,"Pair style COMB requires atom IDs");
   if (force->newton_pair == 0)
-    error->all("Pair style COMB requires newton pair on");
+    error->all(FLERR,"Pair style COMB requires newton pair on");
   if (!atom->q_flag)
-    error->all("Pair style COMB requires atom attribute q");
+    error->all(FLERR,"Pair style COMB requires atom attribute q");
 
   // ptr to QEQ fix
 
@@ -538,7 +538,7 @@ void PairComb::init_style()
 
 double PairComb::init_one(int i, int j)
 {
-  if (setflag[i][j] == 0) error->all("All pair coeffs are not set");
+  if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
   return cutmax;
 }
 
@@ -561,7 +561,7 @@ void PairComb::read_file(char *file)
     if (fp == NULL) {
       char str[128];
       sprintf(str,"Cannot open COMB potential file %s",file);
-      error->one(str);
+      error->one(FLERR,str);
     }
   }
 
@@ -611,7 +611,7 @@ void PairComb::read_file(char *file)
     }
 
     if (nwords != params_per_line)
-      error->all("Incorrect format in COMB potential file");
+      error->all(FLERR,"Incorrect format in COMB potential file");
 
     // words = ptrs to all words in line
 
@@ -719,13 +719,13 @@ void PairComb::read_file(char *file)
 //	params[nparams].dj < 0.0 || params[nparams].dk < 0.0 || 
 //	params[nparams].dl < 0.0 || params[nparams].dm < 0.0 || 
 	params[nparams].esm1 < 0.0) 
-      error->all("Illegal COMB parameter");
+      error->all(FLERR,"Illegal COMB parameter");
 
     if (params[nparams].lam11 < params[nparams].lam21 || 
         params[nparams].lam12 < params[nparams].lam22 || 
 	params[nparams].biga1< params[nparams].bigb1 ||
 	params[nparams].biga2< params[nparams].bigb2)
-      error->all("Illegal COMB parameter");
+      error->all(FLERR,"Illegal COMB parameter");
 
     nparams++;
   }
@@ -753,11 +753,11 @@ void PairComb::setup()
 	for (m = 0; m < nparams; m++) {
 	  if (i == params[m].ielement && j == params[m].jelement && 
 	      k == params[m].kelement) {
-	    if (n >= 0) error->all("Potential file has duplicate entry");
+	    if (n >= 0) error->all(FLERR,"Potential file has duplicate entry");
 	    n = m;
 	  }
 	}
-	if (n < 0) error->all("Potential file is missing an entry");
+	if (n < 0) error->all(FLERR,"Potential file is missing an entry");
 	elem2param[i][j][k] = n;
       }
 
@@ -1779,14 +1779,14 @@ double PairComb::qfo_self(Param *param, double qi, double selfpot)
    // char str[128];
    // sprintf(str,"Pair COMB charge %.10f with force %.10f hit min barrier",
    // qi,self_d);
-   // error->warning(str,0);
+   // error->warning(FLERR,str,0);
    self_d += 4.0 * cmin * pow((qi-qmin),3);
  }
  if (qi > qmax) {
    // char str[128];
    // sprintf(str,"Pair COMB charge %.10f with force %.10f hit max barrier",
    //	   qi,self_d);
-   // error->warning(str,0);
+   // error->warning(FLERR,str,0);
    self_d += 4.0 * cmax * pow((qi-qmax),3);
  }
 
diff --git a/src/MANYBODY/pair_eam.cpp b/src/MANYBODY/pair_eam.cpp
index bc87ad4b851f6a7e0fb904af3a4078addd373fa3..39a8292bc15a8bd5c8f58829e7de8853d80fda29 100644
--- a/src/MANYBODY/pair_eam.cpp
+++ b/src/MANYBODY/pair_eam.cpp
@@ -30,9 +30,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define MAXLINE 1024
 
 /* ---------------------------------------------------------------------- */
@@ -332,7 +329,7 @@ void PairEAM::allocate()
 
 void PairEAM::settings(int narg, char **arg)
 {
-  if (narg > 0) error->all("Illegal pair_style command");
+  if (narg > 0) error->all(FLERR,"Illegal pair_style command");
 }
 
 /* ----------------------------------------------------------------------
@@ -344,7 +341,7 @@ void PairEAM::coeff(int narg, char **arg)
 {
   if (!allocated) allocate();
 
-  if (narg != 3) error->all("Incorrect args for pair coefficients");
+  if (narg != 3) error->all(FLERR,"Incorrect args for pair coefficients");
 
   // parse pair of atom types
 
@@ -384,7 +381,7 @@ void PairEAM::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -440,7 +437,7 @@ void PairEAM::read_file(char *filename)
     if (fptr == NULL) {
       char str[128];
       sprintf(str,"Cannot open EAM potential file %s",filename);
-      error->one(str);
+      error->one(FLERR,str);
     }
   }
 
diff --git a/src/MANYBODY/pair_eam_alloy.cpp b/src/MANYBODY/pair_eam_alloy.cpp
index 058402258653ad7a1293e772ea4facc363ce062b..5b6cd72f51420ff506d5c373cee867a19209df38 100644
--- a/src/MANYBODY/pair_eam_alloy.cpp
+++ b/src/MANYBODY/pair_eam_alloy.cpp
@@ -47,12 +47,12 @@ void PairEAMAlloy::coeff(int narg, char **arg)
   if (!allocated) allocate();
 
   if (narg != 3 + atom->ntypes)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   // insure I,J args are * *
 
   if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   // read EAM setfl file
 
@@ -79,7 +79,7 @@ void PairEAMAlloy::coeff(int narg, char **arg)
     for (j = 0; j < setfl->nelements; j++)
       if (strcmp(arg[i],setfl->elements[j]) == 0) break;
     if (j < setfl->nelements) map[i-2] = j;
-    else error->all("No matching element in EAM potential file");
+    else error->all(FLERR,"No matching element in EAM potential file");
   }
 
   // clear setflag since coeff() called once with I,J = * *
@@ -103,7 +103,7 @@ void PairEAMAlloy::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -125,7 +125,7 @@ void PairEAMAlloy::read_file(char *filename)
     if (fptr == NULL) {
       char str[128];
       sprintf(str,"Cannot open EAM potential file %s",filename);
-      error->one(str);
+      error->one(FLERR,str);
     }
   }
 
@@ -146,7 +146,7 @@ void PairEAMAlloy::read_file(char *filename)
   sscanf(line,"%d",&file->nelements);
   int nwords = atom->count_words(line);
   if (nwords != file->nelements + 1)
-    error->all("Incorrect element names in EAM potential file");
+    error->all(FLERR,"Incorrect element names in EAM potential file");
   
   char **words = new char*[file->nelements+1];
   nwords = 0;
diff --git a/src/MANYBODY/pair_eam_fs.cpp b/src/MANYBODY/pair_eam_fs.cpp
index ccd4d7e30dc7e5c518a468e84e181bc4a071a31e..0ac0768b9801b9f08ff07e49dfaf258e168402e6 100644
--- a/src/MANYBODY/pair_eam_fs.cpp
+++ b/src/MANYBODY/pair_eam_fs.cpp
@@ -47,12 +47,12 @@ void PairEAMFS::coeff(int narg, char **arg)
   if (!allocated) allocate();
 
   if (narg != 3 + atom->ntypes)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   // insure I,J args are * *
 
   if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   // read EAM Finnis-Sinclair file
 
@@ -79,7 +79,7 @@ void PairEAMFS::coeff(int narg, char **arg)
     for (j = 0; j < fs->nelements; j++)
       if (strcmp(arg[i],fs->elements[j]) == 0) break;
     if (j < fs->nelements) map[i-2] = j;
-    else error->all("No matching element in EAM potential file");
+    else error->all(FLERR,"No matching element in EAM potential file");
   }
 
   // clear setflag since coeff() called once with I,J = * *
@@ -103,7 +103,7 @@ void PairEAMFS::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -125,7 +125,7 @@ void PairEAMFS::read_file(char *filename)
     if (fptr == NULL) {
       char str[128];
       sprintf(str,"Cannot open EAM potential file %s",filename);
-      error->one(str);
+      error->one(FLERR,str);
     }
   }
 
@@ -146,7 +146,7 @@ void PairEAMFS::read_file(char *filename)
   sscanf(line,"%d",&file->nelements);
   int nwords = atom->count_words(line);
   if (nwords != file->nelements + 1)
-    error->all("Incorrect element names in EAM potential file");
+    error->all(FLERR,"Incorrect element names in EAM potential file");
   
   char **words = new char*[file->nelements+1];
   nwords = 0;
diff --git a/src/MANYBODY/pair_eim.cpp b/src/MANYBODY/pair_eim.cpp
index 07c2706c062e02ab6312f241ac96c983c56e029f..c8b324d264848fe3d41a5c82716bd76dfd4d20c9 100644
--- a/src/MANYBODY/pair_eim.cpp
+++ b/src/MANYBODY/pair_eim.cpp
@@ -30,9 +30,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define MAXLINE 1024
 
 /* ---------------------------------------------------------------------- */
@@ -344,7 +341,7 @@ void PairEIM::allocate()
 
 void PairEIM::settings(int narg, char **arg)
 {
-  if (narg > 0) error->all("Illegal pair_style command");
+  if (narg > 0) error->all(FLERR,"Illegal pair_style command");
 }
 
 /* ----------------------------------------------------------------------
@@ -357,12 +354,12 @@ void PairEIM::coeff(int narg, char **arg)
 
   if (!allocated) allocate();
 
-  if (narg < 5) error->all("Incorrect args for pair coefficients");
+  if (narg < 5) error->all(FLERR,"Incorrect args for pair coefficients");
 
   // insure I,J args are * *
 
   if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   // read EIM element names before filename
   // nelements = # of EIM elements to read from file
@@ -373,7 +370,7 @@ void PairEIM::coeff(int narg, char **arg)
     delete [] elements;
   }
   nelements = narg - 3 - atom->ntypes;
-  if (nelements < 1) error->all("Incorrect args for pair coefficients");
+  if (nelements < 1) error->all(FLERR,"Incorrect args for pair coefficients");
   elements = new char*[nelements];
   
   for (i = 0; i < nelements; i++) {
@@ -397,7 +394,7 @@ void PairEIM::coeff(int narg, char **arg)
       if (strcmp(arg[i],elements[j]) == 0) break;
     if (j < nelements) map[m] = j;
     else if (strcmp(arg[i],"NULL") == 0) map[m] = -1;
-    else error->all("Incorrect args for pair coefficients");
+    else error->all(FLERR,"Incorrect args for pair coefficients");
   }
 
   // clear setflag since coeff() called once with I,J = * *
@@ -419,7 +416,7 @@ void PairEIM::coeff(int narg, char **arg)
 	count++;
       }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -462,7 +459,7 @@ void PairEIM::read_file(char *filename)
     if (fptr == NULL) {
       char str[128];
       sprintf(str,"Cannot open EIM potential file %s",filename);
-      error->one(str);
+      error->one(FLERR,str);
     }
   }
 
@@ -491,7 +488,7 @@ void PairEIM::read_file(char *filename)
 
   if (me == 0)
     if (!grabglobal(fptr))
-      error->one("Could not grab global entry from EIM potential file");
+      error->one(FLERR,"Could not grab global entry from EIM potential file");
   MPI_Bcast(&setfl->division,1,MPI_DOUBLE,0,world);
   MPI_Bcast(&setfl->rbig,1,MPI_DOUBLE,0,world);
   MPI_Bcast(&setfl->rsmall,1,MPI_DOUBLE,0,world);
@@ -499,7 +496,7 @@ void PairEIM::read_file(char *filename)
   for (int i = 0; i < nelements; i++) {
     if (me == 0)
       if (!grabsingle(fptr,i))
-	error->one("Could not grab element entry from EIM potential file");
+	error->one(FLERR,"Could not grab element entry from EIM potential file");
     MPI_Bcast(&setfl->ielement[i],1,MPI_INT,0,world);
     MPI_Bcast(&setfl->mass[i],1,MPI_DOUBLE,0,world);
     MPI_Bcast(&setfl->negativity[i],1,MPI_DOUBLE,0,world);
@@ -517,7 +514,7 @@ void PairEIM::read_file(char *filename)
       else ij = nelements*(j+1) - (j+1)*(j+2)/2 + i;
       if (me == 0)
         if (grabpair(fptr,i,j) == 0)
-	  error->one("Could not grab pair entry from EIM potential file");
+	  error->one(FLERR,"Could not grab pair entry from EIM potential file");
       MPI_Bcast(&setfl->rcutphiA[ij],1,MPI_DOUBLE,0,world);
       MPI_Bcast(&setfl->rcutphiR[ij],1,MPI_DOUBLE,0,world);
       MPI_Bcast(&setfl->Eb[ij],1,MPI_DOUBLE,0,world);
diff --git a/src/MANYBODY/pair_rebo.cpp b/src/MANYBODY/pair_rebo.cpp
index 5a73f7bda08bf9051582d98005b9170b80558851..efda8c2c9e18d7f6fa0983bc0d38263f86ae8737 100644
--- a/src/MANYBODY/pair_rebo.cpp
+++ b/src/MANYBODY/pair_rebo.cpp
@@ -27,7 +27,7 @@ PairREBO::PairREBO(LAMMPS *lmp) : PairAIREBO(lmp) {}
 
 void PairREBO::settings(int narg, char **arg)
 {
-  if (narg != 0) error->all("Illegal pair_style command");
+  if (narg != 0) error->all(FLERR,"Illegal pair_style command");
 
   cutlj = 0.0;
   ljflag = torflag = 0;
diff --git a/src/MANYBODY/pair_sw.cpp b/src/MANYBODY/pair_sw.cpp
index c0661cc1a13f59a6029fe3753f6535a205ee9527..1c708564ac012de3114299e888652d79d369b55c 100755
--- a/src/MANYBODY/pair_sw.cpp
+++ b/src/MANYBODY/pair_sw.cpp
@@ -215,7 +215,7 @@ void PairSW::allocate()
 
 void PairSW::settings(int narg, char **arg)
 {
-  if (narg != 0) error->all("Illegal pair_style command");
+  if (narg != 0) error->all(FLERR,"Illegal pair_style command");
 }
 
 /* ----------------------------------------------------------------------
@@ -229,12 +229,12 @@ void PairSW::coeff(int narg, char **arg)
   if (!allocated) allocate();
 
   if (narg != 3 + atom->ntypes)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   // insure I,J args are * *
 
   if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   // read args that map atom types to elements in potential file
   // map[i] = which element the Ith atom type is, -1 if NULL
@@ -287,7 +287,7 @@ void PairSW::coeff(int narg, char **arg)
 	count++;
       }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -297,9 +297,9 @@ void PairSW::coeff(int narg, char **arg)
 void PairSW::init_style()
 {
   if (atom->tag_enable == 0)
-    error->all("Pair style Stillinger-Weber requires atom IDs");
+    error->all(FLERR,"Pair style Stillinger-Weber requires atom IDs");
   if (force->newton_pair == 0)
-    error->all("Pair style Stillinger-Weber requires newton pair on");
+    error->all(FLERR,"Pair style Stillinger-Weber requires newton pair on");
 
   // need a full neighbor list
 
@@ -314,7 +314,7 @@ void PairSW::init_style()
 
 double PairSW::init_one(int i, int j)
 {
-  if (setflag[i][j] == 0) error->all("All pair coeffs are not set");
+  if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
 
   return cutmax;
 }
@@ -338,7 +338,7 @@ void PairSW::read_file(char *file)
     if (fp == NULL) {
       char str[128];
       sprintf(str,"Cannot open Stillinger-Weber potential file %s",file);
-      error->one(str);
+      error->one(FLERR,str);
     }
   }
 
@@ -389,7 +389,7 @@ void PairSW::read_file(char *file)
     }
 
     if (nwords != params_per_line)
-      error->all("Incorrect format in Stillinger-Weber potential file");
+      error->all(FLERR,"Incorrect format in Stillinger-Weber potential file");
 
     // words = ptrs to all words in line
 
@@ -439,7 +439,7 @@ void PairSW::read_file(char *file)
 	params[nparams].gamma < 0.0 || params[nparams].biga < 0.0 || 
 	params[nparams].bigb < 0.0 || params[nparams].powerp < 0.0 ||
 	params[nparams].powerq < 0.0 || params[nparams].tol < 0.0)
-      error->all("Illegal Stillinger-Weber parameter");
+      error->all(FLERR,"Illegal Stillinger-Weber parameter");
 
     nparams++;
   }
@@ -468,11 +468,11 @@ void PairSW::setup()
 	for (m = 0; m < nparams; m++) {
 	  if (i == params[m].ielement && j == params[m].jelement && 
 	      k == params[m].kelement) {
-	    if (n >= 0) error->all("Potential file has duplicate entry");
+	    if (n >= 0) error->all(FLERR,"Potential file has duplicate entry");
 	    n = m;
 	  }
 	}
-	if (n < 0) error->all("Potential file is missing an entry");
+	if (n < 0) error->all(FLERR,"Potential file is missing an entry");
 	elem2param[i][j][k] = n;
       }
 
diff --git a/src/MANYBODY/pair_tersoff.cpp b/src/MANYBODY/pair_tersoff.cpp
index b6e8819406941a59159026bf05766d41dccd625d..bd50ec9bd322453befc42ea46262c27b0153b82e 100755
--- a/src/MANYBODY/pair_tersoff.cpp
+++ b/src/MANYBODY/pair_tersoff.cpp
@@ -256,7 +256,7 @@ void PairTersoff::allocate()
 
 void PairTersoff::settings(int narg, char **arg)
 {
-  if (narg != 0) error->all("Illegal pair_style command");
+  if (narg != 0) error->all(FLERR,"Illegal pair_style command");
 }
 
 /* ----------------------------------------------------------------------
@@ -270,12 +270,12 @@ void PairTersoff::coeff(int narg, char **arg)
   if (!allocated) allocate();
 
   if (narg != 3 + atom->ntypes)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   // insure I,J args are * *
 
   if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   // read args that map atom types to elements in potential file
   // map[i] = which element the Ith atom type is, -1 if NULL
@@ -328,7 +328,7 @@ void PairTersoff::coeff(int narg, char **arg)
 	count++;
       }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -338,9 +338,9 @@ void PairTersoff::coeff(int narg, char **arg)
 void PairTersoff::init_style()
 {
   if (atom->tag_enable == 0)
-    error->all("Pair style Tersoff requires atom IDs");
+    error->all(FLERR,"Pair style Tersoff requires atom IDs");
   if (force->newton_pair == 0)
-    error->all("Pair style Tersoff requires newton pair on");
+    error->all(FLERR,"Pair style Tersoff requires newton pair on");
 
   // need a full neighbor list
 
@@ -355,7 +355,7 @@ void PairTersoff::init_style()
 
 double PairTersoff::init_one(int i, int j)
 {
-  if (setflag[i][j] == 0) error->all("All pair coeffs are not set");
+  if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
 
   return cutmax;
 }
@@ -379,7 +379,7 @@ void PairTersoff::read_file(char *file)
     if (fp == NULL) {
       char str[128];
       sprintf(str,"Cannot open Tersoff potential file %s",file);
-      error->one(str);
+      error->one(FLERR,str);
     }
   }
 
@@ -429,7 +429,7 @@ void PairTersoff::read_file(char *file)
     }
 
     if (nwords != params_per_line)
-      error->all("Incorrect format in Tersoff potential file");
+      error->all(FLERR,"Incorrect format in Tersoff potential file");
 
     // words = ptrs to all words in line
 
@@ -490,7 +490,7 @@ void PairTersoff::read_file(char *file)
 	params[nparams].powerm - params[nparams].powermint != 0.0 ||
         (params[nparams].powermint != 3 && params[nparams].powermint != 1) ||
 	params[nparams].gamma < 0.0)
-      error->all("Illegal Tersoff parameter");
+      error->all(FLERR,"Illegal Tersoff parameter");
 
     nparams++;
   }
@@ -518,11 +518,11 @@ void PairTersoff::setup()
 	for (m = 0; m < nparams; m++) {
 	  if (i == params[m].ielement && j == params[m].jelement && 
 	      k == params[m].kelement) {
-	    if (n >= 0) error->all("Potential file has duplicate entry");
+	    if (n >= 0) error->all(FLERR,"Potential file has duplicate entry");
 	    n = m;
 	  }
 	}
-	if (n < 0) error->all("Potential file is missing an entry");
+	if (n < 0) error->all(FLERR,"Potential file is missing an entry");
 	elem2param[i][j][k] = n;
       }
 
diff --git a/src/MANYBODY/pair_tersoff_zbl.cpp b/src/MANYBODY/pair_tersoff_zbl.cpp
index dfa0da021e3384ae35ede4869ea8b6829f496a9b..90ccfd9c116abf1e78e7bb7ef8a00fdd098e6c88 100644
--- a/src/MANYBODY/pair_tersoff_zbl.cpp
+++ b/src/MANYBODY/pair_tersoff_zbl.cpp
@@ -54,7 +54,7 @@ PairTersoffZBL::PairTersoffZBL(LAMMPS *lmp) : PairTersoff(lmp)
     global_a_0 = 0.529;
     global_epsilon_0 = 0.00552635 * 0.043365121;
     global_e = 1.0;
-  } else error->all("Pair tersoff/zbl requires metal or real units");
+  } else error->all(FLERR,"Pair tersoff/zbl requires metal or real units");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -76,7 +76,7 @@ void PairTersoffZBL::read_file(char *file)
     if (fp == NULL) {
       char str[128];
       sprintf(str,"Cannot open Tersoff potential file %s",file);
-      error->one(str);
+      error->one(FLERR,str);
     }
   }
 
@@ -126,7 +126,7 @@ void PairTersoffZBL::read_file(char *file)
     }
 
     if (nwords != params_per_line)
-      error->all("Incorrect format in Tersoff potential file");
+      error->all(FLERR,"Incorrect format in Tersoff potential file");
 
     // words = ptrs to all words in line
 
@@ -195,7 +195,7 @@ void PairTersoffZBL::read_file(char *file)
 	params[nparams].gamma < 0.0 ||
 	params[nparams].Z_i < 1.0 || params[nparams].Z_j < 1.0 ||
 	params[nparams].ZBLcut < 0.0 || params[nparams].ZBLexpscale < 0.0)
-      error->all("Illegal Tersoff parameter");
+      error->all(FLERR,"Illegal Tersoff parameter");
 
     nparams++;
   }
diff --git a/src/MC/fix_bond_break.cpp b/src/MC/fix_bond_break.cpp
index a4c44338da0c75d65808a00729dc08fbd2cb0925..888c247da7296a83e0f7c5a4148121fd2f0f316a 100755
--- a/src/MC/fix_bond_break.cpp
+++ b/src/MC/fix_bond_break.cpp
@@ -29,20 +29,17 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 FixBondBreak::FixBondBreak(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 6) error->all("Illegal fix bond/break command");
+  if (narg < 6) error->all(FLERR,"Illegal fix bond/break command");
 
   MPI_Comm_rank(world,&me);
 
   nevery = atoi(arg[3]);
-  if (nevery <= 0) error->all("Illegal fix bond/break command");
+  if (nevery <= 0) error->all(FLERR,"Illegal fix bond/break command");
 
   force_reneighbor = 1;
   next_reneighbor = -1;
@@ -55,8 +52,8 @@ FixBondBreak::FixBondBreak(LAMMPS *lmp, int narg, char **arg) :
   double cutoff = atof(arg[5]);
 
   if (btype < 1 || btype > atom->nbondtypes)
-    error->all("Invalid bond type in fix bond/break command");
-  if (cutoff < 0.0) error->all("Illegal fix bond/break command");
+    error->all(FLERR,"Invalid bond type in fix bond/break command");
+  if (cutoff < 0.0) error->all(FLERR,"Illegal fix bond/break command");
 
   cutsq = cutoff*cutoff;
 
@@ -68,20 +65,20 @@ FixBondBreak::FixBondBreak(LAMMPS *lmp, int narg, char **arg) :
   int iarg = 6;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"prob") == 0) {
-      if (iarg+3 > narg) error->all("Illegal fix bond/break command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal fix bond/break command");
       fraction = atof(arg[iarg+1]);
       seed = atoi(arg[iarg+2]);
       if (fraction < 0.0 || fraction > 1.0)
-	error->all("Illegal fix bond/break command");
-      if (seed <= 0) error->all("Illegal fix bond/break command");
+	error->all(FLERR,"Illegal fix bond/break command");
+      if (seed <= 0) error->all(FLERR,"Illegal fix bond/break command");
       iarg += 3;
-    } else error->all("Illegal fix bond/break command");
+    } else error->all(FLERR,"Illegal fix bond/break command");
   }
 
   // error check
 
   if (atom->molecular == 0)
-    error->all("Cannot use fix bond/break with non-molecular systems");
+    error->all(FLERR,"Cannot use fix bond/break with non-molecular systems");
 
   // initialize Marsaglia RNG with processor-unique seed
 
@@ -137,13 +134,13 @@ void FixBondBreak::init()
       force->special_lj[3] != 1.0) flag = 1;
   if (force->special_coul[1] != 0.0 || force->special_coul[2] != 1.0 ||
       force->special_coul[3] != 1.0) flag = 1;
-  if (flag) error->all("Fix bond/break requires special_bonds = 0,1,1");
+  if (flag) error->all(FLERR,"Fix bond/break requires special_bonds = 0,1,1");
 
   // warn if angles, dihedrals, impropers are being used
 
   if (force->angle || force->dihedral || force->improper) {
     if (me == 0) 
-      error->warning("Broken bonds will not alter angles, "
+      error->warning(FLERR,"Broken bonds will not alter angles, "
 		     "dihedrals, or impropers");
   }
 
diff --git a/src/MC/fix_bond_create.cpp b/src/MC/fix_bond_create.cpp
index 295f04981bbf048449b953637874f16f78ae6408..042ff80dbc666f94fc7596a90de92825fc785aa5 100755
--- a/src/MC/fix_bond_create.cpp
+++ b/src/MC/fix_bond_create.cpp
@@ -33,20 +33,17 @@ using namespace LAMMPS_NS;
 
 #define BIG 1.0e20
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 8) error->all("Illegal fix bond/create command");
+  if (narg < 8) error->all(FLERR,"Illegal fix bond/create command");
 
   MPI_Comm_rank(world,&me);
 
   nevery = atoi(arg[3]);
-  if (nevery <= 0) error->all("Illegal fix bond/create command");
+  if (nevery <= 0) error->all(FLERR,"Illegal fix bond/create command");
 
   force_reneighbor = 1;
   next_reneighbor = -1;
@@ -62,10 +59,10 @@ FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) :
 
   if (iatomtype < 1 || iatomtype > atom->ntypes || 
       jatomtype < 1 || jatomtype > atom->ntypes)
-    error->all("Invalid atom type in fix bond/create command");
-  if (cutoff < 0.0) error->all("Illegal fix bond/create command");
+    error->all(FLERR,"Invalid atom type in fix bond/create command");
+  if (cutoff < 0.0) error->all(FLERR,"Illegal fix bond/create command");
   if (btype < 1 || btype > atom->nbondtypes)
-    error->all("Invalid bond type in fix bond/create command");
+    error->all(FLERR,"Invalid bond type in fix bond/create command");
 
   cutsq = cutoff*cutoff;
 
@@ -81,39 +78,39 @@ FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) :
   int iarg = 8;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"iparam") == 0) {
-      if (iarg+3 > narg) error->all("Illegal fix bond/create command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal fix bond/create command");
       imaxbond = atoi(arg[iarg+1]);
       inewtype = atoi(arg[iarg+2]);
-      if (imaxbond < 0) error->all("Illegal fix bond/create command");
+      if (imaxbond < 0) error->all(FLERR,"Illegal fix bond/create command");
       if (inewtype < 1 || inewtype > atom->ntypes)
-	error->all("Invalid atom type in fix bond/create command");
+	error->all(FLERR,"Invalid atom type in fix bond/create command");
       iarg += 3;
     } else if (strcmp(arg[iarg],"jparam") == 0) {
-      if (iarg+3 > narg) error->all("Illegal fix bond/create command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal fix bond/create command");
       jmaxbond = atoi(arg[iarg+1]);
       jnewtype = atoi(arg[iarg+2]);
-      if (jmaxbond < 0) error->all("Illegal fix bond/create command");
+      if (jmaxbond < 0) error->all(FLERR,"Illegal fix bond/create command");
       if (jnewtype < 1 || jnewtype > atom->ntypes)
-	error->all("Invalid atom type in fix bond/create command");
+	error->all(FLERR,"Invalid atom type in fix bond/create command");
       iarg += 3;
     } else if (strcmp(arg[iarg],"prob") == 0) {
-      if (iarg+3 > narg) error->all("Illegal fix bond/create command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal fix bond/create command");
       fraction = atof(arg[iarg+1]);
       seed = atoi(arg[iarg+2]);
       if (fraction < 0.0 || fraction > 1.0)
-	error->all("Illegal fix bond/create command");
-      if (seed <= 0) error->all("Illegal fix bond/create command");
+	error->all(FLERR,"Illegal fix bond/create command");
+      if (seed <= 0) error->all(FLERR,"Illegal fix bond/create command");
       iarg += 3;
-    } else error->all("Illegal fix bond/create command");
+    } else error->all(FLERR,"Illegal fix bond/create command");
   }
 
   // error check
 
   if (atom->molecular == 0)
-    error->all("Cannot use fix bond/create with non-molecular systems");
+    error->all(FLERR,"Cannot use fix bond/create with non-molecular systems");
   if (iatomtype == jatomtype && 
       ((imaxbond != jmaxbond) || (inewtype != jnewtype)))
-    error->all("Inconsistent iparam/jparam values in fix bond/create command");
+    error->all(FLERR,"Inconsistent iparam/jparam values in fix bond/create command");
 
   // initialize Marsaglia RNG with processor-unique seed
 
@@ -179,24 +176,24 @@ void FixBondCreate::init()
   // check cutoff for iatomtype,jatomtype
 
   if (force->pair == NULL || cutsq > force->pair->cutsq[iatomtype][jatomtype]) 
-    error->all("Fix bond/create cutoff is longer than pairwise cutoff");
+    error->all(FLERR,"Fix bond/create cutoff is longer than pairwise cutoff");
   
   // require special bonds = 0,1,1
 
   if (force->special_lj[1] != 0.0 || force->special_lj[2] != 1.0 ||
       force->special_lj[3] != 1.0)
-    error->all("Fix bond/create requires special_bonds lj = 0,1,1");
+    error->all(FLERR,"Fix bond/create requires special_bonds lj = 0,1,1");
 
   if (atom->q_flag)
     if (force->special_coul[1] != 0.0 || force->special_coul[2] != 1.0 ||
 	force->special_coul[3] != 1.0)
-      error->all("Fix bond/create requires special_bonds coul = 0,1,1");
+      error->all(FLERR,"Fix bond/create requires special_bonds coul = 0,1,1");
 
   // warn if angles, dihedrals, impropers are being used
 
   if (force->angle || force->dihedral || force->improper) {
     if (me == 0) 
-      error->warning("Created bonds will not create angles, "
+      error->warning(FLERR,"Created bonds will not create angles, "
 		     "dihedrals, or impropers");
   }
 
@@ -251,7 +248,7 @@ void FixBondCreate::setup(int vflag)
 	if (newton_bond) {
 	  m = atom->map(bond_atom[i][j]);
 	  if (m < 0)
-	    error->one("Could not count initial bonds in fix bond/create");
+	    error->one(FLERR,"Could not count initial bonds in fix bond/create");
 	  bondcount[m]++;
 	}
       }
@@ -411,7 +408,7 @@ void FixBondCreate::post_integrate()
 
     if (!newton_bond || tag[i] < tag[j]) {
       if (num_bond[i] == atom->bond_per_atom)
-	error->one("New bond exceeded bonds per atom in fix bond/create");
+	error->one(FLERR,"New bond exceeded bonds per atom in fix bond/create");
       bond_type[i][num_bond[i]] = btype;
       bond_atom[i][num_bond[i]] = tag[j];
       num_bond[i]++;
@@ -424,7 +421,7 @@ void FixBondCreate::post_integrate()
     n1 = nspecial[i][0];
     n3 = nspecial[i][2];
     if (n3 == atom->maxspecial)
-      error->one("New bond exceeded special list size in fix bond/create");
+      error->one(FLERR,"New bond exceeded special list size in fix bond/create");
     for (m = n3; m > n1; m--) slist[m+1] = slist[m];
     slist[n1] = tag[j];
     nspecial[i][0]++;
diff --git a/src/MC/fix_bond_swap.cpp b/src/MC/fix_bond_swap.cpp
index daf9b13501df6bedcea49df611a6beb78d774125..1984f9f40b3eb69ba48f402ea100466b569d3281 100644
--- a/src/MC/fix_bond_swap.cpp
+++ b/src/MC/fix_bond_swap.cpp
@@ -41,7 +41,7 @@ using namespace LAMMPS_NS;
 FixBondSwap::FixBondSwap(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg != 6) error->all("Illegal fix bond/swap command");
+  if (narg != 6) error->all(FLERR,"Illegal fix bond/swap command");
 
   vector_flag = 1;
   size_vector = 2;
@@ -111,11 +111,11 @@ void FixBondSwap::init()
   // require an atom style with molecule IDs
 
   if (atom->molecule == NULL)
-    error->all("Must use atom style with molecule IDs with fix bond/swap");
+    error->all(FLERR,"Must use atom style with molecule IDs with fix bond/swap");
 
   int icompute = modify->find_compute(id_temp);
   if (icompute < 0) 
-    error->all("Temperature ID for fix bond/swap does not exist");
+    error->all(FLERR,"Temperature ID for fix bond/swap does not exist");
   temperature = modify->compute[icompute];
 
   // pair and bonds must be defined
@@ -123,20 +123,20 @@ void FixBondSwap::init()
   // special bonds must be 0 1 1
 
   if (force->pair == NULL || force->bond == NULL)
-    error->all("Fix bond/swap requires pair and bond styles");
+    error->all(FLERR,"Fix bond/swap requires pair and bond styles");
 
   if (force->pair->single_enable == 0)
-    error->all("Pair style does not support fix bond/swap");
+    error->all(FLERR,"Pair style does not support fix bond/swap");
 
   if (force->angle == NULL && atom->nangles > 0 && comm->me == 0)
-    error->warning("Fix bond/swap will ignore defined angles");
+    error->warning(FLERR,"Fix bond/swap will ignore defined angles");
 
   if (force->dihedral || force->improper)
-    error->all("Fix bond/swap cannot use dihedral or improper styles");
+    error->all(FLERR,"Fix bond/swap cannot use dihedral or improper styles");
 
   if (force->special_lj[1] != 0.0 || force->special_lj[2] != 1.0 ||
       force->special_lj[3] != 1.0)
-    error->all("Fix bond/swap requires special_bonds = 0,1,1");
+    error->all(FLERR,"Fix bond/swap requires special_bonds = 0,1,1");
 
   // need a half neighbor list, built when ever re-neighboring occurs
 
@@ -596,7 +596,7 @@ void FixBondSwap::pre_neighbor()
 int FixBondSwap::modify_param(int narg, char **arg)
 {
   if (strcmp(arg[0],"temp") == 0) {
-    if (narg < 2) error->all("Illegal fix_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
     if (tflag) {
       modify->delete_compute(id_temp);
       tflag = 0;
@@ -607,13 +607,13 @@ int FixBondSwap::modify_param(int narg, char **arg)
     strcpy(id_temp,arg[1]);
 
     int icompute = modify->find_compute(id_temp);
-    if (icompute < 0) error->all("Could not find fix_modify temperature ID");
+    if (icompute < 0) error->all(FLERR,"Could not find fix_modify temperature ID");
     temperature = modify->compute[icompute];
 
     if (temperature->tempflag == 0)
-      error->all("Fix_modify temperature ID does not compute temperature");
+      error->all(FLERR,"Fix_modify temperature ID does not compute temperature");
     if (temperature->igroup != igroup && comm->me == 0)
-      error->warning("Group for fix_modify temp != fix group");
+      error->warning(FLERR,"Group for fix_modify temp != fix group");
     return 2;
   }
   return 0;
diff --git a/src/MC/fix_gcmc.cpp b/src/MC/fix_gcmc.cpp
index 9f3dfc5e82c0f8ab0521a747fc7671637683893d..9016a26b28765cdd679d360fd5f0039831c40566 100644
--- a/src/MC/fix_gcmc.cpp
+++ b/src/MC/fix_gcmc.cpp
@@ -40,7 +40,7 @@ using namespace LAMMPS_NS;
 FixGCMC::FixGCMC(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 11) error->all("Illegal fix GCMC command");
+  if (narg < 11) error->all(FLERR,"Illegal fix GCMC command");
 
   vector_flag = 1;
   size_vector = 6;
@@ -61,12 +61,12 @@ FixGCMC::FixGCMC(LAMMPS *lmp, int narg, char **arg) :
   displace = atof(arg[10]);
 
   if (ntype <= 0 || ntype > atom->ntypes) 
-    error->all("Invalid atom type in fix GCMC command");
-  if (nexchanges < 0) error->all("Illegal fix GCMC command");
-  if (nmcmoves < 0) error->all("Illegal fix GCMC command");
-  if (seed <= 0) error->all("Illegal fix GCMC command");
-  if (reservoir_temperature < 0.0) error->all("Illegal fix GCMC command");  
-  if (displace < 0.0) error->all("Illegal fix GCMC command"); 
+    error->all(FLERR,"Invalid atom type in fix GCMC command");
+  if (nexchanges < 0) error->all(FLERR,"Illegal fix GCMC command");
+  if (nmcmoves < 0) error->all(FLERR,"Illegal fix GCMC command");
+  if (seed <= 0) error->all(FLERR,"Illegal fix GCMC command");
+  if (reservoir_temperature < 0.0) error->all(FLERR,"Illegal fix GCMC command");  
+  if (displace < 0.0) error->all(FLERR,"Illegal fix GCMC command"); 
 
   // compute beta, lambda, sigma, and the zz factor
   
@@ -157,7 +157,7 @@ void FixGCMC::init()
     MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
 
     if (flagall)
-      error->all("Cannot do GCMC on atoms in atom_modify first group");
+      error->all(FLERR,"Cannot do GCMC on atoms in atom_modify first group");
   }
 
   // if molflag not set, warn if any deletable atom has a mol ID
@@ -173,16 +173,16 @@ void FixGCMC::init()
     int flagall;
     MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
     if (flagall && comm->me == 0)
-      error->warning("Fix GCMC may delete atom with non-zero molecule ID");
+      error->warning(FLERR,"Fix GCMC may delete atom with non-zero molecule ID");
   }
 
   if (molflag && atom->molecule_flag == 0)
-      error->all("Fix GCMC molecule command requires atom attribute molecule");
+      error->all(FLERR,"Fix GCMC molecule command requires atom attribute molecule");
       
-  if (molflag != 0) error->all("Fix GCMC molecule feature does not yet work"); 
+  if (molflag != 0) error->all(FLERR,"Fix GCMC molecule feature does not yet work"); 
   
   if (force->pair->single_enable == 0) 
-    error->all("Fix GCMC incompatible with given pair_style");
+    error->all(FLERR,"Fix GCMC incompatible with given pair_style");
 }
 
 /* ----------------------------------------------------------------------
@@ -485,17 +485,17 @@ double FixGCMC::energy(int i, double *coord)
 
 void FixGCMC::options(int narg, char **arg)
 {
-  if (narg < 0) error->all("Illegal fix GCMC command");
+  if (narg < 0) error->all(FLERR,"Illegal fix GCMC command");
 
   int iarg = 0;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"molecule") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix GCMC command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix GCMC command");
       if (strcmp(arg[iarg+1],"no") == 0) molflag = 0;
       else if (strcmp(arg[iarg+1],"yes") == 0) molflag = 1;
-      else error->all("Illegal fix evaporate command");
+      else error->all(FLERR,"Illegal fix evaporate command");
       iarg += 2;
-    } else error->all("Illegal fix GCMC command");
+    } else error->all(FLERR,"Illegal fix GCMC command");
   }
 }
 
diff --git a/src/MC/pair_dsmc.cpp b/src/MC/pair_dsmc.cpp
index b04dd8f6d7432ce8e8d12593ba56296e66367592..39a0f50133f322bfa0bd2a62a5c4139c30af4d5d 100644
--- a/src/MC/pair_dsmc.cpp
+++ b/src/MC/pair_dsmc.cpp
@@ -32,9 +32,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairDSMC::PairDSMC(LAMMPS *lmp) : Pair(lmp)
@@ -157,9 +154,9 @@ void PairDSMC::compute(int eflag, int vflag)
 	  convert_double_to_equivalent_int(num_of_collisions_double);
 
         if (num_of_collisions > number_of_A) 
-	  error->warning("Pair dsmc: num_of_collisions > number_of_A",0);
+	  error->warning(FLERR,"Pair dsmc: num_of_collisions > number_of_A",0);
         if (num_of_collisions > number_of_B) 
-	  error->warning("Pair dsmc: num_of_collisions > number_of_B",0);
+	  error->warning(FLERR,"Pair dsmc: num_of_collisions > number_of_B",0);
 
         // perform collisions on pairs of particles in icell
 
@@ -208,7 +205,7 @@ void PairDSMC::allocate()
 
 void PairDSMC::settings(int narg, char **arg)
 {
-  if (narg != 6) error->all("Illegal pair_style command");
+  if (narg != 6) error->all(FLERR,"Illegal pair_style command");
 
   cut_global = 0.0;
   max_cell_size = force->numeric(arg[0]);
@@ -220,8 +217,8 @@ void PairDSMC::settings(int narg, char **arg)
 
   // initialize Marsaglia RNG with processor-unique seed
 
-  if (max_cell_size <= 0.0) error->all("Illegal pair_style command");
-  if (seed <= 0) error->all("Illegal pair_style command");
+  if (max_cell_size <= 0.0) error->all(FLERR,"Illegal pair_style command");
+  if (seed <= 0) error->all(FLERR,"Illegal pair_style command");
   if (random) delete random;
   random = new RanMars(lmp,seed + comm->me);
 
@@ -243,7 +240,7 @@ void PairDSMC::settings(int narg, char **arg)
 
 void PairDSMC::coeff(int narg, char **arg)
 {
-  if (narg < 3 || narg > 4) error->all("Incorrect args for pair coefficients");
+  if (narg < 3 || narg > 4) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -265,7 +262,7 @@ void PairDSMC::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -518,7 +515,7 @@ void PairDSMC::scatter_random(int i, int j, int icell)
 int PairDSMC::convert_double_to_equivalent_int(double input_double)
 {
   if (input_double > INT_MAX)
-    error->all("Tried to convert a double to int, but input_double > INT_MAX");
+    error->all(FLERR,"Tried to convert a double to int, but input_double > INT_MAX");
 
   int output_int = static_cast<int>(input_double + random->uniform());
   return output_int;
diff --git a/src/MEAM/pair_meam.cpp b/src/MEAM/pair_meam.cpp
index 7c6fd9dbb2af7c9792afc91254f302d2e7891d9e..370a719a2eb7551739a5117096dd82762214601a 100644
--- a/src/MEAM/pair_meam.cpp
+++ b/src/MEAM/pair_meam.cpp
@@ -32,9 +32,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define MAXLINE 1024
 
 enum{FCC,BCC,HCP,DIM,DIAMOND,B1,C11,L12,B2};
@@ -247,7 +244,7 @@ void PairMEAM::compute(int eflag, int vflag)
     if (errorflag) {
       char str[128];
       sprintf(str,"MEAM library error %d",errorflag);
-      error->one(str);
+      error->one(FLERR,str);
     }
     offset += numneigh_half[i];
   }
@@ -262,7 +259,7 @@ void PairMEAM::compute(int eflag, int vflag)
   if (errorflag) {
     char str[128];
     sprintf(str,"MEAM library error %d",errorflag);
-    error->one(str);
+    error->one(FLERR,str);
   }
 
   comm->forward_comm_pair(this);
@@ -290,7 +287,7 @@ void PairMEAM::compute(int eflag, int vflag)
     if (errorflag) {
       char str[128];
       sprintf(str,"MEAM library error %d",errorflag);
-      error->one(str);
+      error->one(FLERR,str);
     }
     offset += numneigh_half[i];
   }
@@ -323,7 +320,7 @@ void PairMEAM::allocate()
 
 void PairMEAM::settings(int narg, char **arg)
 {
-  if (narg != 0) error->all("Illegal pair_style command");
+  if (narg != 0) error->all(FLERR,"Illegal pair_style command");
 }
 
 /* ----------------------------------------------------------------------
@@ -336,12 +333,12 @@ void PairMEAM::coeff(int narg, char **arg)
 
   if (!allocated) allocate();
 
-  if (narg < 6) error->all("Incorrect args for pair coefficients");
+  if (narg < 6) error->all(FLERR,"Incorrect args for pair coefficients");
 
   // insure I,J args are * *
 
   if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   // read MEAM element names between 2 filenames
   // nelements = # of MEAM elements
@@ -353,7 +350,7 @@ void PairMEAM::coeff(int narg, char **arg)
     delete [] mass;
   }
   nelements = narg - 4 - atom->ntypes;
-  if (nelements < 1) error->all("Incorrect args for pair coefficients");
+  if (nelements < 1) error->all(FLERR,"Incorrect args for pair coefficients");
   elements = new char*[nelements];
   mass = new double[nelements];
   
@@ -379,7 +376,7 @@ void PairMEAM::coeff(int narg, char **arg)
       if (strcmp(arg[i],elements[j]) == 0) break;
     if (j < nelements) map[m] = j;
     else if (strcmp(arg[i],"NULL") == 0) map[m] = -1;
-    else error->all("Incorrect args for pair coefficients");
+    else error->all(FLERR,"Incorrect args for pair coefficients");
   }
 
   // clear setflag since coeff() called once with I,J = * *
@@ -401,7 +398,7 @@ void PairMEAM::coeff(int narg, char **arg)
 	count++;
       }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -411,7 +408,7 @@ void PairMEAM::coeff(int narg, char **arg)
 void PairMEAM::init_style()
 {
   if (force->newton_pair == 0)
-    error->all("Pair style MEAM requires newton pair on");
+    error->all(FLERR,"Pair style MEAM requires newton pair on");
 
   // need full and half neighbor list
 
@@ -464,7 +461,7 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
     if (fp == NULL) {
       char str[128];
       sprintf(str,"Cannot open MEAM potential file %s",globalfile);
-      error->one(str);
+      error->one(FLERR,str);
     }
   }
 
@@ -544,7 +541,7 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
     }
 
     if (nwords != params_per_line)
-      error->all("Incorrect format in MEAM potential file");
+      error->all(FLERR,"Incorrect format in MEAM potential file");
 
     // words = ptrs to all words in line
     // strip single and double quotes from words
@@ -571,7 +568,7 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
     else if (strcmp(words[1],"hcp") == 0) lat[i] = HCP;
     else if (strcmp(words[1],"dim") == 0) lat[i] = DIM;
     else if (strcmp(words[1],"dia") == 0) lat[i] = DIAMOND;
-    else error->all("Unrecognized lattice type in MEAM file 1");
+    else error->all(FLERR,"Unrecognized lattice type in MEAM file 1");
 
     // store parameters
 
@@ -599,7 +596,7 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
   // error if didn't find all elements in file
 
   if (nset != nelements)
-    error->all("Did not find all elements in MEAM library file");
+    error->all(FLERR,"Did not find all elements in MEAM library file");
 
   // pass element parameters to MEAM package
 
@@ -645,7 +642,7 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
     if (fp == NULL) {
       char str[128];
       sprintf(str,"Cannot open MEAM potential file %s",userfile);
-      error->one(str);
+      error->one(FLERR,str);
     }
   }
 
@@ -695,7 +692,7 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
       char str[128];
       sprintf(str,"Keyword %s in MEAM parameter file not recognized",
 	      params[0]);
-      error->all(str);
+      error->all(FLERR,str);
     }
     nindex = nparams - 2;
     for (i = 0; i < nindex; i++) index[i] = atoi(params[i+1]);
@@ -712,7 +709,7 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
       else if (strcmp(params[nparams-1],"c11") == 0) value = C11;
       else if (strcmp(params[nparams-1],"l12") == 0) value = L12;
       else if (strcmp(params[nparams-1],"b2")  == 0) value = B2;
-      else error->all("Unrecognized lattice type in MEAM file 2");
+      else error->all(FLERR,"Unrecognized lattice type in MEAM file 2");
     }
     else value = atof(params[nparams-1]);
 
@@ -723,7 +720,7 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
     if (errorflag) {
       char str[128];
       sprintf(str,"MEAM library error %d",errorflag);
-      error->all(str);
+      error->all(FLERR,str);
     }
   }
 
diff --git a/src/MOLECULE/angle_charmm.cpp b/src/MOLECULE/angle_charmm.cpp
index a0b0fc97081ed478ae4536a64845c7ca59f2cafc..5dd81580ccde3dc146538d7c429c23b0d3d03d2f 100644
--- a/src/MOLECULE/angle_charmm.cpp
+++ b/src/MOLECULE/angle_charmm.cpp
@@ -193,7 +193,7 @@ void AngleCharmm::allocate()
 
 void AngleCharmm::coeff(int narg, char **arg)
 {
-  if (narg != 5) error->all("Incorrect args for angle coefficients");
+  if (narg != 5) error->all(FLERR,"Incorrect args for angle coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -216,7 +216,7 @@ void AngleCharmm::coeff(int narg, char **arg)
     count++;
   }
 
-  if (count == 0) error->all("Incorrect args for angle coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for angle coefficients");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/MOLECULE/angle_cosine.cpp b/src/MOLECULE/angle_cosine.cpp
index 771093af6b16b502bb7f65ef9b4cbdf05ae5919c..6c6fa4fc87b357d3aa94dabb81487a25b5960ae4 100644
--- a/src/MOLECULE/angle_cosine.cpp
+++ b/src/MOLECULE/angle_cosine.cpp
@@ -152,7 +152,7 @@ void AngleCosine::allocate()
 
 void AngleCosine::coeff(int narg, char **arg)
 {
-  if (narg != 2) error->all("Incorrect args for angle coefficients");
+  if (narg != 2) error->all(FLERR,"Incorrect args for angle coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -167,7 +167,7 @@ void AngleCosine::coeff(int narg, char **arg)
     count++;
   }
 
-  if (count == 0) error->all("Incorrect args for angle coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for angle coefficients");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/MOLECULE/angle_cosine_periodic.cpp b/src/MOLECULE/angle_cosine_periodic.cpp
index 4d2bd58919384cf3240ef6f76807821ba75f36e2..d401c1fffc0233f35551f7b2034f72bbc22981c7 100644
--- a/src/MOLECULE/angle_cosine_periodic.cpp
+++ b/src/MOLECULE/angle_cosine_periodic.cpp
@@ -199,7 +199,7 @@ void AngleCosinePeriodic::allocate()
 
 void AngleCosinePeriodic::coeff(int narg, char **arg)
 {
-  if (narg != 4) error->all("Incorrect args for angle coefficients");
+  if (narg != 4) error->all(FLERR,"Incorrect args for angle coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -208,7 +208,7 @@ void AngleCosinePeriodic::coeff(int narg, char **arg)
   double c_one = atof(arg[1]);
   int b_one = atoi(arg[2]);
   int n_one = atoi(arg[3]);
-  if (n_one <= 0) error->all("Incorrect args for angle coefficients");
+  if (n_one <= 0) error->all(FLERR,"Incorrect args for angle coefficients");
 
   int count = 0;
   for (int i = ilo; i <= ihi; i++) {
@@ -219,7 +219,7 @@ void AngleCosinePeriodic::coeff(int narg, char **arg)
     count++;
   }
 
-  if (count == 0) error->all("Incorrect args for angle coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for angle coefficients");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/MOLECULE/angle_cosine_squared.cpp b/src/MOLECULE/angle_cosine_squared.cpp
index caaf44db5eafc300965339e3c62c3225e51dc17c..926270067991fde898ac6e168bc3ffe0890dcd06 100644
--- a/src/MOLECULE/angle_cosine_squared.cpp
+++ b/src/MOLECULE/angle_cosine_squared.cpp
@@ -164,7 +164,7 @@ void AngleCosineSquared::allocate()
 
 void AngleCosineSquared::coeff(int narg, char **arg)
 {
-  if (narg != 3) error->all("Incorrect args for angle coefficients");
+  if (narg != 3) error->all(FLERR,"Incorrect args for angle coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -183,7 +183,7 @@ void AngleCosineSquared::coeff(int narg, char **arg)
     count++;
   }
 
-  if (count == 0) error->all("Incorrect args for angle coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for angle coefficients");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/MOLECULE/angle_harmonic.cpp b/src/MOLECULE/angle_harmonic.cpp
index 20fa892cee505f8b8f8116488c5d6d2abd81e4a5..e3def974998ff98e723a52361a50b6c2b1893b7f 100644
--- a/src/MOLECULE/angle_harmonic.cpp
+++ b/src/MOLECULE/angle_harmonic.cpp
@@ -164,7 +164,7 @@ void AngleHarmonic::allocate()
 
 void AngleHarmonic::coeff(int narg, char **arg)
 {
-  if (narg != 3) error->all("Incorrect args for angle coefficients");
+  if (narg != 3) error->all(FLERR,"Incorrect args for angle coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -183,7 +183,7 @@ void AngleHarmonic::coeff(int narg, char **arg)
     count++;
   }
 
-  if (count == 0) error->all("Incorrect args for angle coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for angle coefficients");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/MOLECULE/angle_hybrid.cpp b/src/MOLECULE/angle_hybrid.cpp
index ac3b8a28a62b641ab518916b46a279a08806e1f2..a71d87da17b708c3cc189ff107926fb2eb32d1c7 100644
--- a/src/MOLECULE/angle_hybrid.cpp
+++ b/src/MOLECULE/angle_hybrid.cpp
@@ -162,7 +162,7 @@ void AngleHybrid::settings(int narg, char **arg)
 {
   int i,m,istyle;
 
-  if (narg < 1) error->all("Illegal angle_style command");
+  if (narg < 1) error->all(FLERR,"Illegal angle_style command");
 
   // delete old lists, since cannot just change settings
 
@@ -212,11 +212,11 @@ void AngleHybrid::settings(int narg, char **arg)
   while (i < narg) {
     for (m = 0; m < nstyles; m++)
       if (strcmp(arg[i],keywords[m]) == 0) 
-	error->all("Angle style hybrid cannot use same pair style twice");
+	error->all(FLERR,"Angle style hybrid cannot use same pair style twice");
     if (strcmp(arg[i],"hybrid") == 0) 
-      error->all("Angle style hybrid cannot have hybrid as an argument");
+      error->all(FLERR,"Angle style hybrid cannot have hybrid as an argument");
     if (strcmp(arg[i],"none") == 0) 
-      error->all("Angle style hybrid cannot have none as an argument");
+      error->all(FLERR,"Angle style hybrid cannot have none as an argument");
     styles[nstyles] = force->new_angle(arg[i]);
     keywords[nstyles] = new char[strlen(arg[i])+1];
     strcpy(keywords[nstyles],arg[i]);
@@ -252,7 +252,7 @@ void AngleHybrid::coeff(int narg, char **arg)
   if (m == nstyles) {
     if (strcmp(arg[1],"none") == 0) none = 1;
     else if (strcmp(arg[1],"skip") == 0) none = skip = 1;
-    else error->all("Angle coeff for hybrid has invalid style");
+    else error->all(FLERR,"Angle coeff for hybrid has invalid style");
   }
 
   // move 1st arg to 2nd arg
@@ -286,7 +286,8 @@ void AngleHybrid::coeff(int narg, char **arg)
 
 double AngleHybrid::equilibrium_angle(int i)
 {
-  if (map[i] < 0) error->one("Invoked angle equil angle on angle style none");
+  if (map[i] < 0)
+    error->one(FLERR,"Invoked angle equil angle on angle style none");
   return styles[map[i]]->equilibrium_angle(i);
 }
 
@@ -335,7 +336,7 @@ void AngleHybrid::read_restart(FILE *fp)
 
 double AngleHybrid::single(int type, int i1, int i2, int i3)
 {
-  if (map[type] < 0) error->one("Invoked angle single on angle style none");
+  if (map[type] < 0) error->one(FLERR,"Invoked angle single on angle style none");
   return styles[map[type]]->single(type,i1,i2,i3);
 }
 
diff --git a/src/MOLECULE/angle_table.cpp b/src/MOLECULE/angle_table.cpp
index c47309c5051c25012ae98b32cfc1e81bf951c372..4395c2041336b662545c14e3396b18e5102e7056 100644
--- a/src/MOLECULE/angle_table.cpp
+++ b/src/MOLECULE/angle_table.cpp
@@ -29,9 +29,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 enum{LINEAR,SPLINE};
 
 #define MAXLINE 1024
@@ -183,14 +180,14 @@ void AngleTable::allocate()
 
 void AngleTable::settings(int narg, char **arg)
 {
-  if (narg != 2) error->all("Illegal angle_style command");
+  if (narg != 2) error->all(FLERR,"Illegal angle_style command");
 
   if (strcmp(arg[0],"linear") == 0) tabstyle = LINEAR;
   else if (strcmp(arg[0],"spline") == 0) tabstyle = SPLINE;
-  else error->all("Unknown table style in angle style table");
+  else error->all(FLERR,"Unknown table style in angle style table");
 
   tablength = force->inumeric(arg[1]);
-  if (tablength < 2) error->all("Illegal number of angle table entries");
+  if (tablength < 2) error->all(FLERR,"Illegal number of angle table entries");
 
   // delete old tables, since cannot just change settings
 
@@ -213,7 +210,7 @@ void AngleTable::settings(int narg, char **arg)
 
 void AngleTable::coeff(int narg, char **arg)
 {
-  if (narg != 3) error->all("Illegal angle_coeff command");
+  if (narg != 3) error->all(FLERR,"Illegal angle_coeff command");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -230,13 +227,13 @@ void AngleTable::coeff(int narg, char **arg)
 
   // error check on table parameters
 
-  if (tb->ninput <= 1) error->one("Invalid angle table length");
+  if (tb->ninput <= 1) error->one(FLERR,"Invalid angle table length");
 
   double alo,ahi;
   alo = tb->afile[0];
   ahi = tb->afile[tb->ninput-1];
   if (fabs(alo-0.0) > TINY || fabs(ahi-180.0) > TINY)
-    error->all("Angle table must range from 0 to 180 degrees");
+    error->all(FLERR,"Angle table must range from 0 to 180 degrees");
     
   // convert theta from degrees to radians
 
@@ -261,7 +258,7 @@ void AngleTable::coeff(int narg, char **arg)
   }
   ntables++;
 
-  if (count == 0) error->all("Illegal angle_coeff command");
+  if (count == 0) error->all(FLERR,"Illegal angle_coeff command");
 }
 
 /* ----------------------------------------------------------------------
@@ -372,14 +369,14 @@ void AngleTable::read_table(Table *tb, char *file, char *keyword)
   if (fp == NULL) {
     char str[128];
     sprintf(str,"Cannot open file %s",file);
-    error->one(str);
+    error->one(FLERR,str);
   }
 
   // loop until section found with matching keyword
 
   while (1) {
     if (fgets(line,MAXLINE,fp) == NULL)
-      error->one("Did not find keyword in table file");
+      error->one(FLERR,"Did not find keyword in table file");
     if (strspn(line," \t\n") == strlen(line)) continue;    // blank line
     if (line[0] == '#') continue;                          // comment
     if (strstr(line,keyword) == line) break;               // matching keyword
@@ -510,12 +507,12 @@ void AngleTable::param_extract(Table *tb, char *line)
       word = strtok(NULL," \t\n\r\f");
       tb->theta0 = atof(word);
     } else {
-      error->one("Invalid keyword in angle table parameters");
+      error->one(FLERR,"Invalid keyword in angle table parameters");
     }
     word = strtok(NULL," \t\n\r\f");
   }
 
-  if (tb->ninput == 0) error->one("Angle table parameters did not set N");
+  if (tb->ninput == 0) error->one(FLERR,"Angle table parameters did not set N");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/MOLECULE/atom_vec_angle.cpp b/src/MOLECULE/atom_vec_angle.cpp
index 72afefb8d1569cd74135ec8de4fc3314e9b14a3a..46478bac070de436cf6bb348ea772482e0449f93 100644
--- a/src/MOLECULE/atom_vec_angle.cpp
+++ b/src/MOLECULE/atom_vec_angle.cpp
@@ -23,9 +23,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 #define DELTA 10000
 
 /* ---------------------------------------------------------------------- */
@@ -61,7 +58,7 @@ void AtomVecAngle::grow(int n)
   else nmax = n;
   atom->nmax = nmax;
   if (nmax < 0 || nmax > MAXSMALLINT)
-    error->one("Per-processor system is too big");
+    error->one(FLERR,"Per-processor system is too big");
 
   tag = memory->grow(atom->tag,nmax,"atom:tag");
   type = memory->grow(atom->type,nmax,"atom:type");
@@ -763,13 +760,13 @@ void AtomVecAngle::data_atom(double *coord, int imagetmp, char **values)
 
   tag[nlocal] = atoi(values[0]);
   if (tag[nlocal] <= 0)
-    error->one("Invalid atom ID in Atoms section of data file");
+    error->one(FLERR,"Invalid atom ID in Atoms section of data file");
 
   molecule[nlocal] = atoi(values[1]);
 
   type[nlocal] = atoi(values[2]);
   if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
-    error->one("Invalid atom type in Atoms section of data file");
+    error->one(FLERR,"Invalid atom type in Atoms section of data file");
 
   x[nlocal][0] = coord[0];
   x[nlocal][1] = coord[1];
diff --git a/src/MOLECULE/atom_vec_bond.cpp b/src/MOLECULE/atom_vec_bond.cpp
index fb0a3e05837d3b666fb1901f47cd7b28650f58da..700eb275a09685a9bca1d16093a13e67bac32d38 100644
--- a/src/MOLECULE/atom_vec_bond.cpp
+++ b/src/MOLECULE/atom_vec_bond.cpp
@@ -24,9 +24,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 #define DELTA 10000
 
 /* ---------------------------------------------------------------------- */
@@ -62,7 +59,7 @@ void AtomVecBond::grow(int n)
   else nmax = n;
   atom->nmax = nmax;
   if (nmax < 0 || nmax > MAXSMALLINT)
-    error->one("Per-processor system is too big");
+    error->one(FLERR,"Per-processor system is too big");
 
   tag = memory->grow(atom->tag,nmax,"atom:tag");
   type = memory->grow(atom->type,nmax,"atom:type");
@@ -723,13 +720,13 @@ void AtomVecBond::data_atom(double *coord, int imagetmp, char **values)
 
   tag[nlocal] = atoi(values[0]);
   if (tag[nlocal] <= 0)
-    error->one("Invalid atom ID in Atoms section of data file");
+    error->one(FLERR,"Invalid atom ID in Atoms section of data file");
 
   molecule[nlocal] = atoi(values[1]);
 
   type[nlocal] = atoi(values[2]);
   if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
-    error->one("Invalid atom type in Atoms section of data file");
+    error->one(FLERR,"Invalid atom type in Atoms section of data file");
 
   x[nlocal][0] = coord[0];
   x[nlocal][1] = coord[1];
diff --git a/src/MOLECULE/atom_vec_full.cpp b/src/MOLECULE/atom_vec_full.cpp
index 15b3c3a84da49c2634264740307dea25d80a9ba5..5a14488fdb29359be8af536574f137c85fb249eb 100644
--- a/src/MOLECULE/atom_vec_full.cpp
+++ b/src/MOLECULE/atom_vec_full.cpp
@@ -24,9 +24,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 #define DELTA 10000
 
 /* ---------------------------------------------------------------------- */
@@ -62,7 +59,7 @@ void AtomVecFull::grow(int n)
   else nmax = n;
   atom->nmax = nmax;
   if (nmax < 0 || nmax > MAXSMALLINT)
-    error->one("Per-processor system is too big");
+    error->one(FLERR,"Per-processor system is too big");
 
   tag = memory->grow(atom->tag,nmax,"atom:tag");
   type = memory->grow(atom->type,nmax,"atom:type");
@@ -926,13 +923,13 @@ void AtomVecFull::data_atom(double *coord, int imagetmp, char **values)
 
   tag[nlocal] = atoi(values[0]);
   if (tag[nlocal] <= 0)
-    error->one("Invalid atom ID in Atoms section of data file");
+    error->one(FLERR,"Invalid atom ID in Atoms section of data file");
 
   molecule[nlocal] = atoi(values[1]);
 
   type[nlocal] = atoi(values[2]);
   if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
-    error->one("Invalid atom type in Atoms section of data file");
+    error->one(FLERR,"Invalid atom type in Atoms section of data file");
 
   q[nlocal] = atof(values[3]);
 
diff --git a/src/MOLECULE/atom_vec_molecular.cpp b/src/MOLECULE/atom_vec_molecular.cpp
index 75c7df86cb715088566bd15c62abc99367f751f5..1672541b6219989f7a685211f58426890d75f8f5 100644
--- a/src/MOLECULE/atom_vec_molecular.cpp
+++ b/src/MOLECULE/atom_vec_molecular.cpp
@@ -24,9 +24,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 #define DELTA 10000
 
 /* ---------------------------------------------------------------------- */
@@ -62,7 +59,7 @@ void AtomVecMolecular::grow(int n)
   else nmax = n;
   atom->nmax = nmax;
   if (nmax < 0 || nmax > MAXSMALLINT)
-    error->one("Per-processor system is too big");
+    error->one(FLERR,"Per-processor system is too big");
 
   tag = memory->grow(atom->tag,nmax,"atom:tag");
   type = memory->grow(atom->type,nmax,"atom:type");
@@ -909,13 +906,13 @@ void AtomVecMolecular::data_atom(double *coord, int imagetmp, char **values)
 
   tag[nlocal] = atoi(values[0]);
   if (tag[nlocal] <= 0)
-    error->one("Invalid atom ID in Atoms section of data file");
+    error->one(FLERR,"Invalid atom ID in Atoms section of data file");
 
   molecule[nlocal] = atoi(values[1]);
 
   type[nlocal] = atoi(values[2]);
   if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
-    error->one("Invalid atom type in Atoms section of data file");
+    error->one(FLERR,"Invalid atom type in Atoms section of data file");
 
   x[nlocal][0] = coord[0];
   x[nlocal][1] = coord[1];
diff --git a/src/MOLECULE/bond_fene.cpp b/src/MOLECULE/bond_fene.cpp
index 26a8454dbf40649e65073ac84d38ffff4ca85c7e..571ace9876e8d6d6959790c368aad9c01358967f 100644
--- a/src/MOLECULE/bond_fene.cpp
+++ b/src/MOLECULE/bond_fene.cpp
@@ -89,8 +89,8 @@ void BondFENE::compute(int eflag, int vflag)
       char str[128];
       sprintf(str,"FENE bond too long: " BIGINT_FORMAT " %d %d %g",
 	      update->ntimestep,atom->tag[i1],atom->tag[i2],sqrt(rsq));
-      error->warning(str,0);
-      if (rlogarg <= -3.0) error->one("Bad FENE bond");
+      error->warning(FLERR,str,0);
+      if (rlogarg <= -3.0) error->one(FLERR,"Bad FENE bond");
       rlogarg = 0.1;
     }
 
@@ -151,7 +151,7 @@ void BondFENE::allocate()
 
 void BondFENE::coeff(int narg, char **arg)
 {
-  if (narg != 5) error->all("Incorrect args for bond coefficients");
+  if (narg != 5) error->all(FLERR,"Incorrect args for bond coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -172,7 +172,7 @@ void BondFENE::coeff(int narg, char **arg)
     count++;
   }
 
-  if (count == 0) error->all("Incorrect args for bond coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for bond coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -186,7 +186,7 @@ void BondFENE::init_style()
   if (force->special_lj[1] != 0.0 || force->special_lj[2] != 1.0 ||
       force->special_lj[3] != 1.0) {
     if (comm->me == 0)
-      error->warning("Use special bonds = 0,1,1 with bond style fene");
+      error->warning(FLERR,"Use special bonds = 0,1,1 with bond style fene");
   }
 }
 
@@ -246,8 +246,8 @@ double BondFENE::single(int type, double rsq, int i, int j)
     char str[128];
     sprintf(str,"FENE bond too long: " BIGINT_FORMAT " %g",
 	    update->ntimestep,sqrt(rsq));
-    error->warning(str,0);
-    if (rlogarg <= -3.0) error->one("Bad FENE bond");
+    error->warning(FLERR,str,0);
+    if (rlogarg <= -3.0) error->one(FLERR,"Bad FENE bond");
     rlogarg = 0.1;
   }
 
diff --git a/src/MOLECULE/bond_fene_expand.cpp b/src/MOLECULE/bond_fene_expand.cpp
index 560179beab76cb89bbeea1146828caeeb3845d5c..a466ca4dbf79c6fdfe72b2cfae761318d9a7b6f8 100644
--- a/src/MOLECULE/bond_fene_expand.cpp
+++ b/src/MOLECULE/bond_fene_expand.cpp
@@ -94,8 +94,8 @@ void BondFENEExpand::compute(int eflag, int vflag)
       char str[128];
       sprintf(str,"FENE bond too long: " BIGINT_FORMAT " %d %d %g",
 	      update->ntimestep,atom->tag[i1],atom->tag[i2],sqrt(rsq));
-      error->warning(str,0);
-      if (rlogarg <= -3.0) error->one("Bad FENE bond");
+      error->warning(FLERR,str,0);
+      if (rlogarg <= -3.0) error->one(FLERR,"Bad FENE bond");
       rlogarg = 0.1;
     }
 
@@ -157,7 +157,7 @@ void BondFENEExpand::allocate()
 
 void BondFENEExpand::coeff(int narg, char **arg)
 {
-  if (narg != 6) error->all("Incorrect args for bond coefficients");
+  if (narg != 6) error->all(FLERR,"Incorrect args for bond coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -180,7 +180,7 @@ void BondFENEExpand::coeff(int narg, char **arg)
     count++;
   }
 
-  if (count == 0) error->all("Incorrect args for bond coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for bond coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -194,7 +194,7 @@ void BondFENEExpand::init_style()
   if (force->special_lj[1] != 0.0 || force->special_lj[2] != 1.0 ||
       force->special_lj[3] != 1.0) {
     if (comm->me == 0)
-      error->warning("Use special bonds = 0,1,1 with bond style fene/expand");
+      error->warning(FLERR,"Use special bonds = 0,1,1 with bond style fene/expand");
   }
 }
 
@@ -260,8 +260,8 @@ double BondFENEExpand::single(int type, double rsq, int i, int j)
     char str[128];
     sprintf(str,"FENE bond too long: " BIGINT_FORMAT " %g",
 	    update->ntimestep,sqrt(rsq));
-    error->warning(str,0);
-    if (rlogarg <= -3.0) error->one("Bad FENE bond");
+    error->warning(FLERR,str,0);
+    if (rlogarg <= -3.0) error->one(FLERR,"Bad FENE bond");
     rlogarg = 0.1;
   }
 
diff --git a/src/MOLECULE/bond_harmonic.cpp b/src/MOLECULE/bond_harmonic.cpp
index 9e4c2756a22bbf191f083face1cec2ef77302622..63af84bf98f37afc975e3cbfce79ebe6f702bc58 100644
--- a/src/MOLECULE/bond_harmonic.cpp
+++ b/src/MOLECULE/bond_harmonic.cpp
@@ -118,7 +118,7 @@ void BondHarmonic::allocate()
 
 void BondHarmonic::coeff(int narg, char **arg)
 {
-  if (narg != 3) error->all("Incorrect args for bond coefficients");
+  if (narg != 3) error->all(FLERR,"Incorrect args for bond coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -135,7 +135,7 @@ void BondHarmonic::coeff(int narg, char **arg)
     count++;
   }
 
-  if (count == 0) error->all("Incorrect args for bond coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for bond coefficients");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/MOLECULE/bond_morse.cpp b/src/MOLECULE/bond_morse.cpp
index cd3fe47c938454facc6c18c49458496f8ddb6d98..135c6f8df5ef728f217bb6f4883551b5a2e7bdbf 100644
--- a/src/MOLECULE/bond_morse.cpp
+++ b/src/MOLECULE/bond_morse.cpp
@@ -123,7 +123,7 @@ void BondMorse::allocate()
 
 void BondMorse::coeff(int narg, char **arg)
 {
-  if (narg != 4) error->all("Incorrect args for bond coefficients");
+  if (narg != 4) error->all(FLERR,"Incorrect args for bond coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -142,7 +142,7 @@ void BondMorse::coeff(int narg, char **arg)
     count++;
   }
 
-  if (count == 0) error->all("Incorrect args for bond coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for bond coefficients");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/MOLECULE/bond_nonlinear.cpp b/src/MOLECULE/bond_nonlinear.cpp
index a848cce902cc6ac4cc6d9a6023818b2432e17600..1a31b4c4b1801ac4499271fa59da7eb5218fef4e 100644
--- a/src/MOLECULE/bond_nonlinear.cpp
+++ b/src/MOLECULE/bond_nonlinear.cpp
@@ -120,7 +120,7 @@ void BondNonlinear::allocate()
 
 void BondNonlinear::coeff(int narg, char **arg)
 {
-  if (narg != 4) error->all("Incorrect args for bond coefficients");
+  if (narg != 4) error->all(FLERR,"Incorrect args for bond coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -139,7 +139,7 @@ void BondNonlinear::coeff(int narg, char **arg)
     count++;
   }
 
-  if (count == 0) error->all("Incorrect args for bond coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for bond coefficients");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/MOLECULE/bond_quartic.cpp b/src/MOLECULE/bond_quartic.cpp
index f9e5bd86004d2cb80ed3347a5d8c3c80df5f07ec..c8fc882d57b8d8ae721ea5d5b576720da2bb06a2 100755
--- a/src/MOLECULE/bond_quartic.cpp
+++ b/src/MOLECULE/bond_quartic.cpp
@@ -200,7 +200,7 @@ void BondQuartic::allocate()
 
 void BondQuartic::coeff(int narg, char **arg)
 {
-  if (narg != 6) error->all("Incorrect args for bond coefficients");
+  if (narg != 6) error->all(FLERR,"Incorrect args for bond coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -223,7 +223,7 @@ void BondQuartic::coeff(int narg, char **arg)
     count++;
   }
 
-  if (count == 0) error->all("Incorrect args for bond coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for bond coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -233,19 +233,19 @@ void BondQuartic::coeff(int narg, char **arg)
 void BondQuartic::init_style()
 {
   if (force->pair == NULL || force->pair->single_enable == 0)
-    error->all("Pair style does not support bond_style quartic");
+    error->all(FLERR,"Pair style does not support bond_style quartic");
   if (force->angle)
-    error->all("Bond style quartic cannot be used with 3,4-body interactions");
+    error->all(FLERR,"Bond style quartic cannot be used with 3,4-body interactions");
   if (force->dihedral)
-    error->all("Bond style quartic cannot be used with 3,4-body interactions");
+    error->all(FLERR,"Bond style quartic cannot be used with 3,4-body interactions");
   if (force->improper)
-    error->all("Bond style quartic cannot be used with 3,4-body interactions");
+    error->all(FLERR,"Bond style quartic cannot be used with 3,4-body interactions");
 
   // special bonds must be 1 1 1
 
   if (force->special_lj[1] != 1.0 || force->special_lj[2] != 1.0 ||
       force->special_lj[3] != 1.0)
-    error->all("Bond style quartic requires special_bonds = 1,1,1");
+    error->all(FLERR,"Bond style quartic requires special_bonds = 1,1,1");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/MOLECULE/bond_table.cpp b/src/MOLECULE/bond_table.cpp
index 1e6abb88a8fbf28a80b6542918dc024c1d254fbf..04743097e69159825ec91490c5c547109f678e7e 100644
--- a/src/MOLECULE/bond_table.cpp
+++ b/src/MOLECULE/bond_table.cpp
@@ -33,9 +33,6 @@ enum{LINEAR,SPLINE};
 
 #define MAXLINE 1024
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 BondTable::BondTable(LAMMPS *lmp) : Bond(lmp) 
@@ -135,14 +132,14 @@ void BondTable::allocate()
 
 void BondTable::settings(int narg, char **arg)
 {
-  if (narg != 2) error->all("Illegal bond_style command");
+  if (narg != 2) error->all(FLERR,"Illegal bond_style command");
 
   if (strcmp(arg[0],"linear") == 0) tabstyle = LINEAR;
   else if (strcmp(arg[0],"spline") == 0) tabstyle = SPLINE;
-  else error->all("Unknown table style in bond style table");
+  else error->all(FLERR,"Unknown table style in bond style table");
 
   tablength = force->inumeric(arg[1]);
-  if (tablength < 2) error->all("Illegal number of bond table entries");
+  if (tablength < 2) error->all(FLERR,"Illegal number of bond table entries");
 
   // delete old tables, since cannot just change settings
 
@@ -165,7 +162,7 @@ void BondTable::settings(int narg, char **arg)
 
 void BondTable::coeff(int narg, char **arg)
 {
-  if (narg != 3) error->all("Illegal bond_coeff command");
+  if (narg != 3) error->all(FLERR,"Illegal bond_coeff command");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -182,11 +179,11 @@ void BondTable::coeff(int narg, char **arg)
 
   // error check on table parameters
 
-  if (tb->ninput <= 1) error->one("Invalid bond table length");
+  if (tb->ninput <= 1) error->one(FLERR,"Invalid bond table length");
 
   tb->lo = tb->rfile[0];
   tb->hi = tb->rfile[tb->ninput-1];
-  if (tb->lo >= tb->hi) error->all("Bond table values are not increasing");
+  if (tb->lo >= tb->hi) error->all(FLERR,"Bond table values are not increasing");
 
   // spline read-in and compute r,e,f vectors within table
 
@@ -204,7 +201,7 @@ void BondTable::coeff(int narg, char **arg)
   }
   ntables++;
 
-  if (count == 0) error->all("Illegal bond_coeff command");
+  if (count == 0) error->all(FLERR,"Illegal bond_coeff command");
 }
 
 /* ----------------------------------------------------------------------
@@ -296,14 +293,14 @@ void BondTable::read_table(Table *tb, char *file, char *keyword)
   if (fp == NULL) {
     char str[128];
     sprintf(str,"Cannot open file %s",file);
-    error->one(str);
+    error->one(FLERR,str);
   }
 
   // loop until section found with matching keyword
 
   while (1) {
     if (fgets(line,MAXLINE,fp) == NULL)
-      error->one("Did not find keyword in table file");
+      error->one(FLERR,"Did not find keyword in table file");
     if (strspn(line," \t\n") == strlen(line)) continue;    // blank line
     if (line[0] == '#') continue;                          // comment
     if (strstr(line,keyword) == line) break;               // matching keyword
@@ -433,12 +430,12 @@ void BondTable::param_extract(Table *tb, char *line)
       word = strtok(NULL," \t\n\r\f");
       tb->r0 = atof(word);
     } else {
-      error->one("Invalid keyword in bond table parameters");
+      error->one(FLERR,"Invalid keyword in bond table parameters");
     }
     word = strtok(NULL," \t\n\r\f");
   }
 
-  if (tb->ninput == 0) error->one("Bond table parameters did not set N");
+  if (tb->ninput == 0) error->one(FLERR,"Bond table parameters did not set N");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/MOLECULE/dihedral_charmm.cpp b/src/MOLECULE/dihedral_charmm.cpp
index 5d29cab63319f192f1444da29f3dc5f55bc0f10f..a4043111501d36bcb37b378fc60b2abd7283c503 100644
--- a/src/MOLECULE/dihedral_charmm.cpp
+++ b/src/MOLECULE/dihedral_charmm.cpp
@@ -151,7 +151,7 @@ void DihedralCharmm::compute(int eflag, int vflag)
 	sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
 		me,update->ntimestep,
 		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(str,0);
+	error->warning(FLERR,str,0);
 	fprintf(screen,"  1st atom: %d %g %g %g\n",
 		me,x[i1][0],x[i1][1],x[i1][2]);
 	fprintf(screen,"  2nd atom: %d %g %g %g\n",
@@ -324,7 +324,7 @@ void DihedralCharmm::allocate()
 
 void DihedralCharmm::coeff(int narg, char **arg)
 {
-  if (narg != 5) error->all("Incorrect args for dihedral coefficients");
+  if (narg != 5) error->all(FLERR,"Incorrect args for dihedral coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -340,9 +340,9 @@ void DihedralCharmm::coeff(int narg, char **arg)
   double weight_one = force->numeric(arg[4]);
 
   if (multiplicity_one < 0)
-    error->all("Incorrect multiplicity arg for dihedral coefficients");
+    error->all(FLERR,"Incorrect multiplicity arg for dihedral coefficients");
   if (weight_one < 0.0 || weight_one > 1.0) 
-    error->all("Incorrect weight arg for dihedral coefficients");
+    error->all(FLERR,"Incorrect weight arg for dihedral coefficients");
 
   double PI = 4.0*atan(1.0);
                        
@@ -358,7 +358,7 @@ void DihedralCharmm::coeff(int narg, char **arg)
     count++;
   }
 
-  if (count == 0) error->all("Incorrect args for dihedral coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for dihedral coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -377,14 +377,14 @@ void DihedralCharmm::init_style()
   if (weightflag) {
     int itmp;
     if (force->pair == NULL)
-      error->all("Dihedral charmm is incompatible with Pair style");
+      error->all(FLERR,"Dihedral charmm is incompatible with Pair style");
     lj14_1 = (double **) force->pair->extract("lj14_1",itmp);
     lj14_2 = (double **) force->pair->extract("lj14_2",itmp);
     lj14_3 = (double **) force->pair->extract("lj14_3",itmp);
     lj14_4 = (double **) force->pair->extract("lj14_4",itmp);
     int *ptr = (int *) force->pair->extract("implicit",itmp);
     if (!lj14_1 || !lj14_2 || !lj14_3 || !lj14_4 || !ptr)
-      error->all("Dihedral charmm is incompatible with Pair style");
+      error->all(FLERR,"Dihedral charmm is incompatible with Pair style");
     implicit = *ptr;
   }
 }
diff --git a/src/MOLECULE/dihedral_harmonic.cpp b/src/MOLECULE/dihedral_harmonic.cpp
index cefd57d42e40f1f63245aea4953948175ec7bb12..b88584d16a255a186777a733843fef33d29aeeb3 100644
--- a/src/MOLECULE/dihedral_harmonic.cpp
+++ b/src/MOLECULE/dihedral_harmonic.cpp
@@ -141,7 +141,7 @@ void DihedralHarmonic::compute(int eflag, int vflag)
 	sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
 		me,update->ntimestep,
 		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(str,0);
+	error->warning(FLERR,str,0);
 	fprintf(screen,"  1st atom: %d %g %g %g\n",
 		me,x[i1][0],x[i1][1],x[i1][2]);
 	fprintf(screen,"  2nd atom: %d %g %g %g\n",
@@ -272,7 +272,7 @@ void DihedralHarmonic::allocate()
 
 void DihedralHarmonic::coeff(int narg, char **arg)
 {
-  if (narg != 4) error->all("Incorrect args for dihedral coefficients");
+  if (narg != 4) error->all(FLERR,"Incorrect args for dihedral coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -287,9 +287,9 @@ void DihedralHarmonic::coeff(int narg, char **arg)
   //   backwards compatibility and is probably not needed
   
   if (sign_one != -1 && sign_one != 1)
-    error->all("Incorrect sign arg for dihedral coefficients");
+    error->all(FLERR,"Incorrect sign arg for dihedral coefficients");
   if (multiplicity_one < 0)
-    error->all("Incorrect multiplicity arg for dihedral coefficients");
+    error->all(FLERR,"Incorrect multiplicity arg for dihedral coefficients");
                        
   int count = 0;
   for (int i = ilo; i <= ihi; i++) {
@@ -307,7 +307,7 @@ void DihedralHarmonic::coeff(int narg, char **arg)
     count++;
   }
 
-  if (count == 0) error->all("Incorrect args for dihedral coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for dihedral coefficients");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/MOLECULE/dihedral_helix.cpp b/src/MOLECULE/dihedral_helix.cpp
index 639520e8a8f4d8dd9aab816633dace55ddf1660c..7a50eb4fc04cdff1213b533b479478c560f264e7 100644
--- a/src/MOLECULE/dihedral_helix.cpp
+++ b/src/MOLECULE/dihedral_helix.cpp
@@ -32,9 +32,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 #define TOLERANCE 0.05
 #define SMALL     0.001
 #define SMALLER   0.00001
@@ -173,7 +170,7 @@ void DihedralHelix::compute(int eflag, int vflag)
 	sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
 		me,update->ntimestep,
 		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(str,0);
+	error->warning(FLERR,str,0);
 	fprintf(screen,"  1st atom: %d %g %g %g\n",
 		me,x[i1][0],x[i1][1],x[i1][2]);
 	fprintf(screen,"  2nd atom: %d %g %g %g\n",
@@ -284,7 +281,7 @@ void DihedralHelix::allocate()
 
 void DihedralHelix::coeff(int narg, char **arg)
 {
-  if (narg != 4) error->all("Incorrect args for dihedral coefficients");
+  if (narg != 4) error->all(FLERR,"Incorrect args for dihedral coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -303,7 +300,7 @@ void DihedralHelix::coeff(int narg, char **arg)
     count++;
   }
 
-  if (count == 0) error->all("Incorrect args for dihedral coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for dihedral coefficients");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/MOLECULE/dihedral_hybrid.cpp b/src/MOLECULE/dihedral_hybrid.cpp
index 2d17ea028ada827076963a2dc1704a86aba76a17..4b416281d893d153550076e15e5c99325a4259ec 100644
--- a/src/MOLECULE/dihedral_hybrid.cpp
+++ b/src/MOLECULE/dihedral_hybrid.cpp
@@ -168,12 +168,12 @@ void DihedralHybrid::settings(int narg, char **arg)
   for (int m = 0; m < nstyles; m++) {
     for (int i = 0; i < m; i++)
       if (strcmp(arg[m],arg[i]) == 0) 
-	error->all("Dihedral style hybrid cannot use "
+	error->all(FLERR,"Dihedral style hybrid cannot use "
 		   "same dihedral style twice");
     if (strcmp(arg[m],"hybrid") == 0) 
-      error->all("Dihedral style hybrid cannot have hybrid as an argument");
+      error->all(FLERR,"Dihedral style hybrid cannot have hybrid as an argument");
     if (strcmp(arg[m],"none") == 0) 
-      error->all("Dihedral style hybrid cannot have none as an argument");
+      error->all(FLERR,"Dihedral style hybrid cannot have none as an argument");
     styles[m] = force->new_dihedral(arg[m]);
     keywords[m] = new char[strlen(arg[m])+1];
     strcpy(keywords[m],arg[m]);
@@ -203,7 +203,7 @@ void DihedralHybrid::coeff(int narg, char **arg)
   if (m == nstyles) {
     if (strcmp(arg[1],"none") == 0) none = 1;
     else if (strcmp(arg[1],"skip") == 0) none = skip = 1;
-    else error->all("Dihedral coeff for hybrid has invalid style");
+    else error->all(FLERR,"Dihedral coeff for hybrid has invalid style");
   }
 
   // move 1st arg to 2nd arg
diff --git a/src/MOLECULE/dihedral_multi_harmonic.cpp b/src/MOLECULE/dihedral_multi_harmonic.cpp
index 291cea35e9997af62d46ce2fafd307084b11d077..ea0fd5532eebea10b57a40d10229d96e7cb50578 100644
--- a/src/MOLECULE/dihedral_multi_harmonic.cpp
+++ b/src/MOLECULE/dihedral_multi_harmonic.cpp
@@ -30,9 +30,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 #define TOLERANCE 0.05
 #define SMALL     0.001
 
@@ -166,7 +163,7 @@ void DihedralMultiHarmonic::compute(int eflag, int vflag)
 	sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
 		me,update->ntimestep,
 		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(str,0);
+	error->warning(FLERR,str,0);
 	fprintf(screen,"  1st atom: %d %g %g %g\n",
 		me,x[i1][0],x[i1][1],x[i1][2]);
 	fprintf(screen,"  2nd atom: %d %g %g %g\n",
@@ -275,7 +272,7 @@ void DihedralMultiHarmonic::allocate()
 
 void DihedralMultiHarmonic::coeff(int narg, char **arg)
 {
-  if (narg != 6) error->all("Incorrect args for dihedral coefficients");
+  if (narg != 6) error->all(FLERR,"Incorrect args for dihedral coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -298,7 +295,7 @@ void DihedralMultiHarmonic::coeff(int narg, char **arg)
     count++;
   }
 
-  if (count == 0) error->all("Incorrect args for dihedral coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for dihedral coefficients");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/MOLECULE/dihedral_opls.cpp b/src/MOLECULE/dihedral_opls.cpp
index 99bdd993ecbbe6b574fbd5b97dadbae41740209d..4f4fd75882d029c0ee7ac0132f76ca4ee9a51df2 100644
--- a/src/MOLECULE/dihedral_opls.cpp
+++ b/src/MOLECULE/dihedral_opls.cpp
@@ -30,9 +30,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 #define TOLERANCE 0.05
 #define SMALL     0.001
 #define SMALLER   0.00001
@@ -172,7 +169,7 @@ void DihedralOPLS::compute(int eflag, int vflag)
 	sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
 		me,update->ntimestep,
 		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(str,0);
+	error->warning(FLERR,str,0);
 	fprintf(screen,"  1st atom: %d %g %g %g\n",
 		me,x[i1][0],x[i1][1],x[i1][2]);
 	fprintf(screen,"  2nd atom: %d %g %g %g\n",
@@ -288,7 +285,7 @@ void DihedralOPLS::allocate()
 
 void DihedralOPLS::coeff(int narg, char **arg)
 {
-  if (narg != 5) error->all("Incorrect args for dihedral coefficients");
+  if (narg != 5) error->all(FLERR,"Incorrect args for dihedral coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -311,7 +308,7 @@ void DihedralOPLS::coeff(int narg, char **arg)
     count++;
   }
 
-  if (count == 0) error->all("Incorrect args for dihedral coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for dihedral coefficients");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/MOLECULE/improper_cvff.cpp b/src/MOLECULE/improper_cvff.cpp
index 2ea0b97f564c5f8d2acc88f2a00b7ed7a019abc4..401bcad85a1f702c8d8613be49f81501d07da1d7 100644
--- a/src/MOLECULE/improper_cvff.cpp
+++ b/src/MOLECULE/improper_cvff.cpp
@@ -156,7 +156,7 @@ void ImproperCvff::compute(int eflag, int vflag)
 		"Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
 		me,update->ntimestep,
 		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(str,0);
+	error->warning(FLERR,str,0);
 	fprintf(screen,"  1st atom: %d %g %g %g\n",
 		me,x[i1][0],x[i1][1],x[i1][2]);
 	fprintf(screen,"  2nd atom: %d %g %g %g\n",
@@ -295,7 +295,7 @@ void ImproperCvff::allocate()
 
 void ImproperCvff::coeff(int narg, char **arg)
 {
-  if (narg != 4) error->all("Incorrect args for improper coefficients");
+  if (narg != 4) error->all(FLERR,"Incorrect args for improper coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -314,7 +314,7 @@ void ImproperCvff::coeff(int narg, char **arg)
     count++;
   }
 
-  if (count == 0) error->all("Incorrect args for improper coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for improper coefficients");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/MOLECULE/improper_harmonic.cpp b/src/MOLECULE/improper_harmonic.cpp
index 7e7db4d03f65306e837c6d45f5c5dd2b8f6a12e6..62d5cd54b66957326e582306354819fee478b7ea 100644
--- a/src/MOLECULE/improper_harmonic.cpp
+++ b/src/MOLECULE/improper_harmonic.cpp
@@ -127,7 +127,7 @@ void ImproperHarmonic::compute(int eflag, int vflag)
 		"Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
 		me,update->ntimestep,
 		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(str,0);
+	error->warning(FLERR,str,0);
 	fprintf(screen,"  1st atom: %d %g %g %g\n",
 		me,x[i1][0],x[i1][1],x[i1][2]);
 	fprintf(screen,"  2nd atom: %d %g %g %g\n",
@@ -234,7 +234,7 @@ void ImproperHarmonic::allocate()
 
 void ImproperHarmonic::coeff(int narg, char **arg)
 {
-  if (narg != 3) error->all("Incorrect args for improper coefficients");
+  if (narg != 3) error->all(FLERR,"Incorrect args for improper coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -253,7 +253,7 @@ void ImproperHarmonic::coeff(int narg, char **arg)
     count++;
   }
 
-  if (count == 0) error->all("Incorrect args for improper coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for improper coefficients");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/MOLECULE/improper_hybrid.cpp b/src/MOLECULE/improper_hybrid.cpp
index 767c12b93666be667493803ac575a2063950f6c9..645913e841ae355630c43d48b127dd81ca968157 100644
--- a/src/MOLECULE/improper_hybrid.cpp
+++ b/src/MOLECULE/improper_hybrid.cpp
@@ -168,11 +168,11 @@ void ImproperHybrid::settings(int narg, char **arg)
   for (int m = 0; m < nstyles; m++) {
     for (int i = 0; i < m; i++)
       if (strcmp(arg[m],arg[i]) == 0) 
-	error->all("Improper style hybrid cannot use same improper style twice");
+	error->all(FLERR,"Improper style hybrid cannot use same improper style twice");
     if (strcmp(arg[m],"hybrid") == 0) 
-      error->all("Improper style hybrid cannot have hybrid as an argument");
+      error->all(FLERR,"Improper style hybrid cannot have hybrid as an argument");
     if (strcmp(arg[m],"none") == 0) 
-      error->all("Improper style hybrid cannot have none as an argument");
+      error->all(FLERR,"Improper style hybrid cannot have none as an argument");
     styles[m] = force->new_improper(arg[m]);
     keywords[m] = new char[strlen(arg[m])+1];
     strcpy(keywords[m],arg[m]);
@@ -200,7 +200,7 @@ void ImproperHybrid::coeff(int narg, char **arg)
   int none = 0;
   if (m == nstyles) {
     if (strcmp(arg[1],"none") == 0) none = 1;
-    else error->all("Improper coeff for hybrid has invalid style");
+    else error->all(FLERR,"Improper coeff for hybrid has invalid style");
   }
 
   // move 1st arg to 2nd arg
diff --git a/src/MOLECULE/improper_umbrella.cpp b/src/MOLECULE/improper_umbrella.cpp
index 97cc1f65ada537024d4948778c395a866f10c532..34fddf708aec4effb598c53df4965ab07123c4ae 100644
--- a/src/MOLECULE/improper_umbrella.cpp
+++ b/src/MOLECULE/improper_umbrella.cpp
@@ -133,7 +133,7 @@ void ImproperUmbrella::compute(int eflag, int vflag)
 		"Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
 		me,update->ntimestep,
 		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(str,0);
+	error->warning(FLERR,str,0);
 	fprintf(screen,"  1st atom: %d %g %g %g\n",
 		me,x[i1][0],x[i1][1],x[i1][2]);
 	fprintf(screen,"  2nd atom: %d %g %g %g\n",
@@ -255,7 +255,7 @@ void ImproperUmbrella::allocate()
 
 void ImproperUmbrella::coeff(int narg, char **arg)
 {
-  if (narg != 3) error->all("Incorrect args for improper coefficients");
+  if (narg != 3) error->all(FLERR,"Incorrect args for improper coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -276,7 +276,7 @@ void ImproperUmbrella::coeff(int narg, char **arg)
     count++;
   }
 
-  if (count == 0) error->all("Incorrect args for improper coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for improper coefficients");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/MOLECULE/pair_hbond_dreiding_lj.cpp b/src/MOLECULE/pair_hbond_dreiding_lj.cpp
index 243e837219e242054bc8e30e5b5927a935fb051a..cb5429b3f4ed155d8c61f006df400e4e220f1920 100644
--- a/src/MOLECULE/pair_hbond_dreiding_lj.cpp
+++ b/src/MOLECULE/pair_hbond_dreiding_lj.cpp
@@ -32,9 +32,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define SMALL 0.001
 #define CHUNK 8
 
@@ -276,7 +273,7 @@ void PairHbondDreidingLJ::allocate()
 
 void PairHbondDreidingLJ::settings(int narg, char **arg)
 {
-  if (narg != 4) error->all("Illegal pair_style command");
+  if (narg != 4) error->all(FLERR,"Illegal pair_style command");
   
   ap_global = force->inumeric(arg[0]);  
   cut_inner_global = force->numeric(arg[1]);
@@ -291,7 +288,7 @@ void PairHbondDreidingLJ::settings(int narg, char **arg)
 void PairHbondDreidingLJ::coeff(int narg, char **arg)
 {
   if (narg < 6 || narg > 9)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
   
   int ilo,ihi,jlo,jhi,klo,khi;
@@ -302,7 +299,7 @@ void PairHbondDreidingLJ::coeff(int narg, char **arg)
   int donor_flag;
   if (strcmp(arg[3],"i") == 0) donor_flag = 0;
   else if (strcmp(arg[3],"j") == 0) donor_flag = 1;
-  else error->all("Incorrect args for pair coefficients");
+  else error->all(FLERR,"Incorrect args for pair coefficients");
 
   double epsilon_one = force->numeric(arg[4]);
   double sigma_one = force->numeric(arg[5]);
@@ -316,7 +313,7 @@ void PairHbondDreidingLJ::coeff(int narg, char **arg)
     cut_outer_one = force->numeric(arg[8]);
   }
   if (cut_inner_one>cut_outer_one)
-    error->all("Pair inner cutoff >= Pair outer cutoff");
+    error->all(FLERR,"Pair inner cutoff >= Pair outer cutoff");
   double cut_angle_one = cut_angle_global;
   if (narg == 10) cut_angle_one = force->numeric(arg[9]) * PI/180.0;
   // grow params array if necessary
@@ -352,7 +349,7 @@ void PairHbondDreidingLJ::coeff(int narg, char **arg)
       }
   nparams++;
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -367,14 +364,14 @@ void PairHbondDreidingLJ::init_style()
   //   and computing forces on A,H which may be on different procs
 
   if (atom->molecular == 0)
-    error->all("Pair style hbond/dreiding requires molecular system");
+    error->all(FLERR,"Pair style hbond/dreiding requires molecular system");
   if (atom->tag_enable == 0)
-    error->all("Pair style hbond/dreiding requires atom IDs");
+    error->all(FLERR,"Pair style hbond/dreiding requires atom IDs");
   if (atom->map_style == 0) 
-    error->all("Pair style hbond/dreiding requires an atom map, "
+    error->all(FLERR,"Pair style hbond/dreiding requires an atom map, "
 	       "see atom_modify");
   if (force->newton_pair == 0)
-    error->all("Pair style hbond/dreiding requires newton pair on");
+    error->all(FLERR,"Pair style hbond/dreiding requires newton pair on");
 
   // set donor[M]/acceptor[M] if any atom of type M is a donor/acceptor
 
@@ -390,7 +387,7 @@ void PairHbondDreidingLJ::init_style()
 	  acceptor[j] = 1;
 	}
 
-  if (!anyflag) error->all("No pair hbond/dreiding coefficients set");
+  if (!anyflag) error->all(FLERR,"No pair hbond/dreiding coefficients set");
 
   // set additional param values
   // offset is for LJ only, angle term is not included
diff --git a/src/MOLECULE/pair_hbond_dreiding_morse.cpp b/src/MOLECULE/pair_hbond_dreiding_morse.cpp
index 62f75f0a18f0bac3b9489b12a8c6445c8a151ac0..2e70d928d1c0702d3f51d1e4a74360bf60085a89 100644
--- a/src/MOLECULE/pair_hbond_dreiding_morse.cpp
+++ b/src/MOLECULE/pair_hbond_dreiding_morse.cpp
@@ -32,9 +32,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define SMALL 0.001
 #define CHUNK 8
 
@@ -216,7 +213,7 @@ void PairHbondDreidingMorse::compute(int eflag, int vflag)
 void PairHbondDreidingMorse::coeff(int narg, char **arg)
 {
   if (narg < 8 || narg > 11)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi,klo,khi;
@@ -227,7 +224,7 @@ void PairHbondDreidingMorse::coeff(int narg, char **arg)
   int donor_flag;
   if (strcmp(arg[3],"i") == 0) donor_flag = 0;
   else if (strcmp(arg[3],"j") == 0) donor_flag = 1;
-  else error->all("Incorrect args for pair coefficients");
+  else error->all(FLERR,"Incorrect args for pair coefficients");
 
   double d0_one = force->numeric(arg[4]);
   double alpha_one = force->numeric(arg[5]);
@@ -242,7 +239,7 @@ void PairHbondDreidingMorse::coeff(int narg, char **arg)
     cut_outer_one = force->numeric(arg[9]);
   }
   if (cut_inner_one>cut_outer_one)
-    error->all("Pair inner cutoff >= Pair outer cutoff");
+    error->all(FLERR,"Pair inner cutoff >= Pair outer cutoff");
   double cut_angle_one = cut_angle_global;
   if (narg > 10) cut_angle_one = force->numeric(arg[10]) * PI/180.0;
 
@@ -280,7 +277,7 @@ void PairHbondDreidingMorse::coeff(int narg, char **arg)
       }
   nparams++;
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -295,14 +292,14 @@ void PairHbondDreidingMorse::init_style()
   //   and computing forces on A,H which may be on different procs
 
   if (atom->molecular == 0)
-    error->all("Pair style hbond/dreiding requires molecular system");
+    error->all(FLERR,"Pair style hbond/dreiding requires molecular system");
   if (atom->tag_enable == 0)
-    error->all("Pair style hbond/dreiding requires atom IDs");
+    error->all(FLERR,"Pair style hbond/dreiding requires atom IDs");
   if (atom->map_style == 0) 
-    error->all("Pair style hbond/dreiding requires an atom map, "
+    error->all(FLERR,"Pair style hbond/dreiding requires an atom map, "
 	       "see atom_modify");
   if (force->newton_pair == 0)
-    error->all("Pair style hbond/dreiding requires newton pair on");
+    error->all(FLERR,"Pair style hbond/dreiding requires newton pair on");
 
   // set donor[M]/acceptor[M] if any atom of type M is a donor/acceptor
 
@@ -318,7 +315,7 @@ void PairHbondDreidingMorse::init_style()
 	  acceptor[j] = 1;
 	}
 
-  if (!anyflag) error->all("No pair hbond/dreiding coefficients set");
+  if (!anyflag) error->all(FLERR,"No pair hbond/dreiding coefficients set");
 
   // set additional param values
   // offset is for Morse only, angle term is not included
diff --git a/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp b/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp
index 3552f9e18b275dd9045cd551a8d531ccf282a058..875f4c95a2799cbba03a8e931ea4732520845b70 100644
--- a/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp
+++ b/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp
@@ -32,9 +32,6 @@ using namespace LAMMPS_NS;
 
 enum{GEOMETRIC,ARITHMETIC,SIXTHPOWER};   // same as in pair.cpp
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairLJCharmmCoulCharmm::PairLJCharmmCoulCharmm(LAMMPS *lmp) : Pair(lmp)
@@ -227,7 +224,7 @@ void PairLJCharmmCoulCharmm::allocate()
 void PairLJCharmmCoulCharmm::settings(int narg, char **arg)
 {
   if (narg != 2 && narg != 4) 
-    error->all("Illegal pair_style command");
+    error->all(FLERR,"Illegal pair_style command");
 
   cut_lj_inner = force->numeric(arg[0]);
   cut_lj = force->numeric(arg[1]);
@@ -247,7 +244,7 @@ void PairLJCharmmCoulCharmm::settings(int narg, char **arg)
 void PairLJCharmmCoulCharmm::coeff(int narg, char **arg)
 {
   if (narg != 4 && narg != 6) 
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -275,7 +272,7 @@ void PairLJCharmmCoulCharmm::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -285,14 +282,14 @@ void PairLJCharmmCoulCharmm::coeff(int narg, char **arg)
 void PairLJCharmmCoulCharmm::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style lj/charmm/coul/charmm requires atom attribute q");
+    error->all(FLERR,"Pair style lj/charmm/coul/charmm requires atom attribute q");
 
   neighbor->request(this);
 
   // require cut_lj_inner < cut_lj, cut_coul_inner < cut_coul
 
   if (cut_lj_inner >= cut_lj || cut_coul_inner >= cut_coul)
-    error->all("Pair inner cutoff >= Pair outer cutoff");
+    error->all(FLERR,"Pair inner cutoff >= Pair outer cutoff");
 
   cut_lj_innersq = cut_lj_inner * cut_lj_inner;
   cut_ljsq = cut_lj * cut_lj;
diff --git a/src/Makefile b/src/Makefile
index c95e423ba6dad7094fcd26565db45ea936de1d1a..c0a9df822aa13a3f237d4d31fc7d9e5364d312c5 100755
--- a/src/Makefile
+++ b/src/Makefile
@@ -156,6 +156,10 @@ no-user:
 	@for p in $(PACKUSER); do $(MAKE) no-$$p; done
 
 yes-%:
+	@if [ ! -e Makefile.package ]; \
+	  then cp Makefile.package.empty Makefile.package; fi
+	@if [ ! -e Makefile.package.settings ]; \
+	  then cp Makefile.package.settings.empty Makefile.package.settings; fi
 	@if [ ! -e $(YESDIR) ]; then \
 	  echo "Package $(@:yes-%=%) does not exist"; \
 	else \
diff --git a/src/OPT/pair_eam_opt.cpp b/src/OPT/pair_eam_opt.cpp
index 83a9580b92fb47e2cef5a9fb4d1a79c66a51e60b..616234b69bfee8ed70ac3c01f165565f1074c323 100644
--- a/src/OPT/pair_eam_opt.cpp
+++ b/src/OPT/pair_eam_opt.cpp
@@ -30,9 +30,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairEAMOpt::PairEAMOpt(LAMMPS *lmp) : PairEAM(lmp) {}
diff --git a/src/OPT/pair_lj_charmm_coul_long_opt.cpp b/src/OPT/pair_lj_charmm_coul_long_opt.cpp
index 6049eb2a313c333d9680acfc83c4384bf469c346..49519d476110b20b9a4e512f7f80d2dc087525f5 100644
--- a/src/OPT/pair_lj_charmm_coul_long_opt.cpp
+++ b/src/OPT/pair_lj_charmm_coul_long_opt.cpp
@@ -27,9 +27,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define EWALD_F   1.12837917
 #define EWALD_P   0.3275911
 #define EWALD_A1  0.254829592
diff --git a/src/PERI/atom_vec_peri.cpp b/src/PERI/atom_vec_peri.cpp
index 95a72d10fd078e18971a60f4c8d75d8809078a82..b5714006214631fa18c14c2214594733e8f829a7 100644
--- a/src/PERI/atom_vec_peri.cpp
+++ b/src/PERI/atom_vec_peri.cpp
@@ -64,7 +64,7 @@ void AtomVecPeri::grow(int n)
   else nmax = n;
   atom->nmax = nmax;
   if (nmax < 0 || nmax > MAXSMALLINT)
-    error->one("Per-processor system is too big");
+    error->one(FLERR,"Per-processor system is too big");
 
   tag = memory->grow(atom->tag,nmax,"atom:tag");
   type = memory->grow(atom->type,nmax,"atom:type");
@@ -761,15 +761,15 @@ void AtomVecPeri::data_atom(double *coord, int imagetmp, char **values)
 
   tag[nlocal] = atoi(values[0]);
   if (tag[nlocal] <= 0)
-    error->one("Invalid atom ID in Atoms section of data file");
+    error->one(FLERR,"Invalid atom ID in Atoms section of data file");
  
   type[nlocal] = atoi(values[1]);
   if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
-    error->one("Invalid atom type in Atoms section of data file");
+    error->one(FLERR,"Invalid atom type in Atoms section of data file");
 
   vfrac[nlocal] = atof(values[2]);
   rmass[nlocal] = atof(values[3]);
-  if (rmass[nlocal] <= 0.0) error->one("Invalid mass value");
+  if (rmass[nlocal] <= 0.0) error->one(FLERR,"Invalid mass value");
 
   x[nlocal][0] = coord[0];
   x[nlocal][1] = coord[1];
@@ -800,7 +800,7 @@ int AtomVecPeri::data_atom_hybrid(int nlocal, char **values)
 {
   vfrac[nlocal] = atof(values[0]);
   rmass[nlocal] = atof(values[1]);
-  if (rmass[nlocal] <= 0.0) error->one("Invalid mass value");
+  if (rmass[nlocal] <= 0.0) error->one(FLERR,"Invalid mass value");
 
   s0[nlocal] = DBL_MAX;
   x0[nlocal][0] = x[nlocal][0];
diff --git a/src/PERI/compute_damage_atom.cpp b/src/PERI/compute_damage_atom.cpp
index a66e3059835e7556b443cedd551c3e3929bbc452..92407985c81f2dc1d1df8a8b2933f380c983cb71 100644
--- a/src/PERI/compute_damage_atom.cpp
+++ b/src/PERI/compute_damage_atom.cpp
@@ -34,7 +34,7 @@ using namespace LAMMPS_NS;
 ComputeDamageAtom::ComputeDamageAtom(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Illegal compute damage/atom command");
+  if (narg != 3) error->all(FLERR,"Illegal compute damage/atom command");
 
   peratom_flag = 1;
   size_peratom_cols = 0;
@@ -58,7 +58,7 @@ void ComputeDamageAtom::init()
   for (int i = 0; i < modify->ncompute; i++)
     if (strcmp(modify->compute[i]->style,"damage/peri") == 0) count++;
   if (count > 1 && comm->me == 0)
-    error->warning("More than one compute damage/atom");
+    error->warning(FLERR,"More than one compute damage/atom");
 
   // find associated PERI_NEIGH fix that must exist
 
@@ -66,7 +66,7 @@ void ComputeDamageAtom::init()
   for (int i = 0; i < modify->nfix; i++)
     if (strcmp(modify->fix[i]->style,"PERI_NEIGH") == 0) ifix_peri = i;
   if (ifix_peri == -1)
-    error->all("Compute damage/atom requires peridynamic potential");
+    error->all(FLERR,"Compute damage/atom requires peridynamic potential");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/PERI/fix_peri_neigh.cpp b/src/PERI/fix_peri_neigh.cpp
index 666a27697360a95bcdeb66431bb27dcf06f2f935..a6dbbcdfe5c250d3660adc0602ddd42b13b67063 100644
--- a/src/PERI/fix_peri_neigh.cpp
+++ b/src/PERI/fix_peri_neigh.cpp
@@ -34,9 +34,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 FixPeriNeigh::FixPeriNeigh(LAMMPS *lmp,int narg, char **arg) : 
@@ -251,7 +248,7 @@ void FixPeriNeigh::setup(int vflag)
       for (jj = 0; jj < jnum; jj++) {
         for (int kk = jj+1; kk < jnum; kk++) {
           if (partner[i][jj] == partner[i][kk])
-	    error->one("Duplicate particle in PeriDynamic bond - "
+	    error->one(FLERR,"Duplicate particle in PeriDynamic bond - "
 		       "simulation box is too small");
         }
       }
diff --git a/src/PERI/pair_peri_lps.cpp b/src/PERI/pair_peri_lps.cpp
index ec50bdf0ec70a1336a64b80edcc192fb285ab4d4..4efd0b4f31326f37f12f3fcbcd97da4aae8955c8 100644
--- a/src/PERI/pair_peri_lps.cpp
+++ b/src/PERI/pair_peri_lps.cpp
@@ -36,9 +36,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairPeriLPS::PairPeriLPS(LAMMPS *lmp) : Pair(lmp)			
@@ -359,7 +356,7 @@ void PairPeriLPS::allocate()
 
 void PairPeriLPS::settings(int narg, char **arg)		
 {
-  if (narg) error->all("Illegal pair_style command");
+  if (narg) error->all(FLERR,"Illegal pair_style command");
 }
 
 /* ----------------------------------------------------------------------
@@ -368,7 +365,7 @@ void PairPeriLPS::settings(int narg, char **arg)
 
 void PairPeriLPS::coeff(int narg, char **arg)			
 {
-  if (narg != 7) error->all("Incorrect args for pair coefficients"); 	
+  if (narg != 7) error->all(FLERR,"Incorrect args for pair coefficients"); 	
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -394,7 +391,7 @@ void PairPeriLPS::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -403,7 +400,7 @@ void PairPeriLPS::coeff(int narg, char **arg)
 
 double PairPeriLPS::init_one(int i, int j)			
 {
-  if (setflag[i][j] == 0) error->all("All pair coeffs are not set");
+  if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
 
   bulkmodulus[j][i] = bulkmodulus[i][j];		
   shearmodulus[j][i] = shearmodulus[i][j];		
@@ -421,16 +418,16 @@ void PairPeriLPS::init_style()
 {
   // error checks
 
-  if (!atom->peri_flag)  error->all("Pair style peri requires atom style peri");
+  if (!atom->peri_flag)  error->all(FLERR,"Pair style peri requires atom style peri");
   if (atom->map_style == 0) 
-    error->all("Pair peri requires an atom map, see atom_modify");
+    error->all(FLERR,"Pair peri requires an atom map, see atom_modify");
 
   if (domain->lattice == NULL)
-    error->all("Pair peri requires a lattice be defined");
+    error->all(FLERR,"Pair peri requires a lattice be defined");
   if (domain->lattice->xlattice != domain->lattice->ylattice || 
       domain->lattice->xlattice != domain->lattice->zlattice || 
       domain->lattice->ylattice != domain->lattice->zlattice)
-    error->all("Pair peri lattice is not identical in x, y, and z");
+    error->all(FLERR,"Pair peri lattice is not identical in x, y, and z");
 
   // if first init, create Fix needed for storing fixed neighbors
 
@@ -448,7 +445,7 @@ void PairPeriLPS::init_style()
 
   for (int i = 0; i < modify->nfix; i++)
     if (strcmp(modify->fix[i]->style,"PERI_NEIGH") == 0) ifix_peri = i;
-  if (ifix_peri == -1) error->all("Fix peri neigh does not exist");
+  if (ifix_peri == -1) error->all(FLERR,"Fix peri neigh does not exist");
 
   neighbor->request(this);
 }
@@ -620,7 +617,7 @@ double PairPeriLPS::influence_function(double xi_x, double xi_y, double xi_z)
   double omega;
 
   if (fabs(r) < 2.2204e-016)
-    error->one("Divide by 0 in influence function of pair peri/lps");
+    error->one(FLERR,"Divide by 0 in influence function of pair peri/lps");
   omega = 1.0/r;
   return omega;
 }
diff --git a/src/PERI/pair_peri_pmb.cpp b/src/PERI/pair_peri_pmb.cpp
index 436745e93831d6bf6ac92c9aa36960d4fd7d2dd3..c989de6afd5badf5175143c5683dc54e08765f4b 100644
--- a/src/PERI/pair_peri_pmb.cpp
+++ b/src/PERI/pair_peri_pmb.cpp
@@ -37,9 +37,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairPeriPMB::PairPeriPMB(LAMMPS *lmp) : Pair(lmp)
@@ -301,7 +298,7 @@ void PairPeriPMB::allocate()
 
 void PairPeriPMB::settings(int narg, char **arg)
 {
-  if (narg) error->all("Illegal pair_style command");
+  if (narg) error->all(FLERR,"Illegal pair_style command");
 }
 
 /* ----------------------------------------------------------------------
@@ -310,7 +307,7 @@ void PairPeriPMB::settings(int narg, char **arg)
 
 void PairPeriPMB::coeff(int narg, char **arg)
 {
-  if (narg != 6) error->all("Incorrect args for pair coefficients");
+  if (narg != 6) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -334,7 +331,7 @@ void PairPeriPMB::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -343,7 +340,7 @@ void PairPeriPMB::coeff(int narg, char **arg)
 
 double PairPeriPMB::init_one(int i, int j)
 {
-  if (setflag[i][j] == 0) error->all("All pair coeffs are not set");
+  if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
 
   kspring[j][i] = kspring[i][j];
   alpha[j][i] = alpha[i][j];
@@ -360,16 +357,16 @@ void PairPeriPMB::init_style()
 {
   // error checks
 
-  if (!atom->peri_flag) error->all("Pair style peri requires atom style peri");
+  if (!atom->peri_flag) error->all(FLERR,"Pair style peri requires atom style peri");
   if (atom->map_style == 0) 
-    error->all("Pair peri requires an atom map, see atom_modify");
+    error->all(FLERR,"Pair peri requires an atom map, see atom_modify");
 
   if (domain->lattice == NULL)
-    error->all("Pair peri requires a lattice be defined");
+    error->all(FLERR,"Pair peri requires a lattice be defined");
   if (domain->lattice->xlattice != domain->lattice->ylattice || 
       domain->lattice->xlattice != domain->lattice->zlattice || 
       domain->lattice->ylattice != domain->lattice->zlattice)
-    error->all("Pair peri lattice is not identical in x, y, and z");
+    error->all(FLERR,"Pair peri lattice is not identical in x, y, and z");
 
   // if first init, create Fix needed for storing fixed neighbors
 
@@ -387,7 +384,7 @@ void PairPeriPMB::init_style()
 
   for (int i = 0; i < modify->nfix; i++)
     if (strcmp(modify->fix[i]->style,"PERI_NEIGH") == 0) ifix_peri = i;
-  if (ifix_peri == -1) error->all("Fix peri neigh does not exist");
+  if (ifix_peri == -1) error->all(FLERR,"Fix peri neigh does not exist");
 
   neighbor->request(this);
 }
diff --git a/src/POEMS/fix_poems.cpp b/src/POEMS/fix_poems.cpp
index 47b82dfa280f6aaa2b0c2e2697303607716d4730..4e50abb4f60ece418f1a3cf8babb9d7ae1528b72 100644
--- a/src/POEMS/fix_poems.cpp
+++ b/src/POEMS/fix_poems.cpp
@@ -44,9 +44,6 @@ using namespace LAMMPS_NS;
 #define EPSILON 1.0e-7
 #define MAXJACOBI 50
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ----------------------------------------------------------------------
    define rigid bodies and joints, initiate POEMS
 ------------------------------------------------------------------------- */
@@ -91,19 +88,19 @@ FixPOEMS::FixPOEMS(LAMMPS *lmp, int narg, char **arg) :
   // set natom2body, atom2body for all atoms and nbody = # of rigid bodies
   // atoms must also be in fix group to be in a body
 
-  if (narg < 4) error->all("Illegal fix poems command");
+  if (narg < 4) error->all(FLERR,"Illegal fix poems command");
 
   // group = arg has list of groups
 
   if (strcmp(arg[3],"group") == 0) {
     nbody = narg-4;
-    if (nbody <= 0) error->all("Illegal fix poems command");
+    if (nbody <= 0) error->all(FLERR,"Illegal fix poems command");
 
     int *igroups = new int[nbody];
     for (ibody = 0; ibody < nbody; ibody++) {
       igroups[ibody] = group->find(arg[ibody+4]);
       if (igroups[ibody] == -1) 
-	error->all("Could not find fix poems group ID");
+	error->all(FLERR,"Could not find fix poems group ID");
     }
 
     int *mask = atom->mask;
@@ -138,9 +135,9 @@ FixPOEMS::FixPOEMS(LAMMPS *lmp, int narg, char **arg) :
   // use nall as incremented ptr to set atom2body[] values for each atom
 
   } else if (strcmp(arg[3],"molecule") == 0) {
-    if (narg != 4) error->all("Illegal fix poems command");
+    if (narg != 4) error->all(FLERR,"Illegal fix poems command");
     if (atom->molecular == 0)
-      error->all("Must use a molecular atom style with fix poems molecule");
+      error->all(FLERR,"Must use a molecular atom style with fix poems molecule");
 
     int *mask = atom->mask;
     int *molecule = atom->molecule;
@@ -179,19 +176,19 @@ FixPOEMS::FixPOEMS(LAMMPS *lmp, int narg, char **arg) :
     delete [] ncount;
     delete [] nall;
 
-  } else error->all("Illegal fix poems command");
+  } else error->all(FLERR,"Illegal fix poems command");
 
   // error if no bodies
   // error if any atom in too many bodies
 
-  if (nbody == 0) error->all("No rigid bodies defined");
+  if (nbody == 0) error->all(FLERR,"No rigid bodies defined");
 
   int flag = 0;
   for (int i = 0; i < nlocal; i++)
     if (natom2body[i] > MAXBODY) flag = 1;
   int flagall;
   MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
-  if (flagall) error->all("Atom in too many rigid bodies - boost MAXBODY");
+  if (flagall) error->all(FLERR,"Atom in too many rigid bodies - boost MAXBODY");
 
   // create all nbody-length arrays
 
@@ -226,7 +223,7 @@ FixPOEMS::FixPOEMS(LAMMPS *lmp, int narg, char **arg) :
   delete [] ncount;
 
   for (ibody = 0; ibody < nbody; ibody++)
-    if (nrigid[ibody] <= 1) error->all("One or zero atoms in rigid body"); 
+    if (nrigid[ibody] <= 1) error->all(FLERR,"One or zero atoms in rigid body"); 
 
   // build list of joint connections and check for cycles and trees
 
@@ -331,7 +328,7 @@ void FixPOEMS::init()
   int count = 0;
   for (int i = 0; i < modify->nfix; i++)
     if (strcmp(modify->fix[i]->style,"poems") == 0) count++;
-  if (count > 1 && comm->me == 0) error->warning("More than one fix poems");
+  if (count > 1 && comm->me == 0) error->warning(FLERR,"More than one fix poems");
 
   // error if npt,nph fix comes before rigid fix
 
@@ -342,7 +339,7 @@ void FixPOEMS::init()
   if (i < modify->nfix) {
     for (int j = i; j < modify->nfix; j++)
       if (strcmp(modify->fix[j]->style,"poems") == 0)
-	error->all("POEMS fix must come before NPT/NPH fix");
+	error->all(FLERR,"POEMS fix must come before NPT/NPH fix");
   }
 
   // timestep info
@@ -456,7 +453,7 @@ void FixPOEMS::init()
     tensor[0][2] = tensor[2][0] = all[ibody][5];
   
     ierror = jacobi(tensor,inertia[ibody],evectors);
-    if (ierror) error->all("Insufficient Jacobi rotations for POEMS body");
+    if (ierror) error->all(FLERR,"Insufficient Jacobi rotations for POEMS body");
 
     ex_space[ibody][0] = evectors[0][0];
     ex_space[ibody][1] = evectors[1][0];
@@ -480,7 +477,7 @@ void FixPOEMS::init()
     if (inertia[ibody][0] < EPSILON*max ||
 	inertia[ibody][1] < EPSILON*max ||
 	inertia[ibody][2] < EPSILON*max)
-      error->all("Rigid body has degenerate moment of inertia");
+      error->all(FLERR,"Rigid body has degenerate moment of inertia");
 
     // enforce 3 evectors as a right-handed coordinate system
     // flip 3rd evector if needed
@@ -576,11 +573,11 @@ void FixPOEMS::init()
     if (fabs(all[ibody][0]-inertia[ibody][0]) > TOLERANCE || 
 	fabs(all[ibody][1]-inertia[ibody][1]) > TOLERANCE ||
 	fabs(all[ibody][2]-inertia[ibody][2]) > TOLERANCE)
-      error->all("Bad principal moments");
+      error->all(FLERR,"Bad principal moments");
     if (fabs(all[ibody][3]) > TOLERANCE || 
 	fabs(all[ibody][4]) > TOLERANCE ||
 	fabs(all[ibody][5]) > TOLERANCE)
-      error->all("Bad principal moments");
+      error->all(FLERR,"Bad principal moments");
   }
 }
 
@@ -888,7 +885,7 @@ void FixPOEMS::readfile(char *file)
     if (fp == NULL) {
       char str[128];
       sprintf(str,"Cannot open fix poems file %s",file);
-      error->one(str);
+      error->one(FLERR,str);
     }
   }
 
@@ -1020,7 +1017,7 @@ void FixPOEMS::jointbuild()
   // warning if no joints
 
   if (njoint == 0 && me == 0)
-    error->warning("No joints between rigid bodies, use fix rigid instead");
+    error->warning(FLERR,"No joints between rigid bodies, use fix rigid instead");
 
   // sort joint list in ascending order by body indices
   // check for loops in joint connections between rigid bodies
@@ -1029,7 +1026,7 @@ void FixPOEMS::jointbuild()
   sortlist(njoint,jlist);
 
   if (loopcheck(nbody,njoint,jlist))
-    error->all("Cyclic loop in joint connections");
+    error->all(FLERR,"Cyclic loop in joint connections");
 
   int *bodyflag = new int[nbody];
   for (i = 0; i < nbody; i++) bodyflag[i] = 0;
@@ -1038,7 +1035,7 @@ void FixPOEMS::jointbuild()
     bodyflag[jlist[i][1]]++;
   }
   for (i = 0; i < nbody; i++)
-    if (bodyflag[i] > 2) error->all("Tree structure in joint connections");
+    if (bodyflag[i] > 2) error->all(FLERR,"Tree structure in joint connections");
   delete [] bodyflag;
 
   // allocate and setup joint arrays
diff --git a/src/REAX/fix_reax_bonds.cpp b/src/REAX/fix_reax_bonds.cpp
index 67317bd6dc4f1898df8ad70718892f50d64e40ee..ddd5b5eaa33a1a545efe078e899fda209c9c6beb 100644
--- a/src/REAX/fix_reax_bonds.cpp
+++ b/src/REAX/fix_reax_bonds.cpp
@@ -37,19 +37,19 @@ using namespace LAMMPS_NS;
 FixReaxBonds::FixReaxBonds(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 5) error->all("Illegal fix reax/bonds command");
+  if (narg < 5) error->all(FLERR,"Illegal fix reax/bonds command");
 
   MPI_Comm_rank(world,&me);
 
   nevery = atoi(arg[3]);
-  if (nevery < 1) error->all("Illegal fix reax/bonds command");
+  if (nevery < 1) error->all(FLERR,"Illegal fix reax/bonds command");
 
   if (me == 0) {
     fp = fopen(arg[4],"w");
     if (fp == NULL) {
       char str[128];
       sprintf(str,"Cannot open fix reax/bonds file %s",arg[4]);
-      error->one(str);
+      error->one(FLERR,str);
     }
   }
 }
@@ -86,7 +86,7 @@ void FixReaxBonds::init()
   // insure ReaxFF is defined
 
   if (force->pair_match("reax",1) == NULL)
-    error->all("Cannot use fix reax/bonds without pair_style reax");
+    error->all(FLERR,"Cannot use fix reax/bonds without pair_style reax");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -195,7 +195,7 @@ void FixReaxBonds::OutputReaxBonds(bigint ntimestep, FILE *fp)
 	if (numbonds > nsbmax_most) {
 	  char str[128];
 	  sprintf(str,"Fix reax/bonds numbonds > nsbmax_most");
-	  error->one(str);
+	  error->one(FLERR,str);
 	}
 
 	// print connection table
diff --git a/src/REAX/pair_reax.cpp b/src/REAX/pair_reax.cpp
index 6e9e3020f060bfc8d6a6243bab95f09d2991a30e..f32281f5f62df3d13d674cc3bcc43f18fd9c5930 100644
--- a/src/REAX/pair_reax.cpp
+++ b/src/REAX/pair_reax.cpp
@@ -39,8 +39,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
 #define SMALL 0.0001
 
 /* ---------------------------------------------------------------------- */
@@ -278,7 +276,7 @@ void PairREAX::write_reax_positions()
   FORTRAN(rsmall, RSMALL).na_local = nlocal;
 
   if (nlocal+nghost > ReaxParams::nat)
-    error->one("Reax_defs.h setting for NATDEF is too small");
+    error->one(FLERR,"Reax_defs.h setting for NATDEF is too small");
 
   jx = 0;
   jy = ReaxParams::nat;
@@ -361,7 +359,7 @@ void PairREAX::write_reax_vlist()
 	  jjj = i+1;
 	}
 	if (nvpair >= nvpairmax) 
-	  error->one("Reax_defs.h setting for NNEIGHMAXDEF is too small");
+	  error->one(FLERR,"Reax_defs.h setting for NNEIGHMAXDEF is too small");
 	
 	FORTRAN(cbkpairs, CBKPAIRS).nvl1[nvpair] = iii;
 	FORTRAN(cbkpairs, CBKPAIRS).nvl2[nvpair] = jjj;
@@ -420,7 +418,7 @@ void PairREAX::write_reax_vlist()
 	jjj = j+1;
 	      
 	if (nvpair >= nvpairmax) 
-	  error->one("Reax_defs.h setting for NNEIGHMAXDEF is too small");
+	  error->one(FLERR,"Reax_defs.h setting for NNEIGHMAXDEF is too small");
 	
 	FORTRAN(cbkpairs, CBKPAIRS).nvl1[nvpair] = iii;
 	FORTRAN(cbkpairs, CBKPAIRS).nvl2[nvpair] = jjj;
@@ -485,7 +483,7 @@ void PairREAX::allocate()
 
 void PairREAX::settings(int narg, char **arg)
 {
-  if (narg != 0 && narg !=4) error->all("Illegal pair_style command");
+  if (narg != 0 && narg !=4) error->all(FLERR,"Illegal pair_style command");
   
   if (narg == 4) {
     hbcut = force->numeric(arg[0]);
@@ -497,7 +495,7 @@ void PairREAX::settings(int narg, char **arg)
 	(ihbnew != 0 && ihbnew != 1) || 
 	(itripstaball != 0 && itripstaball != 1) || 
 	precision <= 0.0)
-      error->all("Illegal pair_style command");
+      error->all(FLERR,"Illegal pair_style command");
   }
 }
 
@@ -510,17 +508,17 @@ void PairREAX::coeff(int narg, char **arg)
   if (!allocated) allocate();
 
   if (narg != 3 + atom->ntypes)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   // insure I,J args are * *
 
   if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   // insure filename is ffield.reax
 
   if (strcmp(arg[2],"ffield.reax") != 0) 
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   // read args that map atom types to elements in potential file
   // map[i] = which element the Ith atom type is, -1 if NULL
@@ -530,7 +528,7 @@ void PairREAX::coeff(int narg, char **arg)
   for (int i = 3; i < narg; i++) {
     if (strcmp(arg[i],"NULL") == 0) {
       map[i-2] = -1;
-      error->all("Cannot currently use pair reax with pair hybrid");
+      error->all(FLERR,"Cannot currently use pair reax with pair hybrid");
       continue;
     }
     map[i-2] = force->inumeric(arg[i]);
@@ -545,7 +543,7 @@ void PairREAX::coeff(int narg, char **arg)
       count++;
     }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -555,11 +553,11 @@ void PairREAX::coeff(int narg, char **arg)
 void PairREAX::init_style()
 {
   if (atom->tag_enable == 0)
-    error->all("Pair style reax requires atom IDs");
+    error->all(FLERR,"Pair style reax requires atom IDs");
   if (force->newton_pair == 0)
-    error->all("Pair style reax requires newton pair on");
+    error->all(FLERR,"Pair style reax requires newton pair on");
   if (strcmp(update->unit_style,"real") != 0 && comm->me == 0)
-    error->warning("Not using real units with pair reax");
+    error->warning(FLERR,"Not using real units with pair reax");
 
   int irequest = neighbor->request(this);
   neighbor->requests[irequest]->newton = 2;
@@ -595,7 +593,7 @@ void PairREAX::init_style()
   double chi, eta, gamma;
   for (int itype = 1; itype <= atom->ntypes; itype++) {
     if (map[itype] < 1 || map[itype] > nelements)
-      error->all("Invalid REAX atom type");
+      error->all(FLERR,"Invalid REAX atom type");
     chi = FORTRAN(cbkchb, CBKCHB).chi[map[itype]-1];
     eta = FORTRAN(cbkchb, CBKCHB).eta[map[itype]-1];
     gamma = FORTRAN(cbkchb, CBKCHB).gam[map[itype]-1];
diff --git a/src/REPLICA/compute_event_displace.cpp b/src/REPLICA/compute_event_displace.cpp
index 53e9d9f8f996813b678d97c12313d1850abe0382..3f5f401c4bc7ab29ca31f3b44a5de74d12b707d1 100644
--- a/src/REPLICA/compute_event_displace.cpp
+++ b/src/REPLICA/compute_event_displace.cpp
@@ -37,14 +37,14 @@ using namespace LAMMPS_NS;
 ComputeEventDisplace::ComputeEventDisplace(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg != 4) error->all("Illegal compute event/displace command");
+  if (narg != 4) error->all(FLERR,"Illegal compute event/displace command");
 
   scalar_flag = 1;
   extscalar = 0;
 
   double displace_dist = atof(arg[3]);
   if (displace_dist <= 0.0) 
-    error->all("Distance must be > 0 for compute event/displace");
+    error->all(FLERR,"Distance must be > 0 for compute event/displace");
   displace_distsq = displace_dist * displace_dist;
 
   // fix event ID will be set later by PRD
@@ -69,12 +69,12 @@ void ComputeEventDisplace::init()
 
   if (id_event != NULL) {
     int ifix = modify->find_fix(id_event);
-    if (ifix < 0) error->all("Could not find compute event/displace fix ID");
+    if (ifix < 0) error->all(FLERR,"Could not find compute event/displace fix ID");
     fix_event = (FixEvent*) modify->fix[ifix];
     
     if (strcmp(fix_event->style,"EVENT/PRD") != 0 &&
 	strcmp(fix_event->style,"EVENT/TAD") != 0)
-      error->all("Compute event/displace has invalid fix event assigned");
+      error->all(FLERR,"Compute event/displace has invalid fix event assigned");
   }
 
   triclinic = domain->triclinic;
diff --git a/src/REPLICA/fix_event.cpp b/src/REPLICA/fix_event.cpp
index 1b4f795e37eaa7383d942e89f98ca69d09a5c5db..1277135502721858f12bfd51ed69ae3cd8e6e218 100644
--- a/src/REPLICA/fix_event.cpp
+++ b/src/REPLICA/fix_event.cpp
@@ -34,7 +34,7 @@ using namespace LAMMPS_NS;
 FixEvent::FixEvent(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Illegal fix event command");
+  if (narg != 3) error->all(FLERR,"Illegal fix event command");
 
   restart_global = 1;
 
diff --git a/src/REPLICA/fix_event_prd.cpp b/src/REPLICA/fix_event_prd.cpp
index ac428f3713a635df579f14c6ef8741e43ec81d28..84dedd18fd41d1110f69418a4f496914798d08a7 100644
--- a/src/REPLICA/fix_event_prd.cpp
+++ b/src/REPLICA/fix_event_prd.cpp
@@ -35,7 +35,7 @@ using namespace LAMMPS_NS;
 FixEventPRD::FixEventPRD(LAMMPS *lmp, int narg, char **arg) :
   FixEvent(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Illegal fix event command");
+  if (narg != 3) error->all(FLERR,"Illegal fix event command");
 
   restart_global = 1;
 
diff --git a/src/REPLICA/fix_event_tad.cpp b/src/REPLICA/fix_event_tad.cpp
index 950fcd6b80308fdaa22dd593feef5bcc2f098cea..7574b4873ffa538e2d6f42f438a9a9c9dcbeb96f 100644
--- a/src/REPLICA/fix_event_tad.cpp
+++ b/src/REPLICA/fix_event_tad.cpp
@@ -35,7 +35,7 @@ using namespace LAMMPS_NS;
 FixEventTAD::FixEventTAD(LAMMPS *lmp, int narg, char **arg) :
   FixEvent(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Illegal fix event command");
+  if (narg != 3) error->all(FLERR,"Illegal fix event command");
 
   restart_global = 1;
 
diff --git a/src/REPLICA/fix_neb.cpp b/src/REPLICA/fix_neb.cpp
index 958aaa6cfe6be05080e3a177e51766fa9961a95d..d244ea7a8e2ede584d55fbdb8485d25bc15750dd 100644
--- a/src/REPLICA/fix_neb.cpp
+++ b/src/REPLICA/fix_neb.cpp
@@ -27,18 +27,15 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 FixNEB::FixNEB(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg != 4) error->all("Illegal fix neb command");
+  if (narg != 4) error->all(FLERR,"Illegal fix neb command");
 
   kspring = atof(arg[3]);
-  if (kspring <= 0.0) error->all("Illegal fix neb command");
+  if (kspring <= 0.0) error->all(FLERR,"Illegal fix neb command");
 
   // nreplica = number of partitions
   // ireplica = which world I am in universe
@@ -98,7 +95,7 @@ void FixNEB::init()
 {
   int icompute = modify->find_compute(id_pe);
   if (icompute < 0)
-    error->all("Potential energy ID for fix neb does not exist");
+    error->all(FLERR,"Potential energy ID for fix neb does not exist");
   pe = modify->compute[icompute];
 
   // turn off climbing mode, NEB command turns it on after init()
@@ -156,7 +153,7 @@ void FixNEB::min_post_force(int vflag)
   double **x = atom->x;
   int *mask = atom->mask;
   int nlocal = atom->nlocal;
-  if (nlocal != nebatoms) error->one("Atom count changed in fix neb");
+  if (nlocal != nebatoms) error->one(FLERR,"Atom count changed in fix neb");
 
   if (ireplica > 0)
     MPI_Irecv(xprev[0],3*nlocal,MPI_DOUBLE,procprev,0,uworld,&request);
diff --git a/src/REPLICA/neb.cpp b/src/REPLICA/neb.cpp
index 6768b89acd6ac4308f1c599c6329e374ff39595a..c8747aa811787c96cd69d401dadb8c13ca384558 100644
--- a/src/REPLICA/neb.cpp
+++ b/src/REPLICA/neb.cpp
@@ -101,9 +101,9 @@ NEB::~NEB()
 void NEB::command(int narg, char **arg)
 {
   if (domain->box_exist == 0) 
-    error->all("NEB command before simulation box is defined");
+    error->all(FLERR,"NEB command before simulation box is defined");
 
-  if (narg != 6) error->universe_all("Illegal NEB command");
+  if (narg != 6) error->universe_all(FLERR,"Illegal NEB command");
   
   etol = atof(arg[0]);
   ftol = atof(arg[1]);
@@ -114,11 +114,11 @@ void NEB::command(int narg, char **arg)
 
   // error checks
 
-  if (etol < 0.0) error->all("Illegal NEB command");
-  if (ftol < 0.0) error->all("Illegal NEB command");
-  if (nevery == 0) error->universe_all("Illegal NEB command");
+  if (etol < 0.0) error->all(FLERR,"Illegal NEB command");
+  if (ftol < 0.0) error->all(FLERR,"Illegal NEB command");
+  if (nevery == 0) error->universe_all(FLERR,"Illegal NEB command");
   if (n1steps % nevery || n2steps % nevery)
-    error->universe_all("Illegal NEB command");
+    error->universe_all(FLERR,"Illegal NEB command");
 
   // replica info
 
@@ -130,13 +130,13 @@ void NEB::command(int narg, char **arg)
 
   // error checks
 
-  if (nreplica == 1) error->all("Cannot use NEB with a single replica");
+  if (nreplica == 1) error->all(FLERR,"Cannot use NEB with a single replica");
   if (nreplica != universe->nprocs)
-    error->all("Can only use NEB with 1-processor replicas");
+    error->all(FLERR,"Can only use NEB with 1-processor replicas");
   if (atom->sortfreq > 0)
-    error->all("Cannot use NEB with atom_modify sort enabled");
+    error->all(FLERR,"Cannot use NEB with atom_modify sort enabled");
   if (atom->map_style == 0) 
-    error->all("Cannot use NEB unless atom map exists");
+    error->all(FLERR,"Cannot use NEB unless atom map exists");
 
   // read in file of final state atom coords and reset my coords
 
@@ -163,7 +163,7 @@ void NEB::run()
   int ineb;
   for (ineb = 0; ineb < modify->nfix; ineb++)
     if (strcmp(modify->fix[ineb]->style,"neb") == 0) break;
-  if (ineb == modify->nfix) error->all("NEB requires use of fix neb");
+  if (ineb == modify->nfix) error->all(FLERR,"NEB requires use of fix neb");
 
   fneb = (FixNEB *) modify->fix[ineb];
   nall = 4;
@@ -180,7 +180,7 @@ void NEB::run()
   lmp->init();
 
   if (update->minimize->searchflag)
-    error->all("NEB requires damped dynamics minimizer");
+    error->all(FLERR,"NEB requires damped dynamics minimizer");
 
   // setup regular NEB minimization
 
@@ -192,7 +192,7 @@ void NEB::run()
   update->nsteps = n1steps;
   update->max_eval = n1steps;
   if (update->laststep < 0 || update->laststep > MAXBIGINT)
-    error->all("Too many timesteps for NEB");
+    error->all(FLERR,"Too many timesteps for NEB");
 
   update->minimize->setup();
   
@@ -259,7 +259,7 @@ void NEB::run()
   update->nsteps = n2steps;
   update->max_eval = n2steps;
   if (update->laststep < 0 || update->laststep > MAXBIGINT)
-    error->all("Too many timesteps");
+    error->all(FLERR,"Too many timesteps");
 
   update->minimize->init();
   fneb->rclimber = top;
@@ -354,7 +354,7 @@ void NEB::readfile(char *file)
 
       if (firstline) {
 	if (atom->count_words(bufptr) == 4) firstline = 0;
-	else error->all("Incorrect format in NEB coordinate file");
+	else error->all(FLERR,"Incorrect format in NEB coordinate file");
       }
 
       sscanf(bufptr,"%d %lg %lg %lg",&tag,&xx,&yy,&zz);
@@ -410,14 +410,14 @@ void NEB::open(char *file)
     sprintf(gunzip,"gunzip -c %s",file);
     fp = popen(gunzip,"r");
 #else
-    error->one("Cannot open gzipped file");
+    error->one(FLERR,"Cannot open gzipped file");
 #endif
   }
 
   if (fp == NULL) {
     char str[128];
     sprintf(str,"Cannot open file %s",file);
-    error->one(str);
+    error->one(FLERR,str);
   }
 }
 
diff --git a/src/REPLICA/prd.cpp b/src/REPLICA/prd.cpp
index 85d1b4906298b60fdd01d5c6790218cfa3a58d49..909d7e35ec29972fa76947c7f036f966b150b8ba 100644
--- a/src/REPLICA/prd.cpp
+++ b/src/REPLICA/prd.cpp
@@ -63,15 +63,15 @@ void PRD::command(int narg, char **arg)
   // error checks
 
   if (domain->box_exist == 0) 
-    error->all("PRD command before simulation box is defined");
+    error->all(FLERR,"PRD command before simulation box is defined");
   if (universe->nworlds != universe->nprocs && 
       atom->map_style == 0) 
-    error->all("Cannot use PRD with multi-processor replicas "
+    error->all(FLERR,"Cannot use PRD with multi-processor replicas "
 	       "unless atom map exists");
   if (universe->nworlds == 1 && comm->me == 0) 
-    error->warning("Running PRD with only one replica");
+    error->warning(FLERR,"Running PRD with only one replica");
 
-  if (narg < 7) error->universe_all("Illegal prd command");
+  if (narg < 7) error->universe_all(FLERR,"Illegal prd command");
 
   nsteps = atoi(arg[0]);
   t_event = atoi(arg[1]);
@@ -87,11 +87,11 @@ void PRD::command(int narg, char **arg)
 
   // total # of timesteps must be multiple of t_event
 
-  if (t_event <= 0) error->universe_all("Invalid t_event in prd command");
+  if (t_event <= 0) error->universe_all(FLERR,"Invalid t_event in prd command");
   if (nsteps % t_event) 
-    error->universe_all("PRD nsteps must be multiple of t_event");
+    error->universe_all(FLERR,"PRD nsteps must be multiple of t_event");
   if (t_corr % t_event)
-    error->universe_all("PRD t_corr must be multiple of t_event");
+    error->universe_all(FLERR,"PRD t_corr must be multiple of t_event");
 
   // local storage
 
@@ -184,7 +184,7 @@ void PRD::command(int narg, char **arg)
   // necessary so it will know atom coords at last event
 
   int icompute = modify->find_compute(id_compute);
-  if (icompute < 0) error->all("Could not find compute ID for PRD");
+  if (icompute < 0) error->all(FLERR,"Could not find compute ID for PRD");
   compute_event = modify->compute[icompute];
   compute_event->reset_extra_compute_fix("prd_event");
 
@@ -196,7 +196,7 @@ void PRD::command(int narg, char **arg)
 
   if (neigh_every != 1 || neigh_delay != 0 || neigh_dist_check != 1) {
     if (me == 0) 
-      error->warning("Resetting reneighboring criteria during PRD");
+      error->warning(FLERR,"Resetting reneighboring criteria during PRD");
   }
 
   neighbor->every = 1;
@@ -211,7 +211,7 @@ void PRD::command(int narg, char **arg)
   update->endstep = update->laststep = update->firststep + nsteps;
   update->restrict_output = 1;
   if (update->laststep < 0 || update->laststep > MAXBIGINT)
-    error->all("Too many timesteps");
+    error->all(FLERR,"Too many timesteps");
 
   lmp->init();
 
@@ -227,14 +227,14 @@ void PRD::command(int narg, char **arg)
 
   for (int i = 0; i < modify->nfix; i++)
     if (modify->fix[i]->time_depend)
-      error->all("Cannot use PRD with a time-dependent fix defined");
+      error->all(FLERR,"Cannot use PRD with a time-dependent fix defined");
 
   for (int i = 0; i < domain->nregion; i++)
     if (domain->regions[i]->dynamic_check())
-      error->all("Cannot use PRD with a time-dependent region defined");
+      error->all(FLERR,"Cannot use PRD with a time-dependent region defined");
 
   if (atom->sortfreq > 0)
-    error->all("Cannot use PRD with atom_modify sort enabled");
+    error->all(FLERR,"Cannot use PRD with atom_modify sort enabled");
 
   // perform PRD simulation
 
@@ -499,7 +499,7 @@ void PRD::quench()
   update->nsteps = maxiter;
   update->endstep = update->laststep = update->firststep + maxiter;
   if (update->laststep < 0 || update->laststep > MAXBIGINT)
-    error->all("Too many iterations");
+    error->all(FLERR,"Too many iterations");
 
   // full init works
 
@@ -753,7 +753,7 @@ void PRD::replicate(int ireplica)
 
 void PRD::options(int narg, char **arg)
 {
-  if (narg < 0) error->all("Illegal prd command");
+  if (narg < 0) error->all(FLERR,"Illegal prd command");
 
   // set defaults
   
@@ -776,42 +776,42 @@ void PRD::options(int narg, char **arg)
   int iarg = 0;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"min") == 0) {
-      if (iarg+5 > narg) error->all("Illegal prd command");
+      if (iarg+5 > narg) error->all(FLERR,"Illegal prd command");
       etol = atof(arg[iarg+1]);
       ftol = atof(arg[iarg+2]);
       maxiter = atoi(arg[iarg+3]);
       maxeval = atoi(arg[iarg+4]);
-      if (maxiter < 0) error->all("Illegal prd command");
+      if (maxiter < 0) error->all(FLERR,"Illegal prd command");
       iarg += 5;
 
     } else if (strcmp(arg[iarg],"temp") == 0) {
-      if (iarg+2 > narg) error->all("Illegal prd command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal prd command");
       temp_flag = 1;
       temp_dephase = atof(arg[iarg+1]);
-      if (temp_dephase <= 0.0) error->all("Illegal prd command");
+      if (temp_dephase <= 0.0) error->all(FLERR,"Illegal prd command");
       iarg += 2;
 
     } else if (strcmp(arg[iarg],"vel") == 0) {
-      if (iarg+3 > narg) error->all("Illegal prd command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal prd command");
       delete [] loop_setting;
       delete [] dist_setting;
 
       if (strcmp(arg[iarg+1],"all") == 0) loop_setting = NULL;
       else if (strcmp(arg[iarg+1],"local") == 0) loop_setting = NULL;
       else if (strcmp(arg[iarg+1],"geom") == 0) loop_setting = NULL;
-      else error->all("Illegal prd command");
+      else error->all(FLERR,"Illegal prd command");
       int n = strlen(arg[iarg+1]) + 1;
       loop_setting = new char[n];
       strcpy(loop_setting,arg[iarg+1]);
 
       if (strcmp(arg[iarg+2],"uniform") == 0) dist_setting = NULL;
       else if (strcmp(arg[iarg+2],"gaussian") == 0) dist_setting = NULL;
-      else error->all("Illegal prd command");
+      else error->all(FLERR,"Illegal prd command");
       n = strlen(arg[iarg+2]) + 1;
       dist_setting = new char[n];
       strcpy(dist_setting,arg[iarg+2]);
 
       iarg += 3;
-    } else error->all("Illegal prd command");
+    } else error->all(FLERR,"Illegal prd command");
   }
 }
diff --git a/src/REPLICA/tad.cpp b/src/REPLICA/tad.cpp
index 8241d407a7ae42734c843b243f86aea5fefd79cd..3f4ba9c16099c13a14644ca96df994f75ff60afd 100644
--- a/src/REPLICA/tad.cpp
+++ b/src/REPLICA/tad.cpp
@@ -80,17 +80,17 @@ void TAD::command(int narg, char **arg)
   // error checks
 
   if (domain->box_exist == 0) 
-    error->all("Tad command before simulation box is defined");
+    error->all(FLERR,"Tad command before simulation box is defined");
   if (universe->nworlds == 1) 
-    error->all("Cannot use TAD with a single replica for NEB");
+    error->all(FLERR,"Cannot use TAD with a single replica for NEB");
   if (universe->nworlds != universe->nprocs)
-    error->all("Can only use TAD with 1-processor replicas for NEB");
+    error->all(FLERR,"Can only use TAD with 1-processor replicas for NEB");
   if (atom->sortfreq > 0)
-    error->all("Cannot use TAD with atom_modify sort enabled for NEB");
+    error->all(FLERR,"Cannot use TAD with atom_modify sort enabled for NEB");
   if (atom->map_style == 0) 
-    error->all("Cannot use TAD unless atom map exists for NEB");
+    error->all(FLERR,"Cannot use TAD unless atom map exists for NEB");
 
-  if (narg < 7) error->universe_all("Illegal tad command");
+  if (narg < 7) error->universe_all(FLERR,"Illegal tad command");
 
   nsteps = atoi(arg[0]);
   t_event = atoi(arg[1]);
@@ -106,15 +106,15 @@ void TAD::command(int narg, char **arg)
 
   // total # of timesteps must be multiple of t_event
 
-  if (t_event <= 0) error->universe_all("Invalid t_event in tad command");
+  if (t_event <= 0) error->universe_all(FLERR,"Invalid t_event in tad command");
   if (nsteps % t_event) 
-    error->universe_all("TAD nsteps must be multiple of t_event");
+    error->universe_all(FLERR,"TAD nsteps must be multiple of t_event");
 
   if (delta_conf <= 0.0 || delta_conf >= 1.0) 
-    error->universe_all("Invalid delta_conf in tad command");
+    error->universe_all(FLERR,"Invalid delta_conf in tad command");
 
   if (tmax <= 0.0) 
-    error->universe_all("Invalid tmax in tad command");
+    error->universe_all(FLERR,"Invalid tmax in tad command");
 
   // deltconf = (ln(1/delta))/freq_min (timestep units)
 
@@ -171,7 +171,7 @@ void TAD::command(int narg, char **arg)
   // necessary so it will know atom coords at last event
 
   int icompute = modify->find_compute(id_compute);
-  if (icompute < 0) error->all("Could not find compute ID for TAD");
+  if (icompute < 0) error->all(FLERR,"Could not find compute ID for TAD");
   compute_event = modify->compute[icompute];
   compute_event->reset_extra_compute_fix("tad_event");
 
@@ -183,7 +183,7 @@ void TAD::command(int narg, char **arg)
 
   if (neigh_every != 1 || neigh_delay != 0 || neigh_dist_check != 1) {
     if (me_universe == 0) 
-      error->warning("Resetting reneighboring criteria during TAD");
+      error->warning(FLERR,"Resetting reneighboring criteria during TAD");
   }
 
   neighbor->every = 1;
@@ -198,7 +198,7 @@ void TAD::command(int narg, char **arg)
   update->endstep = update->laststep = update->firststep + nsteps;
   update->restrict_output = 1;
   if (update->laststep < 0 || update->laststep > MAXBIGINT)
-    error->all("Too many timesteps");
+    error->all(FLERR,"Too many timesteps");
 
   lmp->init();
 
@@ -470,7 +470,7 @@ void TAD::quench()
   update->nsteps = maxiter;
   update->endstep = update->laststep = update->firststep + maxiter;
   if (update->laststep < 0 || update->laststep > MAXBIGINT)
-    error->all("Too many iterations");
+    error->all(FLERR,"Too many iterations");
 
   // full init works
 
@@ -570,7 +570,7 @@ void TAD::log_event(int ievent)
 
 void TAD::options(int narg, char **arg)
 {
-  if (narg < 0) error->all("Illegal tad command");
+  if (narg < 0) error->all(FLERR,"Illegal tad command");
 
   // set defaults
   
@@ -594,18 +594,18 @@ void TAD::options(int narg, char **arg)
   int iarg = 0;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"min") == 0) {
-      if (iarg+5 > narg) error->all("Illegal tad command");
+      if (iarg+5 > narg) error->all(FLERR,"Illegal tad command");
       etol = atof(arg[iarg+1]);
       ftol = atof(arg[iarg+2]);
       maxiter = atoi(arg[iarg+3]);
       maxeval = atoi(arg[iarg+4]);
       if (maxiter < 0 || maxeval < 0 || 
 	  etol < 0.0 || ftol < 0.0 ) 
-	error->all("Illegal tad command");
+	error->all(FLERR,"Illegal tad command");
       iarg += 5;
 
     } else if (strcmp(arg[iarg],"neb") == 0) {
-      if (iarg+6 > narg) error->all("Illegal tad command");
+      if (iarg+6 > narg) error->all(FLERR,"Illegal tad command");
       etol_neb = atof(arg[iarg+1]);
       ftol_neb = atof(arg[iarg+2]);
       n1steps_neb = atoi(arg[iarg+3]);
@@ -613,11 +613,11 @@ void TAD::options(int narg, char **arg)
       nevery_neb = atoi(arg[iarg+5]);
       if (etol_neb < 0.0 || ftol_neb < 0.0 || 
 	  n1steps_neb < 0 || n2steps_neb < 0 ||
-	  nevery_neb < 0) error->all("Illegal tad command");
+	  nevery_neb < 0) error->all(FLERR,"Illegal tad command");
       iarg += 6;
       
     } else if (strcmp(arg[iarg],"min_style") == 0) {
-      if (iarg+2 > narg) error->all("Illegal tad command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal tad command");
       int n = strlen(arg[iarg+1]) + 1;
       delete [] min_style;
       min_style = new char[n];
@@ -625,7 +625,7 @@ void TAD::options(int narg, char **arg)
       iarg += 2;
 
     } else if (strcmp(arg[iarg],"neb_style") == 0) {
-      if (iarg+2 > narg) error->all("Illegal tad command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal tad command");
       int n = strlen(arg[iarg+1]) + 1;
       delete [] min_style_neb;
       min_style_neb = new char[n];
@@ -634,7 +634,7 @@ void TAD::options(int narg, char **arg)
 
     } else if (strcmp(arg[iarg],"neb_log") == 0) {
       delete [] neb_logfilename;
-      if (iarg+2 > narg) error->all("Illegal tad command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal tad command");
       if (strcmp(arg[iarg+1],"none") == 0) neb_logfilename = NULL;
       else {
 	int n = strlen(arg[iarg+1]) + 1;
@@ -642,7 +642,7 @@ void TAD::options(int narg, char **arg)
 	strcpy(neb_logfilename,arg[iarg+1]);
       }
       iarg += 2;
-    } else error->all("Illegal tad command");
+    } else error->all(FLERR,"Illegal tad command");
   }
 }
 
diff --git a/src/REPLICA/temper.cpp b/src/REPLICA/temper.cpp
index ea8fcfaab67aba909a3e300957c2965b5ecb2237..d95fb3d89b62b86630e35b0c82a5897b235f5237 100644
--- a/src/REPLICA/temper.cpp
+++ b/src/REPLICA/temper.cpp
@@ -65,10 +65,10 @@ Temper::~Temper()
 void Temper::command(int narg, char **arg)
 {
   if (universe->nworlds == 1) 
-    error->all("Must have more than one processor partition to temper");
+    error->all(FLERR,"Must have more than one processor partition to temper");
   if (domain->box_exist == 0) 
-    error->all("Temper command before simulation box is defined");
-  if (narg != 6 && narg != 7) error->universe_all("Illegal temper command");
+    error->all(FLERR,"Temper command before simulation box is defined");
+  if (narg != 6 && narg != 7) error->universe_all(FLERR,"Illegal temper command");
 
   int nsteps = atoi(arg[0]);
   nevery = atoi(arg[1]);
@@ -77,7 +77,7 @@ void Temper::command(int narg, char **arg)
   for (whichfix = 0; whichfix < modify->nfix; whichfix++)
     if (strcmp(arg[3],modify->fix[whichfix]->id) == 0) break;
   if (whichfix == modify->nfix) 
-    error->universe_all("Tempering fix ID is not defined");
+    error->universe_all(FLERR,"Tempering fix ID is not defined");
 
   seed_swap = atoi(arg[4]);
   seed_boltz = atoi(arg[5]);
@@ -87,10 +87,10 @@ void Temper::command(int narg, char **arg)
 
   // swap frequency must evenly divide total # of timesteps
 
-  if (nevery == 0) error->universe_all("Invalid frequency in temper command");
+  if (nevery == 0) error->universe_all(FLERR,"Invalid frequency in temper command");
   nswaps = nsteps/nevery;
   if (nswaps*nevery != nsteps) 
-    error->universe_all("Non integer # of swaps in temper command");
+    error->universe_all(FLERR,"Non integer # of swaps in temper command");
 
   // fix style must be appropriate for temperature control
 
@@ -98,7 +98,7 @@ void Temper::command(int narg, char **arg)
       (strcmp(modify->fix[whichfix]->style,"langevin") != 0) &&
       (strcmp(modify->fix[whichfix]->style,"temp/berendsen") != 0) &&
       (strcmp(modify->fix[whichfix]->style,"temp/rescale") != 0))
-    error->universe_all("Tempering temperature fix is not valid");
+    error->universe_all(FLERR,"Tempering temperature fix is not valid");
 
   // setup for long tempering run
 
@@ -107,7 +107,7 @@ void Temper::command(int narg, char **arg)
   update->beginstep = update->firststep = update->ntimestep;
   update->endstep = update->laststep = update->firststep + nsteps;
   if (update->laststep < 0 || update->laststep > MAXBIGINT)
-    error->all("Too many timesteps");
+    error->all(FLERR,"Too many timesteps");
 
   lmp->init();
 
@@ -123,7 +123,7 @@ void Temper::command(int narg, char **arg)
   // notify compute it will be called at first swap
 
   int id = modify->find_compute("thermo_pe");
-  if (id < 0) error->all("Tempering could not find thermo_pe compute");
+  if (id < 0) error->all(FLERR,"Tempering could not find thermo_pe compute");
   Compute *pe_compute = modify->compute[id];
   pe_compute->addstep(update->ntimestep + nevery);
 
diff --git a/src/SHOCK/fix_append_atoms.cpp b/src/SHOCK/fix_append_atoms.cpp
index 8036c27248a2abb0c83d8497fbf6ac0f9dd76d1a..42fd494f96bb63e21584844a236985fd76435d32 100644
--- a/src/SHOCK/fix_append_atoms.cpp
+++ b/src/SHOCK/fix_append_atoms.cpp
@@ -41,7 +41,7 @@ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) :
   box_change = 1;
   time_depend = 1;
 
-  if (narg < 4) error->all("Illegal fix append_atoms command");
+  if (narg < 4) error->all(FLERR,"Illegal fix append_atoms command");
 
   scaleflag = 1;
   spatflag=0;
@@ -61,41 +61,41 @@ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) :
   iarg = 3;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"xlo") == 0) {
-      error->all("Only zhi currently implemented for append_atoms");
+      error->all(FLERR,"Only zhi currently implemented for append_atoms");
       xloflag = 1;
       iarg++;
-      if (domain->boundary[0][0] != 3) error->all("Must shrink-wrap with minimum the append boundary");
+      if (domain->boundary[0][0] != 3) error->all(FLERR,"Must shrink-wrap with minimum the append boundary");
     } else if (strcmp(arg[iarg],"xhi") == 0) {
-      error->all("Only zhi currently implemented for append_atom");
+      error->all(FLERR,"Only zhi currently implemented for append_atom");
       xhiflag = 1;
       iarg++;
-      if (domain->boundary[0][1] != 3) error->all("Must shrink-wrap with minimum th append boundary");
+      if (domain->boundary[0][1] != 3) error->all(FLERR,"Must shrink-wrap with minimum th append boundary");
     } else if (strcmp(arg[iarg],"ylo") == 0) {
-      error->all("Only zhi currently implemented for append_atom");
+      error->all(FLERR,"Only zhi currently implemented for append_atom");
       yloflag = 1;
       iarg++;
-      if (domain->boundary[1][0] != 3) error->all("Must shrink-wrap with minimum th append boundary");
+      if (domain->boundary[1][0] != 3) error->all(FLERR,"Must shrink-wrap with minimum th append boundary");
     } else if (strcmp(arg[iarg],"yhi") == 0) {
-      error->all("Only zhi currently implemented for append_atom");
+      error->all(FLERR,"Only zhi currently implemented for append_atom");
       yhiflag = 1;
       iarg++;
-      if (domain->boundary[1][1] != 3) error->all("Must shrink-wrap with minimum th append boundary");
+      if (domain->boundary[1][1] != 3) error->all(FLERR,"Must shrink-wrap with minimum th append boundary");
     } else if (strcmp(arg[iarg],"zlo") == 0) {
-      error->all("Only zhi currently implemented for append_atom");
+      error->all(FLERR,"Only zhi currently implemented for append_atom");
       zloflag = 1;
       iarg++;
-      if (domain->boundary[2][0] != 3) error->all("Must shrink-wrap with minimum th append boundary");
+      if (domain->boundary[2][0] != 3) error->all(FLERR,"Must shrink-wrap with minimum th append boundary");
     } else if (strcmp(arg[iarg],"zhi") == 0) {
       zhiflag = 1;
       iarg++;
-      if (domain->boundary[2][1] != 3) error->all("Must shrink-wrap with minimum th append boundary");
+      if (domain->boundary[2][1] != 3) error->all(FLERR,"Must shrink-wrap with minimum th append boundary");
     } else if (strcmp(arg[iarg],"freq") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix append_atoms command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix append_atoms command");
       freq = atoi(arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"spatial") == 0) {
-      if (iarg+3 > narg) error->all("Illegal fix append_atoms command");
-      if (strcmp(arg[iarg+1],"f_") == 0) error->all("Bad fix ID in fix append_atoms command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal fix append_atoms command");
+      if (strcmp(arg[iarg+1],"f_") == 0) error->all(FLERR,"Bad fix ID in fix append_atoms command");
       spatflag = 1;
       int n = strlen(arg[iarg+1]);
       spatlead = atof(arg[iarg+2]);
@@ -108,56 +108,56 @@ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) :
       iarg += 3;
  // NEED TO CHECK TO MAKE SURE FIX IS AN AVE/SPATIAL
     } else if (strcmp(arg[iarg],"size") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix append_atoms command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix append_atoms command");
       size = atof(arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"units") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix append_atoms command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix append_atoms command");
       if (strcmp(arg[iarg+1],"box") == 0) scaleflag = 0;
       else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1;
-      else error->all("Illegal fix append_atoms command");
+      else error->all(FLERR,"Illegal fix append_atoms command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"random") == 0) {
-      if (iarg+5 > narg) error->all("Illegal fix append_atoms command");
+      if (iarg+5 > narg) error->all(FLERR,"Illegal fix append_atoms command");
       ranflag = 1;
       ranx = atof(arg[iarg+1]);
       rany = atof(arg[iarg+2]);
       ranz = atof(arg[iarg+3]);
       xseed = atoi(arg[iarg+4]);
-      if (xseed <= 0) error->all("Illegal fix append_atoms command");
+      if (xseed <= 0) error->all(FLERR,"Illegal fix append_atoms command");
       randomx = new RanMars(lmp,xseed + comm->me);
       iarg += 5;
     } else if (strcmp(arg[iarg],"temp") == 0) {
-      if (iarg+5 > narg) error->all("Illegal fix append_atoms command");
+      if (iarg+5 > narg) error->all(FLERR,"Illegal fix append_atoms command");
       tempflag = 1;
       t_target = atof(arg[iarg+1]);
       t_period = atof(arg[iarg+2]);
       tseed    = atoi(arg[iarg+3]);
       t_extent = atof(arg[iarg+4]);
-      if (t_target <= 0) error->all("Illegal fix append_atoms command");
-      if (t_period <= 0) error->all("Illegal fix append_atoms command");
-      if (t_extent <= 0) error->all("Illegal fix append_atoms command");
-      if (tseed <= 0) error->all("Illegal fix append_atoms command");
+      if (t_target <= 0) error->all(FLERR,"Illegal fix append_atoms command");
+      if (t_period <= 0) error->all(FLERR,"Illegal fix append_atoms command");
+      if (t_extent <= 0) error->all(FLERR,"Illegal fix append_atoms command");
+      if (tseed <= 0) error->all(FLERR,"Illegal fix append_atoms command");
       randomt = new RanMars(lmp,tseed + comm->me);
       gfactor1 = new double[atom->ntypes+1];
       gfactor2 = new double[atom->ntypes+1];
       iarg += 5;
-    } else error->all("Illegal fix append_atoms command");
+    } else error->all(FLERR,"Illegal fix append_atoms command");
   }
 
   if ((xloflag || xhiflag) && domain->xperiodic)
-    error->all("Cannot use append_atoms in periodic dimension");
+    error->all(FLERR,"Cannot use append_atoms in periodic dimension");
   if ((yloflag || yhiflag) && domain->yperiodic)
-    error->all("Cannot use append_atoms in periodic dimension");
+    error->all(FLERR,"Cannot use append_atoms in periodic dimension");
   if ((zloflag || zhiflag) && domain->zperiodic)
-    error->all("Cannot use append_atoms in periodic dimension");
+    error->all(FLERR,"Cannot use append_atoms in periodic dimension");
 
-  if (domain->triclinic == 1) error->all("Cannot append atoms to a triclinic box");
+  if (domain->triclinic == 1) error->all(FLERR,"Cannot append atoms to a triclinic box");
 
   // setup scaling
 
   if (scaleflag && domain->lattice == NULL)
-    error->all("Use of fix append_atoms with undefined lattice");
+    error->all(FLERR,"Use of fix append_atoms with undefined lattice");
 
   double xscale,yscale,zscale;
   if (scaleflag) {
@@ -226,7 +226,7 @@ int FixAppendAtoms::get_spatial()
   if (update->ntimestep % freq == 0) {
     int ifix = modify->find_fix(spatialid);
     if (ifix < 0)
-      error->all("Fix ID for fix ave/spatial does not exist");
+      error->all(FLERR,"Fix ID for fix ave/spatial does not exist");
     Fix *fix = modify->fix[ifix];  
 
     int failed = 0; 
@@ -382,7 +382,7 @@ void FixAppendAtoms::pre_exchange()
 	nbasis = domain->lattice->nbasis;
 	basistype = new int[nbasis];
 	for (int i = 0; i < nbasis; i++) basistype[i] = 1;
-      } else error->all("must define lattice to append_atoms");
+      } else error->all(FLERR,"must define lattice to append_atoms");
 
       double bboxlo[3],bboxhi[3];
 
diff --git a/src/SHOCK/fix_msst.cpp b/src/SHOCK/fix_msst.cpp
index 90cb7b3241b7bf4d333fbadf2ea021eb72a23182..1ba47ee14680d7caceec86bf2bb4f279b224169c 100644
--- a/src/SHOCK/fix_msst.cpp
+++ b/src/SHOCK/fix_msst.cpp
@@ -41,7 +41,7 @@ using namespace LAMMPS_NS;
 FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 4) error->all("Illegal fix msst command");
+  if (narg < 4) error->all(FLERR,"Illegal fix msst command");
 
   restart_global = 1;
   box_change = 1;
@@ -76,12 +76,12 @@ FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) :
   else if ( strcmp(arg[3],"z") == 0 )
     direction = 2;
   else {
-    error->all("Illegal fix msst command");
+    error->all(FLERR,"Illegal fix msst command");
   }
 
   velocity = atof(arg[4]);   
   if ( velocity < 0 )
-    error->all("Illegal fix msst command");
+    error->all(FLERR,"Illegal fix msst command");
 
   for ( int iarg = 5; iarg < narg; iarg++ ) {
     if ( strcmp(arg[iarg],"q") == 0 ) {
@@ -105,9 +105,9 @@ FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) :
     } else if ( strcmp(arg[iarg],"tscale") == 0 ) {
       tscale = atof(arg[iarg+1]);
       if (tscale < 0.0 || tscale > 1.0)
-	error->all("Fix msst tscale must satisfy 0 <= tscale < 1");
+	error->all(FLERR,"Fix msst tscale must satisfy 0 <= tscale < 1");
       iarg++;
-    } else error->all("Illegal fix msst command");
+    } else error->all(FLERR,"Illegal fix msst command");
   }
 
   if (comm->me == 0) {
@@ -161,7 +161,7 @@ FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) :
 
   // check for periodicity in controlled dimensions
 
-  if (domain->nonperiodic) error->all("Fix msst requires a periodic box");
+  if (domain->nonperiodic) error->all(FLERR,"Fix msst requires a periodic box");
 
   // create a new compute temp style
   // id = fix-ID + temp
@@ -267,7 +267,7 @@ int FixMSST::setmask()
 void FixMSST::init()
 {
   if (atom->mass == NULL)
-    error->all("Cannot use fix msst without per-type mass defined");
+    error->all(FLERR,"Cannot use fix msst without per-type mass defined");
 
   // set compute ptrs
 
@@ -275,13 +275,13 @@ void FixMSST::init()
   int ipress = modify->find_compute(id_press);
   int ipe = modify->find_compute(id_pe);
   if (itemp < 0 || ipress < 0|| ipe < 0)
-    error->all("Could not find fix msst compute ID");
+    error->all(FLERR,"Could not find fix msst compute ID");
   if (modify->compute[itemp]->tempflag == 0)
-    error->all("Fix msst compute ID does not compute temperature");
+    error->all(FLERR,"Fix msst compute ID does not compute temperature");
   if (modify->compute[ipress]->pressflag == 0)
-    error->all("Fix msst compute ID does not compute pressure");
+    error->all(FLERR,"Fix msst compute ID does not compute pressure");
   if (modify->compute[ipe]->peflag == 0)
-    error->all("Fix msst compute ID does not compute potential energy");
+    error->all(FLERR,"Fix msst compute ID does not compute potential energy");
 
   temperature = modify->compute[itemp];
   pressure = modify->compute[ipress];
@@ -739,7 +739,7 @@ void FixMSST::restart(char *buf)
 int FixMSST::modify_param(int narg, char **arg)
 {
   if (strcmp(arg[0],"temp") == 0) {
-    if (narg < 2) error->all("Illegal fix_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
     if (tflag) {
       modify->delete_compute(id_temp);
       tflag = 0;
@@ -750,18 +750,18 @@ int FixMSST::modify_param(int narg, char **arg)
     strcpy(id_temp,arg[1]);
 
     int icompute = modify->find_compute(id_temp);
-    if (icompute < 0) error->all("Could not find fix_modify temperature ID");
+    if (icompute < 0) error->all(FLERR,"Could not find fix_modify temperature ID");
     temperature = modify->compute[icompute];
 
     if (temperature->tempflag == 0)
-      error->all("Fix_modify temperature ID does not compute temperature");
+      error->all(FLERR,"Fix_modify temperature ID does not compute temperature");
     if (temperature->igroup != 0 && comm->me == 0)
-      error->warning("Temperature for MSST is not for group all");
+      error->warning(FLERR,"Temperature for MSST is not for group all");
 
     return 2;
 
   } else if (strcmp(arg[0],"press") == 0) {
-    if (narg < 2) error->all("Illegal fix_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
     if (pflag) {
       modify->delete_compute(id_press);
       pflag = 0;
@@ -772,11 +772,11 @@ int FixMSST::modify_param(int narg, char **arg)
     strcpy(id_press,arg[1]);
 
     int icompute = modify->find_compute(id_press);
-    if (icompute < 0) error->all("Could not find fix_modify pressure ID");
+    if (icompute < 0) error->all(FLERR,"Could not find fix_modify pressure ID");
     pressure = modify->compute[icompute];
 
     if (pressure->pressflag == 0)
-      error->all("Fix_modify pressure ID does not compute pressure");
+      error->all(FLERR,"Fix_modify pressure ID does not compute pressure");
     return 2;
   }
   return 0;
diff --git a/src/SHOCK/fix_nphug.cpp b/src/SHOCK/fix_nphug.cpp
index 85463535c9db51dba8eb1e3fd6a3cfbf4818ad17..32230940d53419b046c643a876c935a97952ac45 100644
--- a/src/SHOCK/fix_nphug.cpp
+++ b/src/SHOCK/fix_nphug.cpp
@@ -60,7 +60,7 @@ FixNPHug::FixNPHug(LAMMPS *lmp, int narg, char **arg) :
   if (p_start[0] != p_stop[0] ||
       p_start[1] != p_stop[1] ||  
       p_start[2] != p_stop[2])
-    error->all("Invalid argument for fix nphug");
+    error->all(FLERR,"Invalid argument for fix nphug");
 
   // uniaxial = 0 means hydrostatic compression
   // uniaxial = 1 means uniaxial compression
@@ -96,7 +96,7 @@ FixNPHug::FixNPHug(LAMMPS *lmp, int narg, char **arg) :
       uniaxial = 1;
       idir = 2;
 
-    } else error->all("Invalid argument for fix nphug");
+    } else error->all(FLERR,"Invalid argument for fix nphug");
 
     // triclinic hydrostatic compression
 
@@ -109,13 +109,13 @@ FixNPHug::FixNPHug(LAMMPS *lmp, int narg, char **arg) :
 	p_start[5] == 0.0 )
       uniaxial = 0;
 
-    else error->all("Invalid argument for fix nphug");
+    else error->all(FLERR,"Invalid argument for fix nphug");
   }
 
   if (!tstat_flag)
-    error->all("Temperature control must be used with fix nphug");
+    error->all(FLERR,"Temperature control must be used with fix nphug");
   if (!pstat_flag)
-    error->all("Pressure control must be used with fix nphug");
+    error->all(FLERR,"Pressure control must be used with fix nphug");
 
   // create a new compute temp style
   // id = fix-ID + temp
@@ -195,7 +195,7 @@ void FixNPHug::init()
 
   int icompute = modify->find_compute(id_pe);
   if (icompute < 0) 
-    error->all("Potential energy ID for fix nvt/nph/npt does not exist");
+    error->all(FLERR,"Potential energy ID for fix nvt/nph/npt does not exist");
   pe = modify->compute[icompute];
 }
 
@@ -440,17 +440,17 @@ void FixNPHug::restart(char *buf)
 int FixNPHug::modify_param(int narg, char **arg)
 {
   if (strcmp(arg[0],"e0") == 0) {
-    if (narg < 2) error->all("Illegal fix nphug command");
+    if (narg < 2) error->all(FLERR,"Illegal fix nphug command");
     e0 = atof(arg[1]);
     e0_set = 1;
     return 2;
   } else if (strcmp(arg[0],"v0") == 0) {
-    if (narg < 2) error->all("Illegal fix nphug command");
+    if (narg < 2) error->all(FLERR,"Illegal fix nphug command");
     v0 = atof(arg[1]);
     v0_set = 1;
     return 2;
   } else if (strcmp(arg[0],"p0") == 0) {
-    if (narg < 2) error->all("Illegal fix nphug command");
+    if (narg < 2) error->all(FLERR,"Illegal fix nphug command");
     p0 = atof(arg[1]);
     p0_set = 1;
     return 2;
diff --git a/src/SHOCK/fix_wall_piston.cpp b/src/SHOCK/fix_wall_piston.cpp
index e639b62858f3dc0d9d3229ac3db75cc37e1bd5e4..2d610ea2e0937da6837f3026229a4d65ab9648b8 100644
--- a/src/SHOCK/fix_wall_piston.cpp
+++ b/src/SHOCK/fix_wall_piston.cpp
@@ -37,7 +37,7 @@ FixWallPiston::FixWallPiston(LAMMPS *lmp, int narg, char **arg) :
   box_change = 1;
   time_depend = 1;
 
-  if (narg < 4) error->all("Illegal fix wall/piston command");
+  if (narg < 4) error->all(FLERR,"Illegal fix wall/piston command");
 
   randomt = NULL;
   tempflag = 0;
@@ -54,38 +54,38 @@ FixWallPiston::FixWallPiston(LAMMPS *lmp, int narg, char **arg) :
   int iarg = 0;
   iarg = 3;
   while (iarg < narg) {
-    if (strcmp(arg[iarg],"xlo") == 0) { error->all("Fix wall/piston command only available at zlo");
-    } else if (strcmp(arg[iarg],"ylo") == 0) { error->all("Fix wall/piston command only available at zlo");
+    if (strcmp(arg[iarg],"xlo") == 0) { error->all(FLERR,"Fix wall/piston command only available at zlo");
+    } else if (strcmp(arg[iarg],"ylo") == 0) { error->all(FLERR,"Fix wall/piston command only available at zlo");
     } else if (strcmp(arg[iarg],"zlo") == 0) {
       zloflag = 1;
       iarg++;
-      if (domain->boundary[2][0] != 2) error->all("Must shrink-wrap piston boundary");
-    } else if (strcmp(arg[iarg],"xhi") == 0) { error->all("Fix wall/piston command only available at zlo");
-    } else if (strcmp(arg[iarg],"yhi") == 0) { error->all("Fix wall/piston command only available at zlo");
-    } else if (strcmp(arg[iarg],"zhi") == 0) { error->all("Fix wall/piston command only available at zlo");
+      if (domain->boundary[2][0] != 2) error->all(FLERR,"Must shrink-wrap piston boundary");
+    } else if (strcmp(arg[iarg],"xhi") == 0) { error->all(FLERR,"Fix wall/piston command only available at zlo");
+    } else if (strcmp(arg[iarg],"yhi") == 0) { error->all(FLERR,"Fix wall/piston command only available at zlo");
+    } else if (strcmp(arg[iarg],"zhi") == 0) { error->all(FLERR,"Fix wall/piston command only available at zlo");
     } else if (strcmp(arg[iarg],"vel") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix wall/piston command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix wall/piston command");
       vx = atof(arg[iarg+1]);
       vy = atof(arg[iarg+2]);
       vz = atof(arg[iarg+3]);
       iarg += 4;
     } else if (strcmp(arg[iarg],"pos") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix wall/piston command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix wall/piston command");
       x0 = atof(arg[iarg+1]);
       y0 = atof(arg[iarg+2]);
       z0 = atof(arg[iarg+3]);
       iarg += 4;
     } else if (strcmp(arg[iarg],"temp") == 0) {
-      if (iarg+5 > narg) error->all("Illegal fix wall/pistons command");
+      if (iarg+5 > narg) error->all(FLERR,"Illegal fix wall/pistons command");
       tempflag = 1;
       t_target = atof(arg[iarg+1]);
       t_period = atof(arg[iarg+2]);
       tseed    = atoi(arg[iarg+3]);
       t_extent = atof(arg[iarg+4]);
-      if (t_target <= 0) error->all("Illegal fix wall/piston command");
-      if (t_period <= 0) error->all("Illegal fix wall/piston command");
-      if (t_extent <= 0) error->all("Illegal fix wall/piston command");
-      if (tseed <= 0) error->all("Illegal fix wall/pistons command");
+      if (t_target <= 0) error->all(FLERR,"Illegal fix wall/piston command");
+      if (t_period <= 0) error->all(FLERR,"Illegal fix wall/piston command");
+      if (t_extent <= 0) error->all(FLERR,"Illegal fix wall/piston command");
+      if (tseed <= 0) error->all(FLERR,"Illegal fix wall/pistons command");
       randomt = new RanMars(lmp,tseed + comm->me);
       gfactor1 = new double[atom->ntypes+1];
       gfactor2 = new double[atom->ntypes+1];
@@ -113,26 +113,26 @@ FixWallPiston::FixWallPiston(LAMMPS *lmp, int narg, char **arg) :
       rampNL5flag = 1;
       iarg++;
     } else if (strcmp(arg[iarg],"units") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix wall/piston command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix wall/piston command");
       if (strcmp(arg[iarg+1],"box") == 0) scaleflag = 0;
       else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1;
-      else error->all("Illegal fix wall/piston command");
+      else error->all(FLERR,"Illegal fix wall/piston command");
       iarg += 2;
-    } else error->all("Illegal fix wall/piston command");
+    } else error->all(FLERR,"Illegal fix wall/piston command");
   }
 
-  if (vx < 0.0 || vy < 0.0 || vz < 0.0) error->all("Illegal fix wall/piston velocity");
+  if (vx < 0.0 || vy < 0.0 || vz < 0.0) error->all(FLERR,"Illegal fix wall/piston velocity");
   if ((xloflag || xhiflag) && domain->xperiodic)
-    error->all("Cannot use wall in periodic dimension");
+    error->all(FLERR,"Cannot use wall in periodic dimension");
   if ((yloflag || yhiflag) && domain->yperiodic)
-    error->all("Cannot use wall in periodic dimension");
+    error->all(FLERR,"Cannot use wall in periodic dimension");
   if ((zloflag || zhiflag) && domain->zperiodic)
-    error->all("Cannot use wall in periodic dimension");
+    error->all(FLERR,"Cannot use wall in periodic dimension");
 
   // setup scaling
 
   if (scaleflag && domain->lattice == NULL)
-    error->all("Use of fix wall/piston with undefined lattice");
+    error->all(FLERR,"Use of fix wall/piston with undefined lattice");
 
   double xscale,yscale,zscale;
   if (scaleflag) {
@@ -209,7 +209,7 @@ void FixWallPiston::post_integrate()
       zlo = z0 + paccelz * (0.5*tt + 1.0/(angfreq*angfreq) - 1.0/(angfreq*angfreq)*cos(angfreq*t));
       vz =  paccelz * (t + 1.0/angfreq*sin(angfreq*t));
     }
-    else { error->all("NL ramp in wall/piston only implemented in zlo for now"); }
+    else { error->all(FLERR,"NL ramp in wall/piston only implemented in zlo for now"); }
   }
   else if (rampNL2flag) {
     paccelz = maxvz / tott;
@@ -219,7 +219,7 @@ void FixWallPiston::post_integrate()
       zlo = z0 + paccelz * (0.5*tt + 4.0/(3.0*angfreq*angfreq)*(1.0-cos(angfreq*t)) + 1.0/(6.0*angfreq*angfreq)*(1.0-cos(2.0*angfreq*t)));
       vz =  paccelz * (t + 4.0/(3.0*angfreq)*sin(angfreq*t) + 1.0/(3.0*angfreq)*sin(2.0*angfreq*t));
     }
-    else { error->all("NL ramp in wall/piston only implemented in zlo for now"); }
+    else { error->all(FLERR,"NL ramp in wall/piston only implemented in zlo for now"); }
   }
   else if (rampNL3flag) {
     paccelz = maxvz / tott;
@@ -228,7 +228,7 @@ void FixWallPiston::post_integrate()
       zlo = z0 + paccelz*tott*tott/2.5 * (t2p5 );
       vz =  paccelz * tott * (t1p5 );
     }
-    else { error->all("NL ramp in wall/piston only implemented in zlo for now"); }
+    else { error->all(FLERR,"NL ramp in wall/piston only implemented in zlo for now"); }
   }
   else if (rampNL4flag) {
     paccelz = maxvz / tott;
@@ -237,7 +237,7 @@ void FixWallPiston::post_integrate()
       zlo = z0 + paccelz/tott/3.0 * (ttt);
       vz =  paccelz / tott * (tt);
     }
-    else { error->all("NL ramp in wall/piston only implemented in zlo for now"); }
+    else { error->all(FLERR,"NL ramp in wall/piston only implemented in zlo for now"); }
   }
   else if (rampNL5flag) {
     paccelz = maxvz / tott;
@@ -246,7 +246,7 @@ void FixWallPiston::post_integrate()
       zlo = z0 + paccelz/tott/tott/4.0 * (tttt);
       vz =  paccelz / tott / tott * (ttt);
     }
-    else { error->all("NL ramp in wall/piston only implemented in zlo for now"); }
+    else { error->all(FLERR,"NL ramp in wall/piston only implemented in zlo for now"); }
   }
   else {
     if (zloflag) { zlo = z0 + vz * t; }
diff --git a/src/SRD/fix_srd.cpp b/src/SRD/fix_srd.cpp
index 1516e23d51ca251587707d73489576527020e509..ec0d07d20d49c35380f077faabe84ffd0fb5b88d 100644
--- a/src/SRD/fix_srd.cpp
+++ b/src/SRD/fix_srd.cpp
@@ -53,9 +53,6 @@ enum{NO_REMAP,X_REMAP,V_REMAP};                   // same as fix_deform.cpp
 #define BIG 1.0e20
 #define VBINSIZE 5
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 //#define SRD_DEBUG 1
 //#define SRD_DEBUG_ATOMID 58
 //#define SRD_DEBUG_TIMESTEP 449
@@ -64,7 +61,7 @@ enum{NO_REMAP,X_REMAP,V_REMAP};                   // same as fix_deform.cpp
 
 FixSRD::FixSRD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
 {
-  if (narg < 8) error->all("Illegal fix srd command");
+  if (narg < 8) error->all(FLERR,"Illegal fix srd command");
 
   restart_pbc = 1;
   vector_flag = 1;
@@ -101,85 +98,85 @@ FixSRD::FixSRD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
   int iarg = 8;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"lamda") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix srd command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix srd command");
       lamda = atof(arg[iarg+1]);
       lamdaflag = 1;
       iarg += 2;
     } else if (strcmp(arg[iarg],"collision") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix srd command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix srd command");
       if (strcmp(arg[iarg+1],"slip") == 0) collidestyle = SLIP;
       else if (strcmp(arg[iarg+1],"noslip") == 0) collidestyle = NOSLIP;
-      else error->all("Illegal fix srd command");
+      else error->all(FLERR,"Illegal fix srd command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"overlap") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix srd command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix srd command");
       if (strcmp(arg[iarg+1],"yes") == 0) overlap = 1;
       else if (strcmp(arg[iarg+1],"no") == 0) overlap = 0;
-      else error->all("Illegal fix srd command");
+      else error->all(FLERR,"Illegal fix srd command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"inside") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix srd command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix srd command");
       if (strcmp(arg[iarg+1],"error") == 0) insideflag = INSIDE_ERROR;
       else if (strcmp(arg[iarg+1],"warn") == 0) insideflag = INSIDE_WARN;
       else if (strcmp(arg[iarg+1],"ignore") == 0) insideflag = INSIDE_IGNORE;
-      else error->all("Illegal fix srd command");
+      else error->all(FLERR,"Illegal fix srd command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"exact") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix srd command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix srd command");
       if (strcmp(arg[iarg+1],"yes") == 0) exactflag = 1;
       else if (strcmp(arg[iarg+1],"no") == 0) exactflag = 0;
-      else error->all("Illegal fix srd command");
+      else error->all(FLERR,"Illegal fix srd command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"radius") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix srd command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix srd command");
       radfactor = atof(arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"bounce") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix srd command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix srd command");
       maxbounceallow = atoi(arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"search") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix srd command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix srd command");
       gridsearch = atof(arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"cubic") == 0) {
-      if (iarg+3 > narg) error->all("Illegal fix srd command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal fix srd command");
       if (strcmp(arg[iarg+1],"error") == 0) cubicflag = CUBIC_ERROR;
       else if (strcmp(arg[iarg+1],"warn") == 0) cubicflag = CUBIC_WARN;
-      else error->all("Illegal fix srd command");
+      else error->all(FLERR,"Illegal fix srd command");
       cubictol = atof(arg[iarg+2]);
       iarg += 3;
     } else if (strcmp(arg[iarg],"shift") == 0) {
-      if (iarg+3 > narg) error->all("Illegal fix srd command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal fix srd command");
       else if (strcmp(arg[iarg+1],"no") == 0) shiftuser = SHIFT_NO;
       else if (strcmp(arg[iarg+1],"yes") == 0) shiftuser = SHIFT_YES;
       else if (strcmp(arg[iarg+1],"possible") == 0) shiftuser = SHIFT_POSSIBLE;
-      else error->all("Illegal fix srd command");
+      else error->all(FLERR,"Illegal fix srd command");
       shiftseed = atoi(arg[iarg+2]);
       iarg += 3;
     } else if (strcmp(arg[iarg],"stream") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix srd command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix srd command");
       if (strcmp(arg[iarg+1],"yes") == 0) streamflag = 1;
       else if (strcmp(arg[iarg+1],"no") == 0) streamflag = 0;
-      else error->all("Illegal fix srd command");
+      else error->all(FLERR,"Illegal fix srd command");
       iarg += 2;
-    } else error->all("Illegal fix srd command");
+    } else error->all(FLERR,"Illegal fix srd command");
   }
 
   // error check
 
-  if (nevery <= 0) error->all("Illegal fix srd command");
-  if (bigexist && biggroup < 0) error->all("Could not find fix srd group ID");
-  if (gridsrd <= 0.0) error->all("Illegal fix srd command");
-  if (temperature_srd <= 0.0) error->all("Illegal fix srd command");
-  if (seed <= 0) error->all("Illegal fix srd command");
-  if (radfactor <= 0.0) error->all("Illegal fix srd command");
-  if (maxbounceallow < 0) error->all("Illegal fix srd command");
-  if (lamdaflag && lamda <= 0.0) error->all("Illegal fix srd command");
-  if (gridsearch <= 0.0) error->all("Illegal fix srd command");
-  if (cubictol < 0.0 || cubictol > 1.0) error->all("Illegal fix srd command");
+  if (nevery <= 0) error->all(FLERR,"Illegal fix srd command");
+  if (bigexist && biggroup < 0) error->all(FLERR,"Could not find fix srd group ID");
+  if (gridsrd <= 0.0) error->all(FLERR,"Illegal fix srd command");
+  if (temperature_srd <= 0.0) error->all(FLERR,"Illegal fix srd command");
+  if (seed <= 0) error->all(FLERR,"Illegal fix srd command");
+  if (radfactor <= 0.0) error->all(FLERR,"Illegal fix srd command");
+  if (maxbounceallow < 0) error->all(FLERR,"Illegal fix srd command");
+  if (lamdaflag && lamda <= 0.0) error->all(FLERR,"Illegal fix srd command");
+  if (gridsearch <= 0.0) error->all(FLERR,"Illegal fix srd command");
+  if (cubictol < 0.0 || cubictol > 1.0) error->all(FLERR,"Illegal fix srd command");
   if ((shiftuser == SHIFT_YES || shiftuser == SHIFT_POSSIBLE) && 
-      shiftseed <= 0) error->all("Illegal fix srd command");
+      shiftseed <= 0) error->all(FLERR,"Illegal fix srd command");
 
   // initialize Marsaglia RNG with processor-unique seed
 
@@ -290,13 +287,13 @@ void FixSRD::init()
 {
   // error checks
 
-  if (force->newton_pair == 0) error->all("Fix srd requires newton pair on");
+  if (force->newton_pair == 0) error->all(FLERR,"Fix srd requires newton pair on");
   if (bigexist && comm->ghost_velocity == 0)
-    error->all("Fix srd requires ghost atoms store velocity");
+    error->all(FLERR,"Fix srd requires ghost atoms store velocity");
   if (bigexist && collidestyle == NOSLIP && !atom->torque_flag)
-    error->all("Fix SRD no-slip requires atom attribute torque");
+    error->all(FLERR,"Fix SRD no-slip requires atom attribute torque");
   if (initflag && update->dt != dt_big)
-    error->all("Cannot change timestep once fix srd is setup");
+    error->all(FLERR,"Cannot change timestep once fix srd is setup");
 
   // orthogonal vs triclinic simulation box
   // could be static or shearing box
@@ -308,7 +305,7 @@ void FixSRD::init()
   wallexist = 0;
   for (int m = 0; m < modify->nfix; m++) {
     if (strcmp(modify->fix[m]->style,"wall/srd") == 0) {
-      if (wallexist) error->all("Cannot use fix wall/srd more than once");
+      if (wallexist) error->all(FLERR,"Cannot use fix wall/srd more than once");
       wallexist = 1;
       wallfix = (FixWallSRD *) modify->fix[m];
       nwall = wallfix->nwall;
@@ -320,7 +317,7 @@ void FixSRD::init()
       fwall = wallfix->fwall;
       walltrigger = 0.5 * neighbor->skin;
       if (wallfix->overlap && overlap == 0 && me == 0)
-	error->warning("Fix SRD walls overlap but fix srd overlap not set");
+	error->warning(FLERR,"Fix SRD walls overlap but fix srd overlap not set");
     }
   }
 
@@ -335,7 +332,7 @@ void FixSRD::init()
       if (strcmp(modify->fix[i]->style,"deform") == 0) {
 	FixDeform *deform = (FixDeform *) modify->fix[i];
 	if (deform->box_change_shape && deform->remapflag != V_REMAP)
-	  error->all("Using fix srd with inconsistent "
+	  error->all(FLERR,"Using fix srd with inconsistent "
 		     "fix deform remap option");
       }
     }
@@ -392,7 +389,7 @@ void FixSRD::setup(int vflag)
   setup_bounds();
 
   if (dist_srd_reneigh < nevery*dt_big*vmax && me == 0)
-    error->warning("Fix srd SRD moves may trigger frequent reneighboring");
+    error->warning(FLERR,"Fix srd SRD moves may trigger frequent reneighboring");
 
   // setup search bins and search stencil based on these distances
 
@@ -513,7 +510,7 @@ void FixSRD::pre_neighbor()
 
 	if (ix < 0 || ix >= nbin2x || iy < 0 || iy >= nbin2y || 
 	    iz < 0 || iz >= nbin2z)
-	  error->one("Fix SRD: bad search bin assignment");
+	  error->one(FLERR,"Fix SRD: bad search bin assignment");
       
 	cutbinsq = biglist[nbig].cutbinsq;
 	for (j = 0; j < nstencil; j++) {
@@ -527,13 +524,13 @@ void FixSRD::pre_neighbor()
 		   atom->tag[i],i,x[i][0],x[i][1],x[i][2]);
 	    printf("Bin indices: %d %d %d, %d %d %d, %d %d %d\n",
 		   ix,iy,iz,jx,jy,jz,nbin2x,nbin2y,nbin2z);
-	    error->one("Fix SRD: bad stencil bin for big particle");
+	    error->one(FLERR,"Fix SRD: bad stencil bin for big particle");
 	  }
 	  rsq = point_bin_distance(x[i],jx,jy,jz);
 	  if (rsq < cutbinsq) {
 	    jbin = ibin + stencil[j][3];
 	    if (nbinbig[jbin] == ATOMPERBIN)
-	      error->one("Fix SRD: too many big particles in bin");
+	      error->one(FLERR,"Fix SRD: too many big particles in bin");
 	    binbig[jbin][nbinbig[jbin]++] = nbig;
 	  }
 	}
@@ -562,12 +559,12 @@ void FixSRD::pre_neighbor()
 	if (side == 0) {
 	  hi = static_cast<int> ((xwall[m]+delta-xblo2)*bininv2x);
 	  if (hi < 0) continue;
-	  if (hi >= nbin2x) error->all("Fix SRD: bad search bin assignment");
+	  if (hi >= nbin2x) error->all(FLERR,"Fix SRD: bad search bin assignment");
 	  lo = 0;
 	} else {
 	  lo = static_cast<int> ((xwall[m]-delta-xblo2)*bininv2x);
 	  if (lo >= nbin2x) continue;
-	  if (lo < 0) error->all("Fix SRD: bad search bin assignment");
+	  if (lo < 0) error->all(FLERR,"Fix SRD: bad search bin assignment");
 	  hi = nbin2x-1;
 	}
 
@@ -576,7 +573,7 @@ void FixSRD::pre_neighbor()
 	    for (iz = 0; iz < nbin2z; iz++) {
 	      ibin = iz*nbin2y*nbin2x + iy*nbin2x + ix;
 	      if (nbinbig[ibin] == ATOMPERBIN)
-		error->all("Fix SRD: too many walls in bin");
+		error->all(FLERR,"Fix SRD: too many walls in bin");
 	      binbig[ibin][nbinbig[ibin]++] = nbig+m;
 	    }
 
@@ -584,12 +581,12 @@ void FixSRD::pre_neighbor()
 	if (side == 0) {
 	  hi = static_cast<int> ((xwall[m]+delta-yblo2)*bininv2y);
 	  if (hi < 0) continue;
-	  if (hi >= nbin2y) error->all("Fix SRD: bad search bin assignment");
+	  if (hi >= nbin2y) error->all(FLERR,"Fix SRD: bad search bin assignment");
 	  lo = 0;
 	} else {
 	  lo = static_cast<int> ((xwall[m]-delta-yblo2)*bininv2y);
 	  if (lo >= nbin2y) continue;
-	  if (lo < 0) error->all("Fix SRD: bad search bin assignment");
+	  if (lo < 0) error->all(FLERR,"Fix SRD: bad search bin assignment");
 	  hi = nbin2y-1;
 	}
 
@@ -598,7 +595,7 @@ void FixSRD::pre_neighbor()
 	    for (iz = 0; iz < nbin2z; iz++) {
 	      ibin = iz*nbin2y*nbin2x + iy*nbin2x + ix;
 	      if (nbinbig[ibin] == ATOMPERBIN)
-		error->all("Fix SRD: too many walls in bin");
+		error->all(FLERR,"Fix SRD: too many walls in bin");
 	      binbig[ibin][nbinbig[ibin]++] = nbig+m;
 	    }
 
@@ -606,12 +603,12 @@ void FixSRD::pre_neighbor()
 	if (side == 0) {
 	  hi = static_cast<int> ((xwall[m]+delta-zblo2)*bininv2z);
 	  if (hi < 0) continue;
-	  if (hi >= nbin2z) error->all("Fix SRD: bad search bin assignment");
+	  if (hi >= nbin2z) error->all(FLERR,"Fix SRD: bad search bin assignment");
 	  lo = 0;
 	} else {
 	  lo = static_cast<int> ((xwall[m]-delta-zblo2)*bininv2z);
 	  if (lo >= nbin2z) continue;
-	  if (lo < 0) error->all("Fix SRD: bad search bin assignment");
+	  if (lo < 0) error->all(FLERR,"Fix SRD: bad search bin assignment");
 	  hi = nbin2z-1;
 	}
 
@@ -620,7 +617,7 @@ void FixSRD::pre_neighbor()
 	    for (iy = 0; iy < nbin2y; iy++) {
 	      ibin = iz*nbin2y*nbin2x + iy*nbin2x + ix;
 	      if (nbinbig[ibin] == ATOMPERBIN)
-		error->all("Fix SRD: too many walls in bin");
+		error->all(FLERR,"Fix SRD: too many walls in bin");
 	      binbig[ibin][nbinbig[ibin]++] = nbig+m;
 	    }
       }
@@ -696,7 +693,7 @@ void FixSRD::post_force(int vflag)
 	    fprintf(screen,"ix,iy,iz nx,ny,nz = %d %d %d %d %d %d\n",
 		    ix,iy,iz,nbin2x,nbin2y,nbin2z);
 	  }
-	  error->one("Fix SRD: bad bin assignment for SRD advection");
+	  error->one(FLERR,"Fix SRD: bad bin assignment for SRD advection");
 	}
       }
 
@@ -1155,8 +1152,8 @@ void FixSRD::collisions_single()
 			"inside big particle %d on step " BIGINT_FORMAT 
 			" bounce %d\n",
 			atom->tag[i],atom->tag[j],update->ntimestep,ibounce+1);
-	      if (insideflag == INSIDE_ERROR) error->one(str);
-	      error->warning(str);
+	      if (insideflag == INSIDE_ERROR) error->one(FLERR,str);
+	      error->warning(FLERR,str);
 	    }
 	    break;
 	  }
@@ -1294,8 +1291,8 @@ void FixSRD::collisions_multi()
 		      "inside big particle %d on step " BIGINT_FORMAT 
 		      " bounce %d\n",
 		      atom->tag[i],atom->tag[j],update->ntimestep,ibounce+1);
-	      if (insideflag == INSIDE_ERROR) error->one(str);
-	      error->warning(str);
+	      if (insideflag == INSIDE_ERROR) error->one(FLERR,str);
+	      error->warning(FLERR,str);
 	    }
 	    t_first = 0.0;
 	    break;
@@ -2066,7 +2063,7 @@ int FixSRD::update_srd(int i, double dt, double *xscoll, double *vsnew,
       xs[1] < srdlo[1] || xs[1] > srdhi[1] || 
       xs[2] < srdlo[2] || xs[2] > srdhi[2]) {
     if (screen) {
-      error->warning("Fix srd particle moved outside valid domain");
+      error->warning(FLERR,"Fix srd particle moved outside valid domain");
       fprintf(screen,"  particle %d on proc %d at timestep " BIGINT_FORMAT,
 	      atom->tag[i],me,update->ntimestep);
       fprintf(screen,"  xnew %g %g %g\n",xs[0],xs[1],xs[2]);
@@ -2127,7 +2124,7 @@ void FixSRD::parameterize()
 	minbigdiam = MIN(minbigdiam,2.0*shape[1]);
 	minbigdiam = MIN(minbigdiam,2.0*shape[2]);
       } else 
-	error->one("Big particle in fix srd cannot be point particle");
+	error->one(FLERR,"Big particle in fix srd cannot be point particle");
     }
 
   double tmp = maxbigdiam;
@@ -2169,7 +2166,7 @@ void FixSRD::parameterize()
   int flagall;
   MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_MAX,world);
   if (flagall) 
-    error->all("Fix srd requires SRD particles all have same mass");
+    error->all(FLERR,"Fix srd requires SRD particles all have same mass");
 
   // set temperature and lamda of SRD particles from each other
   // lamda = dt_srd * sqrt(boltz * temperature_srd / mass_srd);
@@ -2339,7 +2336,7 @@ void FixSRD::parameterize()
 
   if (nbin1x < comm->procgrid[0] || nbin1y < comm->procgrid[1] || 
       nbin1z < comm->procgrid[2]) 
-    error->all("Fewer SRD bins than processors in some dimension");
+    error->all(FLERR,"Fewer SRD bins than processors in some dimension");
 
   // check if SRD bins are within tolerance for shape and size
 
@@ -2353,9 +2350,9 @@ void FixSRD::parameterize()
 
   if (tolflag) {
     if (cubicflag == CUBIC_ERROR)
-      error->all("SRD bins for fix srd are not cubic enough");
+      error->all(FLERR,"SRD bins for fix srd are not cubic enough");
     if (me == 0)
-      error->warning("SRD bins for fix srd are not cubic enough");
+      error->warning(FLERR,"SRD bins for fix srd are not cubic enough");
   }
 
   tolflag = 0;
@@ -2370,9 +2367,9 @@ void FixSRD::parameterize()
 
   if (tolflag) {
     if (cubicflag == CUBIC_ERROR)
-      error->all("SRD bin size for fix srd differs from user request");
+      error->all(FLERR,"SRD bin size for fix srd differs from user request");
     if (me == 0)
-      error->warning("SRD bin size for fix srd differs from user request");
+      error->warning(FLERR,"SRD bin size for fix srd differs from user request");
   }
 
   // error if lamda < 0.6 of SRD grid size and no shifting allowed
@@ -2383,21 +2380,21 @@ void FixSRD::parameterize()
 
   shiftflag = 0;
   if (lamda < 0.6*maxgridsrd && shiftuser == SHIFT_NO)
-    error->all("Fix srd lamda must be >= 0.6 of SRD grid size");
+    error->all(FLERR,"Fix srd lamda must be >= 0.6 of SRD grid size");
   else if (lamda < 0.6*maxgridsrd && shiftuser == SHIFT_POSSIBLE) {
     shiftflag = 1;
     if (me == 0) 
-      error->warning("SRD bin shifting turned on due to small lamda");
+      error->warning(FLERR,"SRD bin shifting turned on due to small lamda");
   } else if (shiftuser == SHIFT_YES) shiftflag = 1;
 
   // warnings
 
   if (bigexist && maxgridsrd > 0.25 * minbigdiam && me == 0)
-    error->warning("Fix srd grid size > 1/4 of big particle diameter");
+    error->warning(FLERR,"Fix srd grid size > 1/4 of big particle diameter");
   if (viscosity < 0.0 && me == 0)
-    error->warning("Fix srd viscosity < 0.0 due to low SRD density");
+    error->warning(FLERR,"Fix srd viscosity < 0.0 due to low SRD density");
   if (bigexist && dt_big*vmax > minbigdiam && me == 0)
-    error->warning("Fix srd particles may move > big particle diameter");
+    error->warning(FLERR,"Fix srd particles may move > big particle diameter");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/SRD/fix_wall_srd.cpp b/src/SRD/fix_wall_srd.cpp
index 2f18d288376f48aa545fa41b0605da6331fc78e5..fe38da8b4e789b158b2a70e592c8765ee2ee64ef 100644
--- a/src/SRD/fix_wall_srd.cpp
+++ b/src/SRD/fix_wall_srd.cpp
@@ -36,7 +36,7 @@ enum{NONE,EDGE,CONSTANT,VARIABLE};
 FixWallSRD::FixWallSRD(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 4) error->all("Illegal fix wall/srd command");
+  if (narg < 4) error->all(FLERR,"Illegal fix wall/srd command");
 
   // parse args
 
@@ -48,7 +48,7 @@ FixWallSRD::FixWallSRD(LAMMPS *lmp, int narg, char **arg) :
     if ((strcmp(arg[iarg],"xlo") == 0) || (strcmp(arg[iarg],"xhi") == 0) ||
 	(strcmp(arg[iarg],"ylo") == 0) || (strcmp(arg[iarg],"yhi") == 0) ||
 	(strcmp(arg[iarg],"zlo") == 0) || (strcmp(arg[iarg],"zhi") == 0)) {
-      if (iarg+2 > narg) error->all("Illegal fix wall/srd command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix wall/srd command");
 
       int newwall;
       if (strcmp(arg[iarg],"xlo") == 0) newwall = XLO;
@@ -60,7 +60,7 @@ FixWallSRD::FixWallSRD(LAMMPS *lmp, int narg, char **arg) :
 
       for (int m = 0; m < nwall; m++)
 	if (newwall == wallwhich[m])
-	  error->all("Wall defined twice in fix wall/srd command");
+	  error->all(FLERR,"Wall defined twice in fix wall/srd command");
 
       wallwhich[nwall] = newwall;
       if (strcmp(arg[iarg+1],"EDGE") == 0) {
@@ -83,30 +83,30 @@ FixWallSRD::FixWallSRD(LAMMPS *lmp, int narg, char **arg) :
       iarg += 2;
 
     } else if (strcmp(arg[iarg],"units") == 0) {
-      if (iarg+2 > narg) error->all("Illegal wall/srd command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal wall/srd command");
       if (strcmp(arg[iarg+1],"box") == 0) scaleflag = 0;
       else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1;
-      else error->all("Illegal fix wall/srd command");
+      else error->all(FLERR,"Illegal fix wall/srd command");
       iarg += 2;
-    } else error->all("Illegal fix wall/srd command");
+    } else error->all(FLERR,"Illegal fix wall/srd command");
   }
 
   // error check
 
-  if (nwall == 0) error->all("Illegal fix wall command");
+  if (nwall == 0) error->all(FLERR,"Illegal fix wall command");
 
   for (int m = 0; m < nwall; m++) {
     if ((wallwhich[m] == XLO || wallwhich[m] == XHI) && domain->xperiodic)
-      error->all("Cannot use fix wall/srd in periodic dimension");
+      error->all(FLERR,"Cannot use fix wall/srd in periodic dimension");
     if ((wallwhich[m] == YLO || wallwhich[m] == YHI) && domain->yperiodic)
-      error->all("Cannot use fix wall/srd in periodic dimension");
+      error->all(FLERR,"Cannot use fix wall/srd in periodic dimension");
     if ((wallwhich[m] == ZLO || wallwhich[m] == ZHI) && domain->zperiodic)
-      error->all("Cannot use fix wall/srd in periodic dimension");
+      error->all(FLERR,"Cannot use fix wall/srd in periodic dimension");
   }
 
   for (int m = 0; m < nwall; m++)
     if ((wallwhich[m] == ZLO || wallwhich[m] == ZHI) && domain->dimension == 2)
-      error->all("Cannot use fix wall/srd zlo/zhi for a 2d simulation");
+      error->all(FLERR,"Cannot use fix wall/srd zlo/zhi for a 2d simulation");
 
   // setup wall force array
 
@@ -127,7 +127,7 @@ FixWallSRD::FixWallSRD(LAMMPS *lmp, int narg, char **arg) :
 
   if (flag) {
     if (scaleflag && domain->lattice == NULL)
-      error->all("Use of fix wall with undefined lattice");
+      error->all(FLERR,"Use of fix wall with undefined lattice");
 
     double xscale,yscale,zscale;
     if (scaleflag) {
@@ -188,15 +188,15 @@ void FixWallSRD::init()
   int flag = 0;
   for (int m = 0; m < modify->nfix; m++)
     if (strcmp(modify->fix[m]->style,"srd") == 0) flag = 1;
-  if (!flag) error->all("Cannot use fix wall/srd without fix srd");
+  if (!flag) error->all(FLERR,"Cannot use fix wall/srd without fix srd");
 
   for (int m = 0; m < nwall; m++) {
     if (wallstyle[m] != VARIABLE) continue;
     varindex[m] = input->variable->find(varstr[m]);
     if (varindex[m] < 0)
-      error->all("Variable name for fix wall/srd does not exist");
+      error->all(FLERR,"Variable name for fix wall/srd does not exist");
     if (!input->variable->equalstyle(varindex[m]))
-      error->all("Variable for fix wall/srd is invalid style");
+      error->all(FLERR,"Variable for fix wall/srd is invalid style");
   }
 
   dt = update->dt;
diff --git a/src/USER-ATC/fix_atc.cpp b/src/USER-ATC/fix_atc.cpp
index 976b053679780bed3ed1e9e2d9793f6d0037b176..dde062dc405e146fbfdb64cde6e8fbcd4ede75cd 100644
--- a/src/USER-ATC/fix_atc.cpp
+++ b/src/USER-ATC/fix_atc.cpp
@@ -47,7 +47,7 @@ FixATC::FixATC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
 {
   // ID GROUP atc PHYSICSTYPE [PARAMETERFILE]
   // can have either 4 or 5 args, only arg[3] and arg[4] are used by this class
-  if (narg > 5 || narg < 4) lmp->error->all("Illegal fix atc command");
+  if (narg > 5 || narg < 4) lmp->error->all(FLERR,"Illegal fix atc command");
 
   // Set LAMMPS pointer on LammpsInterface
   ATC::LammpsInterface::instance()->set_lammps(lmp);
@@ -240,7 +240,7 @@ FixATC::FixATC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
     }
     else 
     {
-      lmp->error->all("Unknown physics type in ATC");
+      lmp->error->all(FLERR,"Unknown physics type in ATC");
     }
   }
   catch (ATC::ATC_Error& atcError) {
diff --git a/src/USER-AWPMD/atom_vec_wavepacket.cpp b/src/USER-AWPMD/atom_vec_wavepacket.cpp
index dd4a0657f8824937c5caf5fbcd17fa00eeb0ac28..5c9e789bf084d460c2e92027ea4b87e689fc0d2e 100644
--- a/src/USER-AWPMD/atom_vec_wavepacket.cpp
+++ b/src/USER-AWPMD/atom_vec_wavepacket.cpp
@@ -896,17 +896,17 @@ void AtomVecWavepacket::data_atom(double *coord, int imagetmp, char **values)
   
   tag[nlocal] = atoi(values[0]);
   if (tag[nlocal] <= 0)
-    error->one("Invalid atom ID in Atoms section of data file (ID tag must be >0)");
+    error->one(FLERR,"Invalid atom ID in Atoms section of data file (ID tag must be >0)");
   
   type[nlocal] = atoi(values[1]);
   if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
-    error->one("Invalid atom type in Atoms section of data file");
+    error->one(FLERR,"Invalid atom type in Atoms section of data file");
   
   q[nlocal] = atof(values[2]);
   spin[nlocal] = atoi(values[3]);
   eradius[nlocal] = atof(values[4]);
   if (eradius[nlocal] < 0.0)
-    error->one("Invalid eradius in Atoms section of data file");
+    error->one(FLERR,"Invalid eradius in Atoms section of data file");
   
 
   etag[nlocal] = atoi(values[5]);
@@ -940,7 +940,7 @@ int AtomVecWavepacket::data_atom_hybrid(int nlocal, char **values)
   spin[nlocal] = atoi(values[1]);
   eradius[nlocal] = atof(values[2]);
   if (eradius[nlocal] < 0.0)
-    error->one("Invalid eradius in Atoms section of data file");
+    error->one(FLERR,"Invalid eradius in Atoms section of data file");
   
   etag[nlocal] = atoi(values[3]);
   cs[2*nlocal] = atoi(values[4]);
diff --git a/src/USER-AWPMD/fix_nve_awpmd.cpp b/src/USER-AWPMD/fix_nve_awpmd.cpp
index 418b942ecd8b505f384e0ff11c33269f86930046..5aee8958ae28f619bb49a6819f6c0b2da310d15b 100644
--- a/src/USER-AWPMD/fix_nve_awpmd.cpp
+++ b/src/USER-AWPMD/fix_nve_awpmd.cpp
@@ -36,9 +36,9 @@ FixNVEAwpmd::FixNVEAwpmd(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
   if (!atom->wavepacket_flag) 
-    error->all("Fix nve/awpmd requires atom style wavepacket");
+    error->all(FLERR,"Fix nve/awpmd requires atom style wavepacket");
   //if (!atom->mass_type != 1) 
-   // error->all("Fix nve/awpmd requires per type mass");
+   // error->all(FLERR,"Fix nve/awpmd requires per type mass");
 
   time_integrate = 1;
 }
diff --git a/src/USER-AWPMD/pair_awpmd_cut.cpp b/src/USER-AWPMD/pair_awpmd_cut.cpp
index ae276334bb34bde1c743aa955e9e89028cf950a8..4644f1a2ce53789413e0022384fcec85b0c3441d 100644
--- a/src/USER-AWPMD/pair_awpmd_cut.cpp
+++ b/src/USER-AWPMD/pair_awpmd_cut.cpp
@@ -36,9 +36,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairAWPMDCut::PairAWPMDCut(LAMMPS *lmp) : Pair(lmp)
@@ -241,7 +238,7 @@ void PairAWPMDCut::compute(int eflag, int vflag)
       etmap[etag[i]].push_back(i);   
     }
     else
-      error->all(fmt("Invalid spin value (%d) for particle %d !",spin[i],i));
+      error->all(FLERR,fmt("Invalid spin value (%d) for particle %d !",spin[i],i));
   }
   // ion force vector
   Vector_3 *fi=NULL;
@@ -258,7 +255,7 @@ void PairAWPMDCut::compute(int eflag, int vflag)
     for(size_t k=0;k<el.size();k++){
       int i=el[k];
       if(spin[el[0]]!=spin[i])
-        error->all(fmt("WP splits for one electron should have the same spin (at particles %d, %d)!",el[0],i));
+        error->all(FLERR,fmt("WP splits for one electron should have the same spin (at particles %d, %d)!",el[0],i));
       double m= atom->mass ? atom->mass[type[i]] : force->e_mass;
       Vector_3 xx=Vector_3(x[i][0],x[i][1],x[i][2]);
       Vector_3 rv=m*Vector_3(v[i][0],v[i][1],v[i][2]);
@@ -411,7 +408,7 @@ void PairAWPMDCut::allocate()
 // -1 for length means default setting (L/2 for cutoff and L for width PBC)
 
 void PairAWPMDCut::settings(int narg, char **arg){ 
-  if (narg < 1) error->all("Illegal pair_style command");
+  if (narg < 1) error->all(FLERR,"Illegal pair_style command");
 
   cut_global = force->numeric(arg[0]);
   
@@ -432,21 +429,21 @@ void PairAWPMDCut::settings(int narg, char **arg){
       wpmd->constraint=AWPMD::FIX;
       i++;
       if(i>=narg)
-        error->all("Setting 'fix' should be followed by a number in awpmd/cut");
+        error->all(FLERR,"Setting 'fix' should be followed by a number in awpmd/cut");
       wpmd->w0=force->numeric(arg[i]);
     }
     else if(!strcmp(arg[i],"harm")){
       wpmd->constraint=AWPMD::HARM;
       i++;
       if(i>=narg)
-        error->all("Setting 'harm' should be followed by a number in awpmd/cut");
+        error->all(FLERR,"Setting 'harm' should be followed by a number in awpmd/cut");
       wpmd->w0=force->numeric(arg[i]);
       wpmd->set_harm_constr(wpmd->w0);
     }
     else if(!strcmp(arg[i],"pbc")){
       i++;
       if(i>=narg)
-        error->all("Setting 'pbc' should be followed by a number in awpmd/cut");
+        error->all(FLERR,"Setting 'pbc' should be followed by a number in awpmd/cut");
       width_pbc=force->numeric(arg[i]);
     }
     else if(!strcmp(arg[i],"relax"))
@@ -454,7 +451,7 @@ void PairAWPMDCut::settings(int narg, char **arg){
     else if(!strcmp(arg[i],"ermscale")){
       i++;
       if(i>=narg)
-        error->all("Setting 'ermscale' should be followed by a number in awpmd/cut");
+        error->all(FLERR,"Setting 'ermscale' should be followed by a number in awpmd/cut");
       ermscale=force->numeric(arg[i]);
     }
     else if(!strcmp(arg[i],"flex_press"))
@@ -478,7 +475,7 @@ void PairAWPMDCut::settings(int narg, char **arg){
 // pair settings are as usual
 void PairAWPMDCut::coeff(int narg, char **arg)
 {
-  if (narg < 2 || narg > 3) error->all("Incorrect args for pair coefficients");
+  if (narg < 2 || narg > 3) error->all(FLERR,"Incorrect args for pair coefficients");
   
   /*if(domain->xperiodic == 1 || domain->yperiodic == 1 || 
     domain->zperiodic == 1) {*/
@@ -515,7 +512,7 @@ void PairAWPMDCut::coeff(int narg, char **arg)
     }
   }
   
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -528,13 +525,13 @@ void PairAWPMDCut::init_style()
 
   if (!atom->q_flag || !atom->spin_flag || 
       !atom->eradius_flag || !atom->erforce_flag )  // TO DO: adjust this to match approximation used
-    error->all("Pair awpmd/cut requires atom attributes "
+    error->all(FLERR,"Pair awpmd/cut requires atom attributes "
 	       "q, spin, eradius, erforce");
 
   /*
   if(vflag_atom){ // can't compute virial per atom
     //warning->
-    error->all("Pair style awpmd can't compute per atom virials");
+    error->all(FLERR,"Pair style awpmd can't compute per atom virials");
   }*/
 
   // add hook to minimizer for eradius and erforce
@@ -546,7 +543,7 @@ void PairAWPMDCut::init_style()
 
   /*if (update->whichflag == 1) { 
     if (force->qqr2e == 332.06371 && update->dt == 1.0)
-      error->all("You must lower the default real units timestep for pEFF ");
+      error->all(FLERR,"You must lower the default real units timestep for pEFF ");
   }*/
 
   // need a half neigh list and optionally a granular history neigh list
@@ -554,19 +551,19 @@ void PairAWPMDCut::init_style()
   //int irequest = neighbor->request(this);
 
   //if (atom->tag_enable == 0)
-  //  error->all("Pair style reax requires atom IDs");
+  //  error->all(FLERR,"Pair style reax requires atom IDs");
   
   //if (force->newton_pair == 0)
-    //error->all("Pair style awpmd requires newton pair on");
+    //error->all(FLERR,"Pair style awpmd requires newton pair on");
   
   //if (strcmp(update->unit_style,"real") != 0 && comm->me == 0)
-    //error->warning("Not using real units with pair reax");
+    //error->warning(FLERR,"Not using real units with pair reax");
 
   int irequest = neighbor->request(this);
   neighbor->requests[irequest]->newton = 2;
   
   if(force->e_mass==0. || force->hhmrr2e==0. || force->mvh2r==0.)
-    error->all("Pair style awpmd requires e_mass and conversions hhmrr2e, mvh2r to be properly set for unit system");
+    error->all(FLERR,"Pair style awpmd requires e_mass and conversions hhmrr2e, mvh2r to be properly set for unit system");
 
   wpmd->me=force->e_mass;
   wpmd->h2_me=force->hhmrr2e/force->e_mass;
diff --git a/src/USER-CG-CMM/angle_cg_cmm.cpp b/src/USER-CG-CMM/angle_cg_cmm.cpp
index a818b061f115ff194aa431ed7e0571d88af38f8f..7d9800808a3fd4b80d5685067992ecedf21a9a20 100644
--- a/src/USER-CG-CMM/angle_cg_cmm.cpp
+++ b/src/USER-CG-CMM/angle_cg_cmm.cpp
@@ -297,7 +297,7 @@ void AngleCGCMM::allocate()
 
 void AngleCGCMM::coeff(int narg, char **arg)
 {
-  if (narg != 6) error->all("Incorrect args for angle coefficients");
+  if (narg != 6) error->all(FLERR,"Incorrect args for angle coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -307,7 +307,7 @@ void AngleCGCMM::coeff(int narg, char **arg)
   double theta0_one = atof(arg[2]);
 
   int cg_type_one=find_cg_type(arg[3]);
-  if (cg_type_one == CG_NOT_SET) error->all("Error reading CG type flag.");
+  if (cg_type_one == CG_NOT_SET) error->all(FLERR,"Error reading CG type flag.");
   
   double epsilon_one = atof(arg[4]);
   double sigma_one = atof(arg[5]);
@@ -332,7 +332,7 @@ void AngleCGCMM::coeff(int narg, char **arg)
     count++;
   }
 
-  if (count == 0) error->all("Incorrect args for angle coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for angle coefficients");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/USER-CG-CMM/pair_cg_cmm_coul_cut.cpp b/src/USER-CG-CMM/pair_cg_cmm_coul_cut.cpp
index 7b270b351c4474763a2cd56c12d26964c299e881..10cee8919b22faec714246ae573b76a2b9cb6e14 100644
--- a/src/USER-CG-CMM/pair_cg_cmm_coul_cut.cpp
+++ b/src/USER-CG-CMM/pair_cg_cmm_coul_cut.cpp
@@ -16,17 +16,12 @@
    Contributing author: Axel Kohlmeyer <akohlmey@gmail.com>
 ------------------------------------------------------------------------- */
 
+#include "string.h"
 #include "pair_cg_cmm_coul_cut.h"
 #include "memory.h"
 #include "atom.h"
 
-#include "string.h"
-
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-
 using namespace LAMMPS_NS;
- 
-/* ---------------------------------------------------------------------- */
 
 PairCGCMMCoulCut::PairCGCMMCoulCut(LAMMPS *lmp) : PairCMMCommon(lmp)
 {
@@ -67,7 +62,7 @@ void PairCGCMMCoulCut::allocate()
 void PairCGCMMCoulCut::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style cg/cut/coul/cut requires atom attribute q");
+    error->all(FLERR,"Pair style cg/cut/coul/cut requires atom attribute q");
 
   PairCMMCommon::init_style();
 
@@ -88,7 +83,7 @@ double PairCGCMMCoulCut::init_one(int i, int j)
   // check interior rRESPA cutoff
 
   if (cut_respa && MIN(cut_lj[i][j],cut_coul[i][j]) < cut_respa[3])
-    error->all("Pair cutoff < Respa interior cutoff");
+    error->all(FLERR,"Pair cutoff < Respa interior cutoff");
 
   return mycut;
 }
diff --git a/src/USER-CG-CMM/pair_cg_cmm_coul_long.cpp b/src/USER-CG-CMM/pair_cg_cmm_coul_long.cpp
index 2947b3ce6465c323f486acede28eb6424231a8df..fa7769927a871da35af6a0237aa655eaaaa2baa5 100644
--- a/src/USER-CG-CMM/pair_cg_cmm_coul_long.cpp
+++ b/src/USER-CG-CMM/pair_cg_cmm_coul_long.cpp
@@ -16,19 +16,17 @@
    Contributing author: Axel Kohlmeyer <akohlmey@gmail.com>
 ------------------------------------------------------------------------- */
 
+#include "string.h"
 #include "pair_cg_cmm_coul_long.h"
 #include "memory.h"
 #include "atom.h"
 #include "force.h"
 #include "kspace.h"
 
-#include "string.h"
+using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
 #define EWALD_F   1.12837917
 
-using namespace LAMMPS_NS;
-
 /* ---------------------------------------------------------------------- */
 
 PairCGCMMCoulLong::PairCGCMMCoulLong(LAMMPS *lmp) : PairCMMCommon(lmp)
@@ -91,7 +89,7 @@ void PairCGCMMCoulLong::free_tables()
 void PairCGCMMCoulLong::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style cg/cut/coul/long requires atom attribute q");
+    error->all(FLERR,"Pair style cg/cut/coul/long requires atom attribute q");
   
   PairCMMCommon::init_style();
 
@@ -105,7 +103,7 @@ void PairCGCMMCoulLong::init_style()
   // ensure use of KSpace long-range solver, set g_ewald
 
   if (force->kspace == NULL) 
-    error->all("Pair style is incompatible with KSpace style");
+    error->all(FLERR,"Pair style is incompatible with KSpace style");
   g_ewald = force->kspace->g_ewald;
 
   // setup force tables
@@ -122,7 +120,7 @@ double PairCGCMMCoulLong::init_one(int i, int j)
   // check interior rRESPA cutoff
 
   if (cut_respa && MIN(cut_lj[i][j],cut_coul_global) < cut_respa[3])
-    error->all("Pair cutoff < Respa interior cutoff");
+    error->all(FLERR,"Pair cutoff < Respa interior cutoff");
 
   return mycut;
 }
diff --git a/src/USER-CG-CMM/pair_cmm_common.cpp b/src/USER-CG-CMM/pair_cmm_common.cpp
index 043716e9f05a7581f4a2aef80b015cb71bbbdb58..81d142f568c5a2e0c3a7048d0eee205661760b70 100644
--- a/src/USER-CG-CMM/pair_cmm_common.cpp
+++ b/src/USER-CG-CMM/pair_cmm_common.cpp
@@ -26,7 +26,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
 #define SMALL 1.0e-6
 
 /* ---------------------------------------------------------------------- */
@@ -102,7 +101,7 @@ void PairCMMCommon::allocate()
 // args = cutoff (cutoff2 (kappa))
 void PairCMMCommon::settings(int narg, char **arg)
 {
-  if ((narg < 1) || (narg > 3)) error->all("Illegal pair_style command");
+  if ((narg < 1) || (narg > 3)) error->all(FLERR,"Illegal pair_style command");
 
   cut_lj_global = force->numeric(arg[0]);
   if (narg == 1) cut_coul_global = cut_lj_global;
@@ -137,7 +136,7 @@ void PairCMMCommon::settings(int narg, char **arg)
 
 void PairCMMCommon::coeff(int narg, char **arg)
 {
-  if (narg < 5 || narg > 7) error->all("Incorrect args for pair coefficients");
+  if (narg < 5 || narg > 7) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -145,7 +144,7 @@ void PairCMMCommon::coeff(int narg, char **arg)
   force->bounds(arg[1],atom->ntypes,jlo,jhi);
 
   int cg_type_one=find_cg_type(arg[2]);
-  if (cg_type_one == CG_NOT_SET) error->all("Error reading CG type flag.");
+  if (cg_type_one == CG_NOT_SET) error->all(FLERR,"Error reading CG type flag.");
   
   double epsilon_one = force->numeric(arg[3]);
   double sigma_one = force->numeric(arg[4]);
@@ -174,7 +173,7 @@ void PairCMMCommon::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -240,13 +239,13 @@ void PairCMMCommon::init_list(int id, NeighList *ptr)
 double PairCMMCommon::init_one(int i, int j)
 {
   if (setflag[i][j] == 0) {
-    error->all("for CG styles, epsilon and sigma need to be set explicitly for all pairs.");
+    error->all(FLERR,"for CG styles, epsilon and sigma need to be set explicitly for all pairs.");
   }
 
   const int cgt = cg_type[i][j];
 
   if (cgt == CG_NOT_SET)
-    error->all("unrecognized LJ parameter flag");
+    error->all(FLERR,"unrecognized LJ parameter flag");
   
   lj1[i][j] = cg_prefact[cgt] * cg_pow1[cgt] * epsilon[i][j] * pow(sigma[i][j],cg_pow1[cgt]);
   lj2[i][j] = cg_prefact[cgt] * cg_pow2[cgt] * epsilon[i][j] * pow(sigma[i][j],cg_pow2[cgt]);
@@ -290,7 +289,7 @@ double PairCMMCommon::init_one(int i, int j)
   // count total # of atoms of type I and J via Allreduce
   if (tail_flag) {
 #if 1
-    error->all("tail correction not (yet) supported by CG potentials.");
+    error->all(FLERR,"tail correction not (yet) supported by CG potentials.");
 #else
     int *type = atom->type;
     int nlocal = atom->nlocal;
@@ -456,18 +455,18 @@ double PairCMMCommon::eval_single(int coul_type, int i, int j, int itype, int jt
   
   if (rsq < cut_coul[itype][jtype]) {
     if(coul_type == CG_COUL_LONG) {
-      error->all("single energy computation with long-range coulomb not supported by CG potentials.");
+      error->all(FLERR,"single energy computation with long-range coulomb not supported by CG potentials.");
     } else if ((coul_type == CG_COUL_CUT) || (coul_type == CG_COUL_DEBYE)) {
       const double r2inv = 1.0/rsq;
       const double rinv = sqrt(r2inv);
       const double qscreen=exp(-kappa*sqrt(rsq));
       coul_force = force->qqrd2e * atom->q[i]*atom->q[j]*rinv * qscreen * (kappa + rinv);
       coul_erg   = force->qqrd2e * atom->q[i]*atom->q[j]*rinv * qscreen;
-      // error->all("single energy computation with coulomb not supported by CG potentials.");
+      // error->all(FLERR,"single energy computation with coulomb not supported by CG potentials.");
     } else if (coul_type == CG_COUL_NONE) {
       ; // do nothing
     } else {
-      error->all("unknown coulomb type with CG potentials.");
+      error->all(FLERR,"unknown coulomb type with CG potentials.");
     }
   }
 
diff --git a/src/USER-CUDA/atom_vec_angle_cuda.cpp b/src/USER-CUDA/atom_vec_angle_cuda.cpp
index 323a1bedf673e0bf3de16874072e07a83a9853cb..b816b690b142f3ba0f997c38e7329c976db95ac2 100644
--- a/src/USER-CUDA/atom_vec_angle_cuda.cpp
+++ b/src/USER-CUDA/atom_vec_angle_cuda.cpp
@@ -65,7 +65,7 @@ AtomVecAngleCuda::AtomVecAngleCuda(LAMMPS *lmp, int narg, char **arg) :
 {
    cuda = lmp->cuda;
    if(cuda == NULL) 
-	error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS.."); 
+	error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS.."); 
 
    maxsend=0;
    cudable=true;
diff --git a/src/USER-CUDA/atom_vec_atomic_cuda.cpp b/src/USER-CUDA/atom_vec_atomic_cuda.cpp
index c57e0654f6d511a8f96c5feec067428293dd1683..b6bb14422cbb6bf1d2fa1bdbcd01b13e19d564c4 100644
--- a/src/USER-CUDA/atom_vec_atomic_cuda.cpp
+++ b/src/USER-CUDA/atom_vec_atomic_cuda.cpp
@@ -65,7 +65,7 @@ AtomVecAtomicCuda::AtomVecAtomicCuda(LAMMPS *lmp, int narg, char **arg) :
 {
    cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
    maxsend=0;
    cudable=true;
diff --git a/src/USER-CUDA/atom_vec_charge_cuda.cpp b/src/USER-CUDA/atom_vec_charge_cuda.cpp
index e0572536046665f2e077d5c0998a4c88fd50efa3..a15836c45b74ed4c61b37f9371f419f598d3590d 100644
--- a/src/USER-CUDA/atom_vec_charge_cuda.cpp
+++ b/src/USER-CUDA/atom_vec_charge_cuda.cpp
@@ -64,7 +64,7 @@ AtomVecChargeCuda::AtomVecChargeCuda(LAMMPS *lmp, int narg, char **arg) :
 {
    cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
    maxsend=0;
    cudable=true;
diff --git a/src/USER-CUDA/atom_vec_full_cuda.cpp b/src/USER-CUDA/atom_vec_full_cuda.cpp
index f010181cedd4954518816ab570d3ea190336b5a9..9e656ed58db5d796457dab7d9bbf288c981b7cca 100644
--- a/src/USER-CUDA/atom_vec_full_cuda.cpp
+++ b/src/USER-CUDA/atom_vec_full_cuda.cpp
@@ -65,7 +65,7 @@ AtomVecFullCuda::AtomVecFullCuda(LAMMPS *lmp, int narg, char **arg) :
 {
    cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
    maxsend=0;
    cudable=true;
diff --git a/src/USER-CUDA/comm_cuda.cpp b/src/USER-CUDA/comm_cuda.cpp
index 4a7a822ae0ca1955bfca774050b8135533f0fe6a..8e75f93ba50b25691abe5de6235488e8bab670c7 100644
--- a/src/USER-CUDA/comm_cuda.cpp
+++ b/src/USER-CUDA/comm_cuda.cpp
@@ -41,9 +41,6 @@ using namespace LAMMPS_NS;
 #define BUFFACTOR 1.5
 #define BUFMIN 1000
 #define BUFEXTRA 1000
-
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
 #define BIG 1.0e20
 
 enum{SINGLE,MULTI};
@@ -56,7 +53,7 @@ CommCuda::CommCuda(LAMMPS *lmp):Comm(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
   cu_pbc=NULL;
   cu_slablo=NULL;
@@ -279,7 +276,7 @@ cuda->shared_data.cuda_timings.comm_forward_mpi_lower+=
 	    if (sendnum[iswap])
 		{
           n = Cuda_CommCuda_PackComm_Self(&cuda->shared_data,sendnum[iswap],iswap,firstrecv[iswap],pbc[iswap],pbc_flag[iswap]);
-          if(n<0) error->all(" # CUDA ERRROR on PackComm_Self");
+          if(n<0) error->all(FLERR," # CUDA ERRROR on PackComm_Self");
           if((sizeof(X_FLOAT)!=sizeof(double)) && n)
             n=(n+1)*sizeof(X_FLOAT)/sizeof(double);
 		}
@@ -382,7 +379,7 @@ clock_gettime(CLOCK_REALTIME,&time2);
 	    if (sendnum[iswap])
 		{
           n = Cuda_CommCuda_PackComm_Self(&cuda->shared_data,sendnum[iswap],iswap,firstrecv[iswap],pbc[iswap],pbc_flag[iswap]);
-          if(n<0) error->all(" # CUDA ERRROR on PackComm_Self");
+          if(n<0) error->all(FLERR," # CUDA ERRROR on PackComm_Self");
           if((sizeof(X_FLOAT)!=sizeof(double)) && n)
             n=(n+1)*sizeof(X_FLOAT)/sizeof(double);
 		}
diff --git a/src/USER-CUDA/compute_pressure_cuda.cpp b/src/USER-CUDA/compute_pressure_cuda.cpp
index aceb06a36dfaea34dc9917cb53b71ce52ea8bc5a..27de7e58508c7348fb0131f58bd3fa46a94d53b7 100644
--- a/src/USER-CUDA/compute_pressure_cuda.cpp
+++ b/src/USER-CUDA/compute_pressure_cuda.cpp
@@ -64,7 +64,7 @@ ComputePressureCuda::ComputePressureCuda(LAMMPS *lmp, int narg, char **arg) :
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
   cudable = 1;
   
   // store temperature ID used by pressure computation
@@ -78,7 +78,7 @@ ComputePressureCuda::ComputePressureCuda(LAMMPS *lmp, int narg, char **arg) :
   delete [] id_temp;
   if (modify->compute[icompute]->cudable == 0)
   {
-    error->warning("Compute pressure/cuda temperature ID is not cudable! Try a temp/cuda style.");
+    error->warning(FLERR,"Compute pressure/cuda temperature ID is not cudable! Try a temp/cuda style.");
     cudable = 0;
   }
   
@@ -87,7 +87,7 @@ ComputePressureCuda::ComputePressureCuda(LAMMPS *lmp, int narg, char **arg) :
 double ComputePressureCuda::compute_scalar()
 {
   if(not temperature->cudable && cuda->finished_setup) cuda->downloadAll();
-  ComputePressure::compute_scalar();
+  return ComputePressure::compute_scalar();
 }
 
 void ComputePressureCuda::compute_vector()
diff --git a/src/USER-CUDA/compute_temp_cuda.cpp b/src/USER-CUDA/compute_temp_cuda.cpp
index 0e13f67c149770dd71b4c76988bc9b0ec01d6352..0b560f536611ac3cd5d1a7e83c961780af2cfa59 100644
--- a/src/USER-CUDA/compute_temp_cuda.cpp
+++ b/src/USER-CUDA/compute_temp_cuda.cpp
@@ -59,9 +59,9 @@ ComputeTempCuda::ComputeTempCuda(LAMMPS *lmp, int narg, char **arg) :
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-  if (narg != 3) error->all("Illegal compute temp/cuda command");
+  if (narg != 3) error->all(FLERR,"Illegal compute temp/cuda command");
 
   scalar_flag = vector_flag = 1;
   size_vector = 6;
@@ -158,7 +158,7 @@ double ComputeTempCuda::compute_scalar()
   	for(int i=0;i<atom->nlocal;i++) 
   	if((v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2])>1e5) 
   	printf("%i %i // %lf %lf %lf // %lf %lf %lf\n",atom->tag[i],atom->type[i],x[i][0], x[i][1], x[i][2],v[i][0], v[i][1], v[i][2]);
-  	error->all("Temperature out of range. Simulations will be abortet.\n");
+  	error->all(FLERR,"Temperature out of range. Simulations will be abortet.\n");
   }
   return scalar;
 }
diff --git a/src/USER-CUDA/compute_temp_partial_cuda.cpp b/src/USER-CUDA/compute_temp_partial_cuda.cpp
index c9a126a18de78bf5c454e30b36f9b8ad303de661..e39484c83580844496d7ce79ac56ba19f5b761a0 100644
--- a/src/USER-CUDA/compute_temp_partial_cuda.cpp
+++ b/src/USER-CUDA/compute_temp_partial_cuda.cpp
@@ -60,9 +60,9 @@ ComputeTempPartialCuda::ComputeTempPartialCuda(LAMMPS *lmp, int narg, char **arg
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-  if (narg != 6) error->all("Illegal compute temp/partial command");
+  if (narg != 6) error->all(FLERR,"Illegal compute temp/partial command");
 
   scalar_flag = vector_flag = 1;
   size_vector = 6;
@@ -75,7 +75,7 @@ ComputeTempPartialCuda::ComputeTempPartialCuda(LAMMPS *lmp, int narg, char **arg
   yflag = atoi(arg[4]);
   zflag = atoi(arg[5]);
   if (zflag && domain->dimension == 2)
-    error->all("Compute temp/partial cannot use vz for 2d systemx");
+    error->all(FLERR,"Compute temp/partial cannot use vz for 2d systemx");
 
   maxbias = 0;
   vbiasall = NULL;
@@ -181,7 +181,7 @@ double ComputeTempPartialCuda::compute_scalar()
   	for(int i=0;i<atom->nlocal;i++) 
   	if((v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2])>1e5) 
   	printf("%i %i // %lf %lf %lf // %lf %lf %lf\n",atom->tag[i],atom->type[i],x[i][0], x[i][1], x[i][2],v[i][0], v[i][1], v[i][2]);
-  	error->all("Temperature out of range. Simulations will be abortet.\n");
+  	error->all(FLERR,"Temperature out of range. Simulations will be abortet.\n");
   }
   return scalar;
 }
diff --git a/src/USER-CUDA/cuda.cpp b/src/USER-CUDA/cuda.cpp
index 66273775e7287a5962cb9c1598c8f9a018660216..39261bd7c0ba040937a5509ba1bc558e9392e6b8 100644
--- a/src/USER-CUDA/cuda.cpp
+++ b/src/USER-CUDA/cuda.cpp
@@ -46,8 +46,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 Cuda::Cuda(LAMMPS *lmp) : Pointers(lmp)
 {
 	cuda_exists=true;
@@ -198,15 +196,15 @@ void Cuda::accelerator(int narg, char** arg)
 	  if(strcmp(arg[i],"gpu/node")==0) 
 	  {
 	  	if(++i==narg) 
-	  	  error->all("Invalid Options for 'accelerator' command. Expecting a number or keyword 'special' after 'gpu/node' option."); 
+	  	  error->all(FLERR,"Invalid Options for 'accelerator' command. Expecting a number or keyword 'special' after 'gpu/node' option."); 
 	    if(strcmp(arg[i],"special")==0)
 	    {
 	  	   if(++i==narg) 
-	  	     error->all("Invalid Options for 'accelerator' command. Expecting number of GPUs to be used per node after keyword 'gpu/node special'."); 
+	  	     error->all(FLERR,"Invalid Options for 'accelerator' command. Expecting number of GPUs to be used per node after keyword 'gpu/node special'."); 
 	       pppn=atoi(arg[i]);
-	       if(pppn<1) error->all("Invalid Options for 'accelerator' command. Expecting number of GPUs to be used per node after keyword 'gpu/node special'."); 
+	       if(pppn<1) error->all(FLERR,"Invalid Options for 'accelerator' command. Expecting number of GPUs to be used per node after keyword 'gpu/node special'."); 
 	  	   if(i+pppn==narg) 
-	  	     error->all("Invalid Options for 'accelerator' command. Expecting list of device ids after keyword 'gpu/node special'."); 
+	  	     error->all(FLERR,"Invalid Options for 'accelerator' command. Expecting list of device ids after keyword 'gpu/node special'."); 
 	       devicelist=new int[pppn];
 	       for(int k=0;k<pppn;k++)
 	         {i++;devicelist[k]=atoi(arg[i]);}
@@ -218,7 +216,7 @@ void Cuda::accelerator(int narg, char** arg)
 	  if(strcmp(arg[i],"pinned")==0) 
 	  {
 	  	if(++i==narg) 
-	  	  error->all("Invalid Options for 'accelerator' command. Expecting a number after 'pinned' option."); 
+	  	  error->all(FLERR,"Invalid Options for 'accelerator' command. Expecting a number after 'pinned' option."); 
 	    pinned=atoi(arg[i])==0?false:true;
             if((pinned==false)&&(universe->me==0)) printf(" #CUDA: Pinned memory is not used for communication\n");
 	  }
@@ -229,7 +227,7 @@ void Cuda::accelerator(int narg, char** arg)
 	  if(strcmp(arg[i],"suffix")==0) 
 	  {
 	  	if(++i==narg) 
-	  	  error->all("Invalid Options for 'accelerator' command. Expecting a string after 'suffix' option."); 
+	  	  error->all(FLERR,"Invalid Options for 'accelerator' command. Expecting a string after 'suffix' option."); 
 	  	strcpy(lmp->suffix,arg[i]);
 	  }
 	  if(strcmp(arg[i],"overlap_comm")==0) 
@@ -239,14 +237,14 @@ void Cuda::accelerator(int narg, char** arg)
 	  if(strcmp(arg[i],"dotest")==0) 
 	  {
 	  	if(++i==narg) 
-	  	  error->all("Invalid Options for 'accelerator' command. Expecting a number after 'dotest' option."); 
+	  	  error->all(FLERR,"Invalid Options for 'accelerator' command. Expecting a number after 'dotest' option."); 
 	    testatom=atof(arg[i]);
 	    dotestatom=true;
 	  }
 	  if(strcmp(arg[i],"override_bpa")==0) 
 	  {
 	  	if(++i==narg) 
-	  	  error->all("Invalid Options for 'accelerator' command. Expecting a number after 'override_bpa' option."); 
+	  	  error->all(FLERR,"Invalid Options for 'accelerator' command. Expecting a number after 'override_bpa' option."); 
 	      shared_data.pair.override_block_per_atom = atoi(arg[i]);
 	  }
 	}
diff --git a/src/USER-CUDA/cuda_neigh_list.cpp b/src/USER-CUDA/cuda_neigh_list.cpp
index 9a88797e87cb3efb9f6ccfc4bae5257b01ba664c..ef9edf5ef3beb2711b5a380f939784782ea3207b 100644
--- a/src/USER-CUDA/cuda_neigh_list.cpp
+++ b/src/USER-CUDA/cuda_neigh_list.cpp
@@ -37,7 +37,7 @@ CudaNeighList::CudaNeighList(LAMMPS *lmp, class NeighList* neigh_list) : Pointer
 {
         cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	MYDBG(printf("# CUDA: CudaNeighList::cudaNeighList() ... start\n");)
 	this->neigh_list = neigh_list;
diff --git a/src/USER-CUDA/domain_cuda.cpp b/src/USER-CUDA/domain_cuda.cpp
index 37aa38c1980c3913ed98dc709c797e48cb069a3b..b241b16a294fd14d74ba6915f1964ad625afce10 100644
--- a/src/USER-CUDA/domain_cuda.cpp
+++ b/src/USER-CUDA/domain_cuda.cpp
@@ -42,8 +42,6 @@ using namespace LAMMPS_NS;
 #define BIG   1.0e20
 #define SMALL 1.0e-4
 #define DELTA 1
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
 
 enum{NO_REMAP,X_REMAP,V_REMAP};                   // same as fix_deform.cpp
 
@@ -55,7 +53,7 @@ DomainCuda::DomainCuda(LAMMPS *lmp) : Domain(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -180,21 +178,21 @@ void DomainCuda::reset_box()
       else if (boundary[0][0] == 3) boxlo[0] = MIN(-all[0][0]-SMALL,minxlo);
       if (boundary[0][1] == 2) boxhi[0] = all[0][1] + SMALL;
       else if (boundary[0][1] == 3) boxhi[0] = MAX(all[0][1]+SMALL,minxhi);
-      if (boxlo[0] > boxhi[0]) error->all("Illegal simulation box");
+      if (boxlo[0] > boxhi[0]) error->all(FLERR,"Illegal simulation box");
     }
     if (yperiodic == 0) {
       if (boundary[1][0] == 2) boxlo[1] = -all[1][0] - SMALL;
       else if (boundary[1][0] == 3) boxlo[1] = MIN(-all[1][0]-SMALL,minylo);
       if (boundary[1][1] == 2) boxhi[1] = all[1][1] + SMALL;
       else if (boundary[1][1] == 3) boxhi[1] = MAX(all[1][1]+SMALL,minyhi);
-      if (boxlo[1] > boxhi[1]) error->all("Illegal simulation box");
+      if (boxlo[1] > boxhi[1]) error->all(FLERR,"Illegal simulation box");
     }
     if (zperiodic == 0) {
       if (boundary[2][0] == 2) boxlo[2] = -all[2][0] - SMALL;
       else if (boundary[2][0] == 3) boxlo[2] = MIN(-all[2][0]-SMALL,minzlo);
       if (boundary[2][1] == 2) boxhi[2] = all[2][1] + SMALL;
       else if (boundary[2][1] == 3) boxhi[2] = MAX(all[2][1]+SMALL,minzhi);
-      if (boxlo[2] > boxhi[2]) error->all("Illegal simulation box");
+      if (boxlo[2] > boxhi[2]) error->all(FLERR,"Illegal simulation box");
     }
   }
 
diff --git a/src/USER-CUDA/fft3d_cuda.cpp b/src/USER-CUDA/fft3d_cuda.cpp
index bb1278bb75f6e5553f8aa551ff28ff57cf2ff1eb..c6882f459748c9c47b4e297dbba72c20f296da7b 100644
--- a/src/USER-CUDA/fft3d_cuda.cpp
+++ b/src/USER-CUDA/fft3d_cuda.cpp
@@ -50,6 +50,7 @@
 
 #ifdef FFT_CUFFT
 #endif
+
 #define MIN(A,B) ((A) < (B)) ? (A) : (B)
 #define MAX(A,B) ((A) > (B)) ? (A) : (B)
 
@@ -182,7 +183,7 @@ struct fft_plan_3d *fft_3d_create_plan_cuda(
   MPI_Comm_size(comm,&nprocs);
 
 #ifndef FFT_CUFFT
-    error->all("ERROR: Trying to use cuda fft without FFT_CUFFT set. Recompile with make option 'cufft=1'.");
+    error->all(FLERR,"ERROR: Trying to use cuda fft without FFT_CUFFT set. Recompile with make option 'cufft=1'.");
 #endif
   // compute division of procs in 2 dimensions not on-processor 
   bifactor_cuda(nprocs,&np1,&np2);
diff --git a/src/USER-CUDA/fft3d_wrap_cuda.cpp b/src/USER-CUDA/fft3d_wrap_cuda.cpp
index 5fa45bd85ceea6f79ac3bcc704f79035011e6d47..eab2f82e795b069051acc1d36a61bcee5aee63cc 100644
--- a/src/USER-CUDA/fft3d_wrap_cuda.cpp
+++ b/src/USER-CUDA/fft3d_wrap_cuda.cpp
@@ -61,7 +61,7 @@ FFT3dCuda::FFT3dCuda(LAMMPS *lmp, MPI_Comm comm, int nfast, int nmid, int nslow,
 			    out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi,
 			    scaled,permute,nbuf);
 #endif
-  if (plan == NULL) error->one("Could not create 3d FFT plan");
+  if (plan == NULL) error->one(FLERR,"Could not create 3d FFT plan");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/USER-CUDA/fix_addforce_cuda.cpp b/src/USER-CUDA/fix_addforce_cuda.cpp
index acf4d6d7ec893fec66388641952a5ea711a3dc6b..218110acf7f75ab1a0836e1774e4a704696b027c 100644
--- a/src/USER-CUDA/fix_addforce_cuda.cpp
+++ b/src/USER-CUDA/fix_addforce_cuda.cpp
@@ -45,9 +45,9 @@ FixAddForceCuda::FixAddForceCuda(LAMMPS *lmp, int narg, char **arg) :
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-  if (narg < 6) error->all("Illegal fix addforce/cuda command");
+  if (narg < 6) error->all(FLERR,"Illegal fix addforce/cuda command");
 
   scalar_flag = 1;
   vector_flag = 1;
@@ -67,14 +67,14 @@ FixAddForceCuda::FixAddForceCuda(LAMMPS *lmp, int narg, char **arg) :
   int iarg = 6;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"region") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix addforce/cuda command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix addforce/cuda command");
       iregion = domain->find_region(arg[iarg+1]);
-      if (iregion == -1) error->all("Fix addforce/cuda region ID does not exist");
+      if (iregion == -1) error->all(FLERR,"Fix addforce/cuda region ID does not exist");
       iarg += 2;
-    } else error->all("Illegal fix addforce/cuda command");
+    } else error->all(FLERR,"Illegal fix addforce/cuda command");
   }
   
-  if(iregion!=-1) error->all("Error: fix addforce/cuda does not currently support 'region' option");
+  if(iregion!=-1) error->all(FLERR,"Error: fix addforce/cuda does not currently support 'region' option");
   
   force_flag = 0;
   foriginal[0] = foriginal[1] = foriginal[2] = foriginal[3] = 0.0;
diff --git a/src/USER-CUDA/fix_aveforce_cuda.cpp b/src/USER-CUDA/fix_aveforce_cuda.cpp
index 10b4555e8614461e792406b0c324328c4a0a76fa..3a80fc1b3c02e052589a39cc2dc2bd30c2ee1d1c 100644
--- a/src/USER-CUDA/fix_aveforce_cuda.cpp
+++ b/src/USER-CUDA/fix_aveforce_cuda.cpp
@@ -44,9 +44,9 @@ FixAveForceCuda::FixAveForceCuda(LAMMPS *lmp, int narg, char **arg) :
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-  if (narg != 6) error->all("Illegal fix aveforce command");
+  if (narg != 6) error->all(FLERR,"Illegal fix aveforce command");
 
   vector_flag = 1;
   size_vector = 3;
@@ -68,15 +68,15 @@ FixAveForceCuda::FixAveForceCuda(LAMMPS *lmp, int narg, char **arg) :
   int iarg = 6;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"region") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix aveforce command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix aveforce command");
       iregion = domain->find_region(arg[iarg+1]);
-      if (iregion == -1) error->all("Fix aveforce region ID does not exist");
+      if (iregion == -1) error->all(FLERR,"Fix aveforce region ID does not exist");
       iarg += 2;
-    } else error->all("Illegal fix aveforce command");
+    } else error->all(FLERR,"Illegal fix aveforce command");
 
   }
   
-  if(iregion!=-1) error->all("Error: fix aveforce/cuda does not currently support 'region' option");
+  if(iregion!=-1) error->all(FLERR,"Error: fix aveforce/cuda does not currently support 'region' option");
 
   foriginal_all[0] = foriginal_all[1] = foriginal_all[2] = foriginal_all[3] = 0.0;
   foriginal[0] = foriginal[1] = foriginal[2] = foriginal[3] = 0.0;
diff --git a/src/USER-CUDA/fix_enforce2d_cuda.cpp b/src/USER-CUDA/fix_enforce2d_cuda.cpp
index 91a1661c08ddf5d470c8492ab4a70f5007016e1d..d660814f2dccd7a9b2f46cc564f7a4a91b84e42c 100644
--- a/src/USER-CUDA/fix_enforce2d_cuda.cpp
+++ b/src/USER-CUDA/fix_enforce2d_cuda.cpp
@@ -54,9 +54,9 @@ FixEnforce2DCuda::FixEnforce2DCuda(LAMMPS *lmp, int narg, char **arg) :
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-  if (narg != 3) error->all("Illegal fix enforce2d command");
+  if (narg != 3) error->all(FLERR,"Illegal fix enforce2d command");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -75,15 +75,15 @@ int FixEnforce2DCuda::setmask()
 void FixEnforce2DCuda::init()
 {
   if (domain->dimension == 3)
-    error->all("Cannot use fix enforce2d/cuda with 3d simulation");
+    error->all(FLERR,"Cannot use fix enforce2d/cuda with 3d simulation");
   if (atom->omega_flag) 
-    error->warning("Enforce2d/cuda does not support omega_flag on gpu yet. Will be handled on cpu.");
+    error->warning(FLERR,"Enforce2d/cuda does not support omega_flag on gpu yet. Will be handled on cpu.");
   	
   if (atom->angmom_flag)
-    error->warning("Enforce2d/cuda does not support angmom_flag (angular momentum) on gpu yet. Will be handled on cpu.");
+    error->warning(FLERR,"Enforce2d/cuda does not support angmom_flag (angular momentum) on gpu yet. Will be handled on cpu.");
 
   if (atom->torque_flag) 
-    error->warning("Enforce2d/cuda does not support torque_flag on gpu yet. Will be handled on cpu.");
+    error->warning(FLERR,"Enforce2d/cuda does not support torque_flag on gpu yet. Will be handled on cpu.");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/USER-CUDA/fix_freeze_cuda.cpp b/src/USER-CUDA/fix_freeze_cuda.cpp
index d52642280ec3b83352230690da279b670bc88df9..9e8f81c5f5c377d43968d9f8546065310626dee1 100644
--- a/src/USER-CUDA/fix_freeze_cuda.cpp
+++ b/src/USER-CUDA/fix_freeze_cuda.cpp
@@ -43,12 +43,12 @@ FixFreezeCuda::FixFreezeCuda(LAMMPS *lmp, int narg, char **arg) :
 {
   cuda = lmp->cuda;
   if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-  if (narg != 3) error->all("Illegal fix freeze command");
+  if (narg != 3) error->all(FLERR,"Illegal fix freeze command");
 
   if (!atom->torque_flag)
-    error->all("Fix freeze requires atom attribute torque");
+    error->all(FLERR,"Fix freeze requires atom attribute torque");
 
   vector_flag = 1;
   size_vector = 3;
@@ -81,7 +81,7 @@ void FixFreezeCuda::init()
   int count = 0;
   for (int i = 0; i < modify->nfix; i++)
     if (strcmp(modify->fix[i]->style,"freeze") == 0) count++;
-  if (count > 1) error->all("More than one fix freeze");
+  if (count > 1) error->all(FLERR,"More than one fix freeze");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/USER-CUDA/fix_gravity_cuda.cpp b/src/USER-CUDA/fix_gravity_cuda.cpp
index 0c69dffcc16f7169a96d5ddb9178b45edf41b545..8c6d8488c8809c7b05768d6fea3701a47351644b 100644
--- a/src/USER-CUDA/fix_gravity_cuda.cpp
+++ b/src/USER-CUDA/fix_gravity_cuda.cpp
@@ -46,38 +46,38 @@ FixGravityCuda::FixGravityCuda(LAMMPS *lmp, int narg, char **arg) :
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-  if (narg < 5) error->all("Illegal fix gravity command");
+  if (narg < 5) error->all(FLERR,"Illegal fix gravity command");
 
   time_depend = 1;
 
   magnitude = atof(arg[3]);
 
   if (strcmp(arg[4],"chute") == 0) {
-    if (narg != 6) error->all("Illegal fix gravity command");
+    if (narg != 6) error->all(FLERR,"Illegal fix gravity command");
     style = CHUTE;
     phi = 0.0;
     theta = 180.0 - atof(arg[5]);
   } else if (strcmp(arg[4],"spherical") == 0) {
-    if (narg != 7) error->all("Illegal fix gravity command");
+    if (narg != 7) error->all(FLERR,"Illegal fix gravity command");
     style = SPHERICAL;
     phi = atof(arg[5]);
     theta = atof(arg[6]);
   } else if (strcmp(arg[4],"gradient") == 0) {
-    if (narg != 9) error->all("Illegal fix gravity command");
+    if (narg != 9) error->all(FLERR,"Illegal fix gravity command");
     style = GRADIENT;
     phi = atof(arg[5]);
     theta = atof(arg[6]);
     phigrad = atof(arg[7]);
     thetagrad = atof(arg[8]);
   } else if (strcmp(arg[4],"vector") == 0) {
-    if (narg != 8) error->all("Illegal fix gravity command");
+    if (narg != 8) error->all(FLERR,"Illegal fix gravity command");
     style = VECTOR;
     xdir = atof(arg[5]);
     ydir = atof(arg[6]);
     zdir = atof(arg[7]);
-  } else error->all("Illegal fix gravity command");
+  } else error->all(FLERR,"Illegal fix gravity command");
 
   double PI = 4.0*atan(1.0);
   degree2rad = PI/180.0;
diff --git a/src/USER-CUDA/fix_nh_cuda.cpp b/src/USER-CUDA/fix_nh_cuda.cpp
index 281ffaf0f6a7f93ac50daef5911c46f7b0bd694d..cfbd3f78886840a1e2cf48761fe6cd3184c50562 100644
--- a/src/USER-CUDA/fix_nh_cuda.cpp
+++ b/src/USER-CUDA/fix_nh_cuda.cpp
@@ -38,9 +38,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 enum{NOBIAS,BIAS};
 enum{NONE,XYZ,XY,YZ,XZ};
 enum{ISO,ANISO,TRICLINIC};
@@ -53,9 +50,9 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-  if (narg < 4) error->all("Illegal fix nvt/npt/nph command");
+  if (narg < 4) error->all(FLERR,"Illegal fix nvt/npt/nph command");
 
   restart_global = 1;
   time_integrate = 1;
@@ -98,17 +95,17 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
 
   while (iarg < narg) {
     if (strcmp(arg[iarg],"temp") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       tstat_flag = 1;
       t_start = atof(arg[iarg+1]);
       t_stop = atof(arg[iarg+2]);
       t_period = atof(arg[iarg+3]);
       if (t_start < 0.0 || t_stop <= 0.0)
-	error->all("Target T for fix nvt/npt/nph cannot be 0.0");
+	error->all(FLERR,"Target T for fix nvt/npt/nph cannot be 0.0");
       iarg += 4;
 
     } else if (strcmp(arg[iarg],"iso") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       pcouple = XYZ;
       p_start[0] = p_start[1] = p_start[2] = atof(arg[iarg+1]);
       p_stop[0] = p_stop[1] = p_stop[2] = atof(arg[iarg+2]);
@@ -120,7 +117,7 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       }
       iarg += 4; 
     } else if (strcmp(arg[iarg],"aniso") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       pcouple = NONE;
       p_start[0] = p_start[1] = p_start[2] = atof(arg[iarg+1]);
       p_stop[0] = p_stop[1] = p_stop[2] = atof(arg[iarg+2]);
@@ -132,7 +129,7 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       }
       iarg += 4;
     } else if (strcmp(arg[iarg],"tri") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       pcouple = NONE;
       p_start[0] = p_start[1] = p_start[2] = atof(arg[iarg+1]);
       p_stop[0] = p_stop[1] = p_stop[2] = atof(arg[iarg+2]);
@@ -153,7 +150,7 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       iarg += 4;
 
     } else if (strcmp(arg[iarg],"x") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       p_start[0] = atof(arg[iarg+1]);
       p_stop[0] = atof(arg[iarg+2]);
       p_period[0] = atof(arg[iarg+3]);
@@ -161,7 +158,7 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       deviatoric_flag = 1;
       iarg += 4; 
     } else if (strcmp(arg[iarg],"y") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       p_start[1] = atof(arg[iarg+1]);
       p_stop[1] = atof(arg[iarg+2]);
       p_period[1] = atof(arg[iarg+3]);
@@ -169,7 +166,7 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       deviatoric_flag = 1;
       iarg += 4; 
     } else if (strcmp(arg[iarg],"z") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       p_start[2] = atof(arg[iarg+1]);
       p_stop[2] = atof(arg[iarg+2]);
       p_period[2] = atof(arg[iarg+3]);
@@ -177,10 +174,10 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       deviatoric_flag = 1;
       iarg += 4; 
       if (dimension == 2)
-	error->all("Invalid fix nvt/npt/nph command for a 2d simulation");
+	error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
 
     } else if (strcmp(arg[iarg],"yz") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       p_start[3] = atof(arg[iarg+1]);
       p_stop[3] = atof(arg[iarg+2]);
       p_period[3] = atof(arg[iarg+3]);
@@ -188,9 +185,9 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       deviatoric_flag = 1;
       iarg += 4; 
       if (dimension == 2)
-	error->all("Invalid fix nvt/npt/nph command for a 2d simulation");
+	error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
     } else if (strcmp(arg[iarg],"xz") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       p_start[4] = atof(arg[iarg+1]);
       p_stop[4] = atof(arg[iarg+2]);
       p_period[4] = atof(arg[iarg+3]);
@@ -198,9 +195,9 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       deviatoric_flag = 1;
       iarg += 4; 
       if (dimension == 2)
-	error->all("Invalid fix nvt/npt/nph command for a 2d simulation");
+	error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
     } else if (strcmp(arg[iarg],"xy") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       p_start[5] = atof(arg[iarg+1]);
       p_stop[5] = atof(arg[iarg+2]);
       p_period[5] = atof(arg[iarg+3]);
@@ -209,116 +206,116 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       iarg += 4; 
 
     } else if (strcmp(arg[iarg],"couple") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       if (strcmp(arg[iarg+1],"xyz") == 0) pcouple = XYZ;
       else if (strcmp(arg[iarg+1],"xy") == 0) pcouple = XY;
       else if (strcmp(arg[iarg+1],"yz") == 0) pcouple = YZ;
       else if (strcmp(arg[iarg+1],"xz") == 0) pcouple = XZ;
       else if (strcmp(arg[iarg+1],"none") == 0) pcouple = NONE;
-      else error->all("Illegal fix nvt/npt/nph command");
+      else error->all(FLERR,"Illegal fix nvt/npt/nph command");
       iarg += 2;
 
     } else if (strcmp(arg[iarg],"drag") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       drag = atof(arg[iarg+1]);
-      if (drag < 0.0) error->all("Illegal fix nvt/npt/nph command");
+      if (drag < 0.0) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"dilate") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       if (strcmp(arg[iarg+1],"all") == 0) allremap = 1;
       else if (strcmp(arg[iarg+1],"partial") == 0) allremap = 0;
-      else error->all("Illegal fix nvt/npt/nph command");
+      else error->all(FLERR,"Illegal fix nvt/npt/nph command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"tchain") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       mtchain = atoi(arg[iarg+1]);
-      if (mtchain < 1) error->all("Illegal fix nvt/npt/nph command");
+      if (mtchain < 1) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"pchain") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       mpchain = atoi(arg[iarg+1]);
-      if (mpchain < 0) error->all("Illegal fix nvt/npt/nph command");
+      if (mpchain < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"mtk") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       if (strcmp(arg[iarg+1],"yes") == 0) mtk_flag = 1;
       else if (strcmp(arg[iarg+1],"no") == 0) mtk_flag = 0;
-      else error->all("Illegal fix nvt/npt/nph command");
+      else error->all(FLERR,"Illegal fix nvt/npt/nph command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"tloop") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       nc_tchain = atoi(arg[iarg+1]);
-      if (nc_tchain < 0) error->all("Illegal fix nvt/npt/nph command");
+      if (nc_tchain < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"ploop") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       nc_pchain = atoi(arg[iarg+1]);
-      if (nc_pchain < 0) error->all("Illegal fix nvt/npt/nph command");
+      if (nc_pchain < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"nreset") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       nreset_h0 = atoi(arg[iarg+1]);
-      if (nreset_h0 < 0) error->all("Illegal fix nvt/npt/nph command");
+      if (nreset_h0 < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       iarg += 2;
-    } else error->all("Illegal fix nvt/npt/nph command");
+    } else error->all(FLERR,"Illegal fix nvt/npt/nph command");
   }
 
   // error checks
 
   if (dimension == 2 && (p_flag[2] || p_flag[3] || p_flag[4]))
-    error->all("Invalid fix nvt/npt/nph command for a 2d simulation");
+    error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
   if (dimension == 2 && (pcouple == YZ || pcouple == XZ))
-    error->all("Invalid fix nvt/npt/nph command for a 2d simulation");
+    error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
 
   if (pcouple == XYZ && (p_flag[0] == 0 || p_flag[1] == 0))
-    error->all("Invalid fix nvt/npt/nph command pressure settings");
+    error->all(FLERR,"Invalid fix nvt/npt/nph command pressure settings");
   if (pcouple == XYZ && dimension == 3 && p_flag[2] == 0)
-    error->all("Invalid fix nvt/npt/nph command pressure settings");
+    error->all(FLERR,"Invalid fix nvt/npt/nph command pressure settings");
   if (pcouple == XY && (p_flag[0] == 0 || p_flag[1] == 0))
-    error->all("Invalid fix nvt/npt/nph command pressure settings");
+    error->all(FLERR,"Invalid fix nvt/npt/nph command pressure settings");
   if (pcouple == YZ && (p_flag[1] == 0 || p_flag[2] == 0))
-    error->all("Invalid fix nvt/npt/nph command pressure settings");
+    error->all(FLERR,"Invalid fix nvt/npt/nph command pressure settings");
   if (pcouple == XZ && (p_flag[0] == 0 || p_flag[2] == 0))
-    error->all("Invalid fix nvt/npt/nph command pressure settings");
+    error->all(FLERR,"Invalid fix nvt/npt/nph command pressure settings");
 
   if (p_flag[0] && domain->xperiodic == 0)
-    error->all("Cannot use fix nvt/npt/nph on a non-periodic dimension");
+    error->all(FLERR,"Cannot use fix nvt/npt/nph on a non-periodic dimension");
   if (p_flag[1] && domain->yperiodic == 0)
-    error->all("Cannot use fix nvt/npt/nph on a non-periodic dimension");
+    error->all(FLERR,"Cannot use fix nvt/npt/nph on a non-periodic dimension");
   if (p_flag[2] && domain->zperiodic == 0)
-    error->all("Cannot use fix nvt/npt/nph on a non-periodic dimension");
+    error->all(FLERR,"Cannot use fix nvt/npt/nph on a non-periodic dimension");
   if (p_flag[3] && domain->zperiodic == 0)
-    error->all("Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension");
+    error->all(FLERR,"Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension");
   if (p_flag[4] && domain->zperiodic == 0)
-    error->all("Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension");
+    error->all(FLERR,"Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension");
   if (p_flag[5] && domain->yperiodic == 0)
-    error->all("Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension");
+    error->all(FLERR,"Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension");
 
   if (!domain->triclinic && (p_flag[3] || p_flag[4] || p_flag[5])) 
-    error->all("Can not specify Pxy/Pxz/Pyz in "
+    error->all(FLERR,"Can not specify Pxy/Pxz/Pyz in "
 	       "fix nvt/npt/nph with non-triclinic box");
 
   if (pcouple == XYZ && dimension == 3 &&
       (p_start[0] != p_start[1] || p_start[0] != p_start[2] || 
        p_stop[0] != p_stop[1] || p_stop[0] != p_stop[2] || 
        p_period[0] != p_period[1] || p_period[0] != p_period[2]))
-    error->all("Invalid fix nvt/npt/nph pressure settings");
+    error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
   if (pcouple == XYZ && dimension == 2 &&
       (p_start[0] != p_start[1] || p_stop[0] != p_stop[1] || 
        p_period[0] != p_period[1]))
-    error->all("Invalid fix nvt/npt/nph pressure settings");
+    error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
   if (pcouple == XY && 
       (p_start[0] != p_start[1] || p_stop[0] != p_stop[1] || 
        p_period[0] != p_period[1]))
-    error->all("Invalid fix nvt/npt/nph pressure settings");
+    error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
   if (pcouple == YZ && 
       (p_start[1] != p_start[2] || p_stop[1] != p_stop[2] ||
        p_period[1] != p_period[2]))
-    error->all("Invalid fix nvt/npt/nph pressure settings");
+    error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
   if (pcouple == XZ && 
       (p_start[0] != p_start[2] || p_stop[0] != p_stop[2] ||
        p_period[0] != p_period[2]))
-    error->all("Invalid fix nvt/npt/nph pressure settings");
+    error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
 
   if ((tstat_flag && t_period <= 0.0) || 
       (p_flag[0] && p_period[0] <= 0.0) || 
@@ -327,7 +324,7 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       (p_flag[3] && p_period[3] <= 0.0) || 
       (p_flag[4] && p_period[4] <= 0.0) || 
       (p_flag[5] && p_period[5] <= 0.0))
-    error->all("Fix nvt/npt/nph damping parameters must be > 0.0");
+    error->all(FLERR,"Fix nvt/npt/nph damping parameters must be > 0.0");
 
   // set pstat_flag and box change variables
 
@@ -480,7 +477,7 @@ void FixNHCuda::init()
 	if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) || 
 	    (p_flag[2] && dimflag[2]) || (p_flag[3] && dimflag[3]) || 
 	    (p_flag[4] && dimflag[4]) || (p_flag[5] && dimflag[5]))
-	  error->all("Cannot use fix npt and fix deform on "
+	  error->all(FLERR,"Cannot use fix npt and fix deform on "
 		     "same component of stress tensor");
       }
 
@@ -488,7 +485,7 @@ void FixNHCuda::init()
 
   int icompute = modify->find_compute(id_temp);
   if (icompute < 0) 
-    error->all("Temperature ID for fix nvt/nph/npt does not exist");
+    error->all(FLERR,"Temperature ID for fix nvt/nph/npt does not exist");
   temperature = modify->compute[icompute];
 
   if (temperature->tempbias) which = BIAS;
@@ -496,7 +493,7 @@ void FixNHCuda::init()
 
   if (pstat_flag) {
     icompute = modify->find_compute(id_press);
-    if (icompute < 0) error->all("Pressure ID for fix npt/nph does not exist");
+    if (icompute < 0) error->all(FLERR,"Pressure ID for fix npt/nph does not exist");
     pressure = modify->compute[icompute];
   }
 
@@ -1098,7 +1095,7 @@ void FixNHCuda::remap()
     if (domain->yz < -0.5*domain->yprd || domain->yz > 0.5*domain->yprd ||
 	domain->xz < -0.5*domain->xprd || domain->xz > 0.5*domain->xprd ||
 	domain->xy < -0.5*domain->xprd || domain->xy > 0.5*domain->xprd)
-      error->all("Fix npt/nph has tilted box too far - "
+      error->all(FLERR,"Fix npt/nph has tilted box too far - "
 		 "box flips are not yet implemented");
   }
 
@@ -1247,7 +1244,7 @@ void FixNHCuda::restart(char *buf)
 int FixNHCuda::modify_param(int narg, char **arg)
 {
   if (strcmp(arg[0],"temp") == 0) {
-    if (narg < 2) error->all("Illegal fix_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
     if (tflag) {
       modify->delete_compute(id_temp);
       tflag = 0;
@@ -1258,28 +1255,28 @@ int FixNHCuda::modify_param(int narg, char **arg)
     strcpy(id_temp,arg[1]);
 
     int icompute = modify->find_compute(arg[1]);
-    if (icompute < 0) error->all("Could not find fix_modify temperature ID");
+    if (icompute < 0) error->all(FLERR,"Could not find fix_modify temperature ID");
     temperature = modify->compute[icompute];
 
     if (temperature->tempflag == 0)
-      error->all("Fix_modify temperature ID does not compute temperature");
+      error->all(FLERR,"Fix_modify temperature ID does not compute temperature");
     if (temperature->igroup != 0 && comm->me == 0)
-      error->warning("Temperature for fix modify is not for group all");
+      error->warning(FLERR,"Temperature for fix modify is not for group all");
 
     // reset id_temp of pressure to new temperature ID
 
     if (pstat_flag) {
       icompute = modify->find_compute(id_press);
       if (icompute < 0) 
-	error->all("Pressure ID for fix modify does not exist");
+	error->all(FLERR,"Pressure ID for fix modify does not exist");
       modify->compute[icompute]->reset_extra_compute_fix(id_temp);
     }
 
     return 2;
 
   } else if (strcmp(arg[0],"press") == 0) {
-    if (narg < 2) error->all("Illegal fix_modify command");
-    if (!pstat_flag) error->all("Illegal fix_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
+    if (!pstat_flag) error->all(FLERR,"Illegal fix_modify command");
     if (pflag) {
       modify->delete_compute(id_press);
       pflag = 0;
@@ -1290,11 +1287,11 @@ int FixNHCuda::modify_param(int narg, char **arg)
     strcpy(id_press,arg[1]);
 
     int icompute = modify->find_compute(arg[1]);
-    if (icompute < 0) error->all("Could not find fix_modify pressure ID");
+    if (icompute < 0) error->all(FLERR,"Could not find fix_modify pressure ID");
     pressure = modify->compute[icompute];
 
     if (pressure->pressflag == 0)
-      error->all("Fix_modify pressure ID does not compute pressure");
+      error->all(FLERR,"Fix_modify pressure ID does not compute pressure");
     return 2;
   }
 
diff --git a/src/USER-CUDA/fix_npt_cuda.cpp b/src/USER-CUDA/fix_npt_cuda.cpp
index 3ad0d74efb5e7485f05390e768c0db8d7710ea76..dbd395cbcfccfad80485d30090b829743a3bedf6 100644
--- a/src/USER-CUDA/fix_npt_cuda.cpp
+++ b/src/USER-CUDA/fix_npt_cuda.cpp
@@ -25,12 +25,12 @@ FixNPTCuda::FixNPTCuda(LAMMPS *lmp, int narg, char **arg) :
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
   if (!tstat_flag)
-    error->all("Temperature control must be used with fix npt");
+    error->all(FLERR,"Temperature control must be used with fix npt");
   if (!pstat_flag)
-    error->all("Pressure control must be used with fix npt");
+    error->all(FLERR,"Pressure control must be used with fix npt");
 
   // create a new compute temp style
   // id = fix-ID + temp
diff --git a/src/USER-CUDA/fix_nve_cuda.cpp b/src/USER-CUDA/fix_nve_cuda.cpp
index 88ef34dbfe59f3a5e442f6df8d853fabdbd26810..f498169c3e3a0c417c58ea07d8fbb8e46b77db25 100644
--- a/src/USER-CUDA/fix_nve_cuda.cpp
+++ b/src/USER-CUDA/fix_nve_cuda.cpp
@@ -56,10 +56,10 @@ FixNVECuda::FixNVECuda(LAMMPS *lmp, int narg, char **arg) :
   cuda = lmp->cuda;
 
   if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
   if (strcmp(style,"nve/sphere") != 0 && narg < 3)
-		error->all("Illegal fix nve command");
+		error->all(FLERR,"Illegal fix nve command");
 	
 	time_integrate = 1;
 }
diff --git a/src/USER-CUDA/fix_nvt_cuda.cpp b/src/USER-CUDA/fix_nvt_cuda.cpp
index 49a3c630133ceb680ac214dcf29d8c8ed061f42e..3d66a67e4b9bac506bebcb278d1eba4e644f71c8 100644
--- a/src/USER-CUDA/fix_nvt_cuda.cpp
+++ b/src/USER-CUDA/fix_nvt_cuda.cpp
@@ -25,9 +25,9 @@ FixNVTCuda::FixNVTCuda(LAMMPS *lmp, int narg, char **arg) :
   FixNHCuda(lmp, narg, arg)
 {
   if (!tstat_flag)
-    error->all("Temperature control must be used with fix nvt");
+    error->all(FLERR,"Temperature control must be used with fix nvt");
   if (pstat_flag)
-    error->all("Pressure control can not be used with fix nvt");
+    error->all(FLERR,"Pressure control can not be used with fix nvt");
 
   // create a new compute temp style
   // id = fix-ID + temp
diff --git a/src/USER-CUDA/fix_set_force_cuda.cpp b/src/USER-CUDA/fix_set_force_cuda.cpp
index bd9665c8cc638749aa3c93a6caf7790d5990539e..e54f64d22d18454bb41bcaefe8715e494d98bfd9 100644
--- a/src/USER-CUDA/fix_set_force_cuda.cpp
+++ b/src/USER-CUDA/fix_set_force_cuda.cpp
@@ -42,9 +42,9 @@ FixSetForceCuda::FixSetForceCuda(LAMMPS *lmp, int narg, char **arg) :
 {
   cuda = lmp->cuda;
   if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
   
-  if (narg != 6) error->all("Illegal fix setforce/cuda command");
+  if (narg != 6) error->all(FLERR,"Illegal fix setforce/cuda command");
 
   vector_flag = 1;
   size_vector = 3;
diff --git a/src/USER-CUDA/fix_shake_cuda.cpp b/src/USER-CUDA/fix_shake_cuda.cpp
index 20883889cf78468a661532fd1bfecdca2b2326f0..219ac679bd8f2f3fdbde144994c6f8cbad6f8efe 100644
--- a/src/USER-CUDA/fix_shake_cuda.cpp
+++ b/src/USER-CUDA/fix_shake_cuda.cpp
@@ -39,8 +39,6 @@ using namespace LAMMPS_NS;
 
 #define BIG 1.0e20
 #define MASSDELTA 0.1
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
 
 /* ---------------------------------------------------------------------- */
 
@@ -49,7 +47,7 @@ FixShakeCuda::FixShakeCuda(LAMMPS *lmp, int narg, char **arg) :
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
   cuda->accelerator(0,NULL);
   MPI_Comm_rank(world,&me);
@@ -63,7 +61,7 @@ FixShakeCuda::FixShakeCuda(LAMMPS *lmp, int narg, char **arg) :
   // error check
 
   if (atom->molecular == 0)
-    error->all("Cannot use fix shake with non-molecular system");
+    error->all(FLERR,"Cannot use fix shake with non-molecular system");
 
   // perform initial allocation of atom-based arrays
   // register with Atom class
@@ -88,7 +86,7 @@ FixShakeCuda::FixShakeCuda(LAMMPS *lmp, int narg, char **arg) :
 
   // parse SHAKE args
 
-  if (narg < 8) error->all("Illegal fix shake command");
+  if (narg < 8) error->all(FLERR,"Illegal fix shake command");
 
   tolerance = atof(arg[3]);
   max_iter = atoi(arg[4]);
@@ -123,28 +121,28 @@ FixShakeCuda::FixShakeCuda(LAMMPS *lmp, int narg, char **arg) :
     } else if (mode == 'b') {
       int i = atoi(arg[next]);
       if (i < 1 || i > atom->nbondtypes) 
-	error->all("Invalid bond type index for fix shake");
+	error->all(FLERR,"Invalid bond type index for fix shake");
       bond_flag[i] = 1;
 
     } else if (mode == 'a') {
       int i = atoi(arg[next]);
       if (i < 1 || i > atom->nangletypes) 
-	error->all("Invalid angle type index for fix shake");
+	error->all(FLERR,"Invalid angle type index for fix shake");
       angle_flag[i] = 1;
 
     } else if (mode == 't') {
       int i = atoi(arg[next]);
       if (i < 1 || i > atom->ntypes) 
-	error->all("Invalid atom type index for fix shake");
+	error->all(FLERR,"Invalid atom type index for fix shake");
       type_flag[i] = 1;
 
     } else if (mode == 'm') {
       double massone = atof(arg[next]);
-      if (massone == 0.0) error->all("Invalid atom mass for fix shake");
-      if (nmass == atom->ntypes) error->all("Too many masses for fix shake");
+      if (massone == 0.0) error->all(FLERR,"Invalid atom mass for fix shake");
+      if (nmass == atom->ntypes) error->all(FLERR,"Too many masses for fix shake");
       mass_list[nmass++] = massone;
 
-    } else error->all("Illegal fix shake command");
+    } else error->all(FLERR,"Illegal fix shake command");
     next++;
   }
 
@@ -312,13 +310,13 @@ void FixShakeCuda::init()
   int count = 0;
   for (i = 0; i < modify->nfix; i++)
     if (strcmp(modify->fix[i]->style,"shake") == 0) count++;
-  if (count > 1) error->all("More than one fix shake");
+  if (count > 1) error->all(FLERR,"More than one fix shake");
 
   // cannot use with minimization since SHAKE turns off bonds
   // that should contribute to potential energy
 
   if (update->whichflag == 2)
-    error->all("Fix shake cannot be used with minimization");
+    error->all(FLERR,"Fix shake cannot be used with minimization");
 
   // error if npt,nph fix comes before shake fix
 
@@ -329,7 +327,7 @@ void FixShakeCuda::init()
   if (i < modify->nfix) {
     for (int j = i; j < modify->nfix; j++)
       if (strcmp(modify->fix[j]->style,"shake") == 0)
-	error->all("Shake fix must come before NPT/NPH fix");
+	error->all(FLERR,"Shake fix must come before NPT/NPH fix");
   }
 
   // if rRESPA, find associated fix that must exist
@@ -347,7 +345,7 @@ void FixShakeCuda::init()
   // set equilibrium bond distances
 
   if (force->bond == NULL)
-    error->all("Bond potential must be defined for SHAKE");
+    error->all(FLERR,"Bond potential must be defined for SHAKE");
   for (i = 1; i <= atom->nbondtypes; i++) 
     bond_distance[i] = force->bond->equilibrium_distance(i);
 
@@ -358,7 +356,7 @@ void FixShakeCuda::init()
   for (i = 1; i <= atom->nangletypes; i++) {
     if (angle_flag[i] == 0) continue;
     if (force->angle == NULL)
-      error->all("Angle potential must be defined for SHAKE");
+      error->all(FLERR,"Angle potential must be defined for SHAKE");
 
     // scan all atoms for a SHAKE angle cluster
     // extract bond types for the 2 bonds in the cluster
@@ -385,7 +383,7 @@ void FixShakeCuda::init()
     // error check for any bond types that are not the same
     
     MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_MAX,world);
-    if (flag_all) error->all("Shake angles have different bond types");
+    if (flag_all) error->all(FLERR,"Shake angles have different bond types");
     
     // insure all procs have bond types
     
@@ -500,7 +498,7 @@ void FixShakeCuda::pre_neighbor()
 	  sprintf(str,
 		  "Shake atoms %d %d missing on proc %d at step " BIGINT_FORMAT,
 		  shake_atom[i][0],shake_atom[i][1],me,update->ntimestep);
-	  error->one(str);
+	  error->one(FLERR,str);
 	}
 	if (i <= atom1 && i <= atom2) list[nlist++] = i;
       } else if (shake_flag[i] % 2 == 1) {
@@ -514,7 +512,7 @@ void FixShakeCuda::pre_neighbor()
 		  BIGINT_FORMAT,
 		  shake_atom[i][0],shake_atom[i][1],shake_atom[i][2],
 		  me,update->ntimestep);
-	  error->one(str);
+	  error->one(FLERR,str);
 	}
 	if (i <= atom1 && i <= atom2 && i <= atom3) list[nlist++] = i;
       } else {
@@ -530,7 +528,7 @@ void FixShakeCuda::pre_neighbor()
 		  shake_atom[i][0],shake_atom[i][1],
 		  shake_atom[i][2],shake_atom[i][3],
 		  me,update->ntimestep);
-	  error->one(str);
+	  error->one(FLERR,str);
 	}
 	if (i <= atom1 && i <= atom2 && i <= atom3 && i <= atom4) 
 	  list[nlist++] = i;
@@ -906,7 +904,7 @@ void FixShakeCuda::find_clusters()
     }
 
   MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_SUM,world);
-  if (flag_all) error->all("Did not find fix shake partner info");
+  if (flag_all) error->all(FLERR,"Did not find fix shake partner info");
 
   // -----------------------------------------------------
   // identify SHAKEable bonds
@@ -1040,7 +1038,7 @@ void FixShakeCuda::find_clusters()
   flag = 0;
   for (i = 0; i < nlocal; i++) if (nshake[i] > 3) flag = 1;
   MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_SUM,world);
-  if (flag_all) error->all("Shake cluster of more than 4 atoms");
+  if (flag_all) error->all(FLERR,"Shake cluster of more than 4 atoms");
 
   flag = 0;
   for (i = 0; i < nlocal; i++) {
@@ -1049,7 +1047,7 @@ void FixShakeCuda::find_clusters()
       if (partner_shake[i][j] && partner_nshake[i][j] > 1) flag = 1;
   }
   MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_SUM,world);
-  if (flag_all) error->all("Shake clusters are connected");
+  if (flag_all) error->all(FLERR,"Shake clusters are connected");
 
   // -----------------------------------------------------
   // set SHAKE arrays that are stored with atoms & add angle constraints
@@ -1418,7 +1416,7 @@ void FixShakeCuda::shake2(int m)
 
   double determ = b*b - 4.0*a*c;
   if (determ < 0.0) {
-    error->warning("Shake determinant < 0.0");
+    error->warning(FLERR,"Shake determinant < 0.0");
     determ = 0.0;
   }
 
@@ -1537,7 +1535,7 @@ void FixShakeCuda::shake3(int m)
   // inverse of matrix
 
   double determ = a11*a22 - a12*a21;
-  if (determ == 0.0) error->one("Shake determinant = 0.0");
+  if (determ == 0.0) error->one(FLERR,"Shake determinant = 0.0");
   double determinv = 1.0/determ;
   
   double a11inv = a22*determinv;
@@ -1731,7 +1729,7 @@ void FixShakeCuda::shake4(int m)
 
   double determ = a11*a22*a33 + a12*a23*a31 + a13*a21*a32 -
     a11*a23*a32 - a12*a21*a33 - a13*a22*a31;
-  if (determ == 0.0) error->one("Shake determinant = 0.0");
+  if (determ == 0.0) error->one(FLERR,"Shake determinant = 0.0");
   double determinv = 1.0/determ;
   
   double a11inv = determinv * (a22*a33 - a23*a32);
@@ -1972,7 +1970,7 @@ void FixShakeCuda::shake3angle(int m)
 
   double determ = a11*a22*a33 + a12*a23*a31 + a13*a21*a32 -
     a11*a23*a32 - a12*a21*a33 - a13*a22*a31;
-  if (determ == 0.0) error->one("Shake determinant = 0.0");
+  if (determ == 0.0) error->one(FLERR,"Shake determinant = 0.0");
   double determinv = 1.0/determ;
   
   double a11inv = determinv * (a22*a33 - a23*a32);
diff --git a/src/USER-CUDA/fix_temp_berendsen_cuda.cpp b/src/USER-CUDA/fix_temp_berendsen_cuda.cpp
index 5fe9b0544a5c78ecfa5eea5d841360e6ba153b76..697ddbefd1a217c97549b41d660fc7f9999cb2c6 100644
--- a/src/USER-CUDA/fix_temp_berendsen_cuda.cpp
+++ b/src/USER-CUDA/fix_temp_berendsen_cuda.cpp
@@ -61,9 +61,9 @@ FixTempBerendsenCuda::FixTempBerendsenCuda(LAMMPS *lmp, int narg, char **arg) :
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-  if (narg != 6) error->all("Illegal fix temp/berendsen/cuda command");
+  if (narg != 6) error->all(FLERR,"Illegal fix temp/berendsen/cuda command");
 
   // Berendsen thermostat should be applied every step
 
@@ -75,7 +75,7 @@ FixTempBerendsenCuda::FixTempBerendsenCuda(LAMMPS *lmp, int narg, char **arg) :
 
   // error checks
 
-  if (t_period <= 0.0) error->all("Fix temp/berendsen/cuda period must be > 0.0");
+  if (t_period <= 0.0) error->all(FLERR,"Fix temp/berendsen/cuda period must be > 0.0");
 
   // create a new compute temp style
   // id = fix-ID + temp, compute group = fix group
@@ -119,10 +119,10 @@ void FixTempBerendsenCuda::init()
 {
   int icompute = modify->find_compute(id_temp);
   if (icompute < 0) 
-    error->all("Temperature ID for fix temp/berendsen/cuda does not exist");
+    error->all(FLERR,"Temperature ID for fix temp/berendsen/cuda does not exist");
   temperature = modify->compute[icompute];
   if(not temperature->cudable) 
-	error->warning("Fix temp/berendsen/cuda uses non cudable temperature compute");
+	error->warning(FLERR,"Fix temp/berendsen/cuda uses non cudable temperature compute");
   if (temperature->tempbias) which = BIAS;
   else which = NOBIAS;
 
@@ -137,7 +137,7 @@ void FixTempBerendsenCuda::end_of_step()
   if(not temperature->cudable) {cuda->cu_x->download();cuda->cu_v->download();}
   t_current = temperature->compute_scalar();
   if (t_current == 0.0)
-    error->all("Computed temperature for fix temp/berendsen/cuda cannot be 0.0");
+    error->all(FLERR,"Computed temperature for fix temp/berendsen/cuda cannot be 0.0");
 
   double delta = update->ntimestep - update->beginstep;
   delta /= update->endstep - update->beginstep;
@@ -185,7 +185,7 @@ void FixTempBerendsenCuda::end_of_step()
 int FixTempBerendsenCuda::modify_param(int narg, char **arg)
 {
   if (strcmp(arg[0],"temp") == 0) {
-    if (narg < 2) error->all("Illegal fix_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
     if (tflag) {
       modify->delete_compute(id_temp);
       tflag = 0;
@@ -196,13 +196,13 @@ int FixTempBerendsenCuda::modify_param(int narg, char **arg)
     strcpy(id_temp,arg[1]);
 
     int icompute = modify->find_compute(id_temp);
-    if (icompute < 0) error->all("Could not find fix_modify temperature ID");
+    if (icompute < 0) error->all(FLERR,"Could not find fix_modify temperature ID");
     temperature = modify->compute[icompute];
 
     if (temperature->tempflag == 0)
-      error->all("Fix_modify temperature ID does not compute temperature");
+      error->all(FLERR,"Fix_modify temperature ID does not compute temperature");
     if (temperature->igroup != igroup && comm->me == 0)
-      error->warning("Group for fix_modify temp != fix group");
+      error->warning(FLERR,"Group for fix_modify temp != fix group");
     return 2;
   }
   return 0;
diff --git a/src/USER-CUDA/fix_temp_rescale_cuda.cpp b/src/USER-CUDA/fix_temp_rescale_cuda.cpp
index a633bdc86100f551ea69b496ce22983220b99768..df23ef36a4926bc0cbb9105da4cb96f7d75f9c4c 100644
--- a/src/USER-CUDA/fix_temp_rescale_cuda.cpp
+++ b/src/USER-CUDA/fix_temp_rescale_cuda.cpp
@@ -50,12 +50,12 @@ FixTempRescaleCuda::FixTempRescaleCuda(LAMMPS *lmp, int narg, char **arg) :
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-  if (narg < 8) error->all("Illegal fix temp/rescale/cuda command");
+  if (narg < 8) error->all(FLERR,"Illegal fix temp/rescale/cuda command");
 
   nevery = atoi(arg[3]);
-  if (nevery <= 0) error->all("Illegal fix temp/rescale/cuda command");
+  if (nevery <= 0) error->all(FLERR,"Illegal fix temp/rescale/cuda command");
 
   scalar_flag = 1;
   global_freq = nevery;
@@ -111,10 +111,10 @@ void FixTempRescaleCuda::init()
 {
   int icompute = modify->find_compute(id_temp);
   if (icompute < 0) 
-    error->all("Temperature ID for fix temp/rescale/cuda does not exist");
+    error->all(FLERR,"Temperature ID for fix temp/rescale/cuda does not exist");
   temperature = modify->compute[icompute];
   if(not temperature->cudable) 
-	error->warning("Fix temp/rescale/cuda uses non cudable temperature compute");
+	error->warning(FLERR,"Fix temp/rescale/cuda uses non cudable temperature compute");
   if (temperature->tempbias) which = BIAS;
   else which = NOBIAS;
 }
@@ -127,7 +127,7 @@ void FixTempRescaleCuda::end_of_step()
   if(not temperature->cudable) {cuda->cu_x->download();cuda->cu_v->download();}
   t_current = temperature->compute_scalar();
   if (t_current == 0.0)
-    error->all("Computed temperature for fix temp/rescale/cuda cannot be 0.0");
+    error->all(FLERR,"Computed temperature for fix temp/rescale/cuda cannot be 0.0");
 
   double delta = update->ntimestep - update->beginstep;
   delta /= update->endstep - update->beginstep;
@@ -181,7 +181,7 @@ void FixTempRescaleCuda::end_of_step()
 int FixTempRescaleCuda::modify_param(int narg, char **arg)
 {
   if (strcmp(arg[0],"temp") == 0) {
-    if (narg < 2) error->all("Illegal fix_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
     if (tflag) {
       modify->delete_compute(id_temp);
       tflag = 0;
@@ -192,15 +192,15 @@ int FixTempRescaleCuda::modify_param(int narg, char **arg)
     strcpy(id_temp,arg[1]);
 
     int icompute = modify->find_compute(id_temp);
-    if (icompute < 0) error->all("Could not find fix_modify temperature ID");
+    if (icompute < 0) error->all(FLERR,"Could not find fix_modify temperature ID");
     temperature = modify->compute[icompute];
 
     if (temperature->tempflag == 0)
-      error->all("Fix_modify temperature ID does not compute temperature");
+      error->all(FLERR,"Fix_modify temperature ID does not compute temperature");
     if (temperature->igroup != igroup && comm->me == 0)
-      error->warning("Group for fix_modify temp != fix group");
+      error->warning(FLERR,"Group for fix_modify temp != fix group");
     if(not temperature->cudable) 
-	  error->warning("Fix temp/rescale/cuda uses non cudable temperature compute");
+	  error->warning(FLERR,"Fix temp/rescale/cuda uses non cudable temperature compute");
     return 2;
   }
   return 0;
diff --git a/src/USER-CUDA/fix_temp_rescale_limit_cuda.cpp b/src/USER-CUDA/fix_temp_rescale_limit_cuda.cpp
index be2d6a1f29ba210688013451dedb962894104819..875cb391a55615e19f70ce5123a379be160c18d3 100644
--- a/src/USER-CUDA/fix_temp_rescale_limit_cuda.cpp
+++ b/src/USER-CUDA/fix_temp_rescale_limit_cuda.cpp
@@ -40,8 +40,6 @@
 #include "cuda_modify_flags.h"
 
 using namespace LAMMPS_NS;
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
 
 enum{NOBIAS,BIAS};
 
@@ -52,12 +50,12 @@ FixTempRescaleLimitCuda::FixTempRescaleLimitCuda(LAMMPS *lmp, int narg, char **a
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-  if (narg < 9) error->all("Illegal fix temp/rescale/limit/cuda command");
+  if (narg < 9) error->all(FLERR,"Illegal fix temp/rescale/limit/cuda command");
 
   nevery = atoi(arg[3]);
-  if (nevery <= 0) error->all("Illegal fix temp/rescale/limit/cuda command");
+  if (nevery <= 0) error->all(FLERR,"Illegal fix temp/rescale/limit/cuda command");
 
   scalar_flag = 1;
   global_freq = nevery;
@@ -68,7 +66,7 @@ FixTempRescaleLimitCuda::FixTempRescaleLimitCuda(LAMMPS *lmp, int narg, char **a
   t_window = atof(arg[6]);
   fraction = atof(arg[7]);
   limit = atof(arg[8]);
-  if (limit <= 1.0) error->all("Illegal fix temp/rescale/limit/cuda command (limit must be > 1.0)");
+  if (limit <= 1.0) error->all(FLERR,"Illegal fix temp/rescale/limit/cuda command (limit must be > 1.0)");
   
 
   // create a new compute temp
@@ -116,10 +114,10 @@ void FixTempRescaleLimitCuda::init()
 {
   int icompute = modify->find_compute(id_temp);
   if (icompute < 0) 
-    error->all("Temperature ID for fix temp/rescale/limit/cuda does not exist");
+    error->all(FLERR,"Temperature ID for fix temp/rescale/limit/cuda does not exist");
   temperature = modify->compute[icompute];
   if(not temperature->cudable) 
-	error->warning("Fix temp/rescale/limit/cuda uses non cudable temperature compute");
+	error->warning(FLERR,"Fix temp/rescale/limit/cuda uses non cudable temperature compute");
   if (temperature->tempbias) which = BIAS;
   else which = NOBIAS;
 }
@@ -132,7 +130,7 @@ void FixTempRescaleLimitCuda::end_of_step()
   if(not temperature->cudable) {cuda->cu_x->download();cuda->cu_v->download();}
   t_current = temperature->compute_scalar();
   if (t_current == 0.0)
-    error->all("Computed temperature for fix temp/rescale/limit/cuda cannot be 0.0");
+    error->all(FLERR,"Computed temperature for fix temp/rescale/limit/cuda cannot be 0.0");
 
   double delta = update->ntimestep - update->beginstep;
   delta /= update->endstep - update->beginstep;
@@ -196,7 +194,7 @@ void FixTempRescaleLimitCuda::end_of_step()
 int FixTempRescaleLimitCuda::modify_param(int narg, char **arg)
 {
   if (strcmp(arg[0],"temp") == 0) {
-    if (narg < 2) error->all("Illegal fix_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
     if (tflag) {
       modify->delete_compute(id_temp);
       tflag = 0;
@@ -207,15 +205,15 @@ int FixTempRescaleLimitCuda::modify_param(int narg, char **arg)
     strcpy(id_temp,arg[1]);
 
     int icompute = modify->find_compute(id_temp);
-    if (icompute < 0) error->all("Could not find fix_modify temperature ID");
+    if (icompute < 0) error->all(FLERR,"Could not find fix_modify temperature ID");
     temperature = modify->compute[icompute];
 
     if (temperature->tempflag == 0)
-      error->all("Fix_modify temperature ID does not compute temperature");
+      error->all(FLERR,"Fix_modify temperature ID does not compute temperature");
     if (temperature->igroup != igroup && comm->me == 0)
-      error->warning("Group for fix_modify temp != fix group");
+      error->warning(FLERR,"Group for fix_modify temp != fix group");
     if(not temperature->cudable) 
-	  error->warning("Fix temp/rescale/limit/cuda uses non cudable temperature compute");
+	  error->warning(FLERR,"Fix temp/rescale/limit/cuda uses non cudable temperature compute");
     return 2;
   }
   return 0;
diff --git a/src/USER-CUDA/fix_viscous_cuda.cpp b/src/USER-CUDA/fix_viscous_cuda.cpp
index 37509dcb352eebd644e07e0279d26f2dabdbef3b..e0f32e7b6946e2af4f029d65ef5cb8bbc1a2f4d3 100644
--- a/src/USER-CUDA/fix_viscous_cuda.cpp
+++ b/src/USER-CUDA/fix_viscous_cuda.cpp
@@ -42,7 +42,7 @@ FixViscousCuda::FixViscousCuda(LAMMPS *lmp, int narg, char **arg) :
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	cu_gamma=NULL;
 }
diff --git a/src/USER-CUDA/modify_cuda.cpp b/src/USER-CUDA/modify_cuda.cpp
index 6eb832803d61af31b4aaae8568aaadbfd10780da..9fd0435892ef99955ff2f08f2e0237bd494cdd39 100644
--- a/src/USER-CUDA/modify_cuda.cpp
+++ b/src/USER-CUDA/modify_cuda.cpp
@@ -53,9 +53,6 @@ using namespace LAMMPS_NS;
 
 #include "cuda_modify_flags.h"
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 #define BIG 1.0e20
 
 /* ---------------------------------------------------------------------- */
@@ -64,7 +61,7 @@ ModifyCuda::ModifyCuda(LAMMPS *lmp) : Modify(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
   n_initial_integrate_cuda = 0;
   n_post_integrate_cuda = 0;
@@ -242,7 +239,7 @@ void ModifyCuda::init()
   int checkall;
   MPI_Allreduce(&check,&checkall,1,MPI_INT,MPI_SUM,world);
   if (comm->me == 0 && checkall)
-    error->warning("One or more atoms are time integrated more than once");
+    error->warning(FLERR,"One or more atoms are time integrated more than once");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/USER-CUDA/neigh_full_cuda.cpp b/src/USER-CUDA/neigh_full_cuda.cpp
index 197b62a0ac48e3625f495405f32336e335b93b78..61c9897f4a862873ddc8e134169346c599107212 100644
--- a/src/USER-CUDA/neigh_full_cuda.cpp
+++ b/src/USER-CUDA/neigh_full_cuda.cpp
@@ -40,7 +40,7 @@ using namespace LAMMPS_NS;
 void NeighborCuda::full_bin_cuda(NeighList *list)
 {
   MYDBG(printf(" # CUDA::NeighFullBinCuda ... start\n");)
-  if(includegroup) error->warning("Warning using inlcudegroup neighborbuild. This is not yet supported by CUDA neighborbuild styles.\n");
+  if(includegroup) error->warning(FLERR,"Warning using inlcudegroup neighborbuild. This is not yet supported by CUDA neighborbuild styles.\n");
   int nlocal = atom->nlocal;
   int nall = nlocal + atom->nghost;
  
@@ -93,7 +93,7 @@ void NeighborCuda::full_bin_cuda(NeighList *list)
     	slist->binned_id=(int*) CudaWrapper_AllocCudaData(slist->bin_dim[0]*slist->bin_dim[1]*slist->bin_dim[2]*slist->bin_nmax*sizeof(int));
  	  //printf("slist->bin: %i %i %i %i \n", bin_dim_tmp[0],bin_dim_tmp[1],bin_dim_tmp[2],bin_nmax_tmp);
     }
-    //if(list->cuda_list->sneighlist.bin_nmax>512) error->all("To many atoms per bin. Likely cause is very long pair cutoff. This needs major rewrite of code and is not yet scheduled to be done.\n");
+    //if(list->cuda_list->sneighlist.bin_nmax>512) error->all(FLERR,"To many atoms per bin. Likely cause is very long pair cutoff. This needs major rewrite of code and is not yet scheduled to be done.\n");
   }while(Cuda_BinAtoms(&cuda->shared_data, &list->cuda_list->sneighlist));
 
  // cuda->cu_debugdata->memset_device(0);
diff --git a/src/USER-CUDA/neighbor_cuda.cpp b/src/USER-CUDA/neighbor_cuda.cpp
index e8f317afd3d3c7b77af835abce322b198e1eb8eb..99bf2dce3cc1ee3ad4b9c13b06195e94d594b9e3 100644
--- a/src/USER-CUDA/neighbor_cuda.cpp
+++ b/src/USER-CUDA/neighbor_cuda.cpp
@@ -26,9 +26,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 enum{NSQ,BIN,MULTI};     // also in neigh_list.cpp
 
 /* ---------------------------------------------------------------------- */
@@ -37,7 +34,7 @@ NeighborCuda::NeighborCuda(LAMMPS *lmp) : Neighbor(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -206,7 +203,7 @@ void NeighborCuda::build()
   // check that neighbor list with special bond flags will not overflow
 
   if (atom->nlocal+atom->nghost > NEIGHMASK)
-    error->one("Too many local+ghost atoms for neighbor list");
+    error->one(FLERR,"Too many local+ghost atoms for neighbor list");
 
   // invoke building of pair and molecular neighbor lists
   // only for pairwise lists with buildflag set
diff --git a/src/USER-CUDA/pair_born_coul_long_cuda.cpp b/src/USER-CUDA/pair_born_coul_long_cuda.cpp
index 1d8c65631626e3412ccb4cb725ceb3853e0fbd21..f5aaff51f01ae56eb10c347a2b9762615755bf40 100644
--- a/src/USER-CUDA/pair_born_coul_long_cuda.cpp
+++ b/src/USER-CUDA/pair_born_coul_long_cuda.cpp
@@ -46,9 +46,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define EWALD_F   1.12837917
 #define EWALD_P   0.3275911
 #define A1        0.254829592
@@ -62,7 +59,7 @@ PairBornCoulLongCuda::PairBornCoulLongCuda(LAMMPS *lmp) : PairBornCoulLong(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	allocated2 = false;
 	cuda->shared_data.pair.cudable_force = 1;
@@ -134,12 +131,12 @@ void PairBornCoulLongCuda::coeff(int narg, char **arg)
 void PairBornCoulLongCuda::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style born/coul/long requires atom attribute q");
+    error->all(FLERR,"Pair style born/coul/long requires atom attribute q");
   // request regular or rRESPA neighbor lists
 
   int irequest;
  
-  if (strstr(update->integrate_style,"respa")) error->all("Integrate Style Respa is not supported by pair style buck/coul/long/cuda");
+  if (strstr(update->integrate_style,"respa")) error->all(FLERR,"Integrate Style Respa is not supported by pair style buck/coul/long/cuda");
   	
   	irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
@@ -151,13 +148,13 @@ void PairBornCoulLongCuda::init_style()
   cuda->shared_data.pair.cut_coulsq_global=cut_coulsq;
 
   if (force->kspace == NULL)
-    error->all("Pair style is incompatible with KSpace style");
+    error->all(FLERR,"Pair style is incompatible with KSpace style");
   g_ewald = force->kspace->g_ewald;
   cuda->shared_data.pair.g_ewald=g_ewald;
   cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
   
 
-  if(ncoultablebits) error->warning("# CUDA: You asked for the useage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
+  if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the useage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
 }
 
 void PairBornCoulLongCuda::init_list(int id, NeighList *ptr)
diff --git a/src/USER-CUDA/pair_buck_coul_cut_cuda.cpp b/src/USER-CUDA/pair_buck_coul_cut_cuda.cpp
index 4416a3d197e244ea8b52e152ed7205860544c3cc..bc085461841aa2d95a2e37f0f4f40d21964b9f79 100644
--- a/src/USER-CUDA/pair_buck_coul_cut_cuda.cpp
+++ b/src/USER-CUDA/pair_buck_coul_cut_cuda.cpp
@@ -46,16 +46,13 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairBuckCoulCutCuda::PairBuckCoulCutCuda(LAMMPS *lmp) : PairBuckCoulCut(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	allocated2 = false;
 	cuda->shared_data.pair.cudable_force = 1;
@@ -127,12 +124,12 @@ void PairBuckCoulCutCuda::coeff(int narg, char **arg)
 void PairBuckCoulCutCuda::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style buck/coul/long requires atom attribute q");
+    error->all(FLERR,"Pair style buck/coul/long requires atom attribute q");
   // request regular or rRESPA neighbor lists
 
   int irequest;
  
-  if (strstr(update->integrate_style,"respa")) error->all("Integrate Style Respa is not supported by pair style buck/coul/long/cuda");
+  if (strstr(update->integrate_style,"respa")) error->all(FLERR,"Integrate Style Respa is not supported by pair style buck/coul/long/cuda");
   	
   	irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
@@ -144,7 +141,7 @@ void PairBuckCoulCutCuda::init_style()
   
    cuda->shared_data.pair.cut_coulsq_global=cut_coul_global * cut_coul_global;
 
-  if(ncoultablebits) error->warning("# CUDA: You asked for the useage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
+  if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the useage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
 }
 
 void PairBuckCoulCutCuda::init_list(int id, NeighList *ptr)
diff --git a/src/USER-CUDA/pair_buck_coul_long_cuda.cpp b/src/USER-CUDA/pair_buck_coul_long_cuda.cpp
index 9044d2128c40e9e6da31a6a8f3d1eff4c1ad619d..4cbd304e07593b5757400dcd1509c50f211920c4 100644
--- a/src/USER-CUDA/pair_buck_coul_long_cuda.cpp
+++ b/src/USER-CUDA/pair_buck_coul_long_cuda.cpp
@@ -46,9 +46,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define EWALD_F   1.12837917
 #define EWALD_P   0.3275911
 #define A1        0.254829592
@@ -62,7 +59,7 @@ PairBuckCoulLongCuda::PairBuckCoulLongCuda(LAMMPS *lmp) : PairBuckCoulLong(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	allocated2 = false;
 	cuda->shared_data.pair.cudable_force = 1;
@@ -132,12 +129,12 @@ void PairBuckCoulLongCuda::coeff(int narg, char **arg)
 void PairBuckCoulLongCuda::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style buck/coul/long requires atom attribute q");
+    error->all(FLERR,"Pair style buck/coul/long requires atom attribute q");
   // request regular or rRESPA neighbor lists
 
   int irequest;
  
-  if (strstr(update->integrate_style,"respa")) error->all("Integrate Style Respa is not supported by pair style buck/coul/long/cuda");
+  if (strstr(update->integrate_style,"respa")) error->all(FLERR,"Integrate Style Respa is not supported by pair style buck/coul/long/cuda");
   	
   	irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
@@ -149,13 +146,13 @@ void PairBuckCoulLongCuda::init_style()
   cuda->shared_data.pair.cut_coulsq_global=cut_coulsq;
 
   if (force->kspace == NULL)
-    error->all("Pair style is incompatible with KSpace style");
+    error->all(FLERR,"Pair style is incompatible with KSpace style");
   g_ewald = force->kspace->g_ewald;
   cuda->shared_data.pair.g_ewald=g_ewald;
   cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
   
 
-  if(ncoultablebits) error->warning("# CUDA: You asked for the useage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
+  if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the useage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
 }
 
 void PairBuckCoulLongCuda::init_list(int id, NeighList *ptr)
diff --git a/src/USER-CUDA/pair_buck_cuda.cpp b/src/USER-CUDA/pair_buck_cuda.cpp
index e9067833902f605e01bfece51f67fed3d0b76c88..a537e600ed5a2114bf6aa7af51d812c75e1165bb 100644
--- a/src/USER-CUDA/pair_buck_cuda.cpp
+++ b/src/USER-CUDA/pair_buck_cuda.cpp
@@ -46,16 +46,13 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairBuckCuda::PairBuckCuda(LAMMPS *lmp) : PairBuck(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	allocated2 = false;
 	cuda->shared_data.pair.cudable_force = 1;
@@ -124,12 +121,12 @@ void PairBuckCuda::coeff(int narg, char **arg)
 void PairBuckCuda::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style buck/coul/long requires atom attribute q");
+    error->all(FLERR,"Pair style buck/coul/long requires atom attribute q");
   // request regular or rRESPA neighbor lists
 
   int irequest;
  
-  if (strstr(update->integrate_style,"respa")) error->all("Integrate Style Respa is not supported by pair style buck/coul/long/cuda");
+  if (strstr(update->integrate_style,"respa")) error->all(FLERR,"Integrate Style Respa is not supported by pair style buck/coul/long/cuda");
   	
   	irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
@@ -140,7 +137,7 @@ void PairBuckCuda::init_style()
   cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
   
 
-  if(ncoultablebits) error->warning("# CUDA: You asked for the useage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
+  if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the useage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
 }
 
 void PairBuckCuda::init_list(int id, NeighList *ptr)
diff --git a/src/USER-CUDA/pair_cg_cmm_coul_cut_cuda.cpp b/src/USER-CUDA/pair_cg_cmm_coul_cut_cuda.cpp
index 1c82a8d797dfe4f17a07cda0aafcd051cb4373da..5334e91f97f22b0619d1ff0474f58f67694c1bd1 100644
--- a/src/USER-CUDA/pair_cg_cmm_coul_cut_cuda.cpp
+++ b/src/USER-CUDA/pair_cg_cmm_coul_cut_cuda.cpp
@@ -61,16 +61,13 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairCGCMMCoulCutCuda::PairCGCMMCoulCutCuda(LAMMPS *lmp) : PairCGCMMCoulCut(lmp)
 {
   cuda = lmp->cuda;
   if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	allocated2 = false;
 	cg_type_double = NULL;
@@ -171,7 +168,7 @@ void PairCGCMMCoulCutCuda::init_style()
 
   cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
   cut_respa=NULL;
-  if (force->newton) error->warning("Pair style uses does not use \"newton\" setting. You might test if \"newton off\" makes the simulation run faster.");
+  if (force->newton) error->warning(FLERR,"Pair style uses does not use \"newton\" setting. You might test if \"newton off\" makes the simulation run faster.");
 
   MYDBG(printf("# CUDA PairCGCMMCoulCutCuda::init_style end\n"); )
 }
diff --git a/src/USER-CUDA/pair_cg_cmm_coul_debye_cuda.cpp b/src/USER-CUDA/pair_cg_cmm_coul_debye_cuda.cpp
index 280ec2638a226b284e701d8a18044fb6e8aab5da..862d8e56b3ade1daec4e813d7c2ef07510763021 100644
--- a/src/USER-CUDA/pair_cg_cmm_coul_debye_cuda.cpp
+++ b/src/USER-CUDA/pair_cg_cmm_coul_debye_cuda.cpp
@@ -61,16 +61,13 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairCGCMMCoulDebyeCuda::PairCGCMMCoulDebyeCuda(LAMMPS *lmp) : PairCGCMMCoulCut(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	allocated2 = false;
 	cg_type_double = NULL;
@@ -171,7 +168,7 @@ void PairCGCMMCoulDebyeCuda::init_style()
 
   cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
   cut_respa=NULL;
-  if (force->newton) error->warning("Pair style uses does not use \"newton\" setting. You might test if \"newton off\" makes the simulation run faster.");
+  if (force->newton) error->warning(FLERR,"Pair style uses does not use \"newton\" setting. You might test if \"newton off\" makes the simulation run faster.");
 
   MYDBG(printf("# CUDA PairCGCMMCoulDebyeCuda::init_style end\n"); )
 }
diff --git a/src/USER-CUDA/pair_cg_cmm_coul_long_cuda.cpp b/src/USER-CUDA/pair_cg_cmm_coul_long_cuda.cpp
index 359769169065b8f60fd404467eea444fa3fc83a4..c2d4ede4b4511850ba68d33284f6da912f16a6d6 100644
--- a/src/USER-CUDA/pair_cg_cmm_coul_long_cuda.cpp
+++ b/src/USER-CUDA/pair_cg_cmm_coul_long_cuda.cpp
@@ -62,16 +62,13 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairCGCMMCoulLongCuda::PairCGCMMCoulLongCuda(LAMMPS *lmp) : PairCGCMMCoulLong(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	allocated2 = false;
 	cg_type_double = NULL;
@@ -174,7 +171,7 @@ void PairCGCMMCoulLongCuda::init_style()
   cuda->shared_data.pair.g_ewald=g_ewald;
   cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
   cut_respa=NULL;
-  if (force->newton) error->warning("Pair style uses does not use \"newton\" setting. You might test if \"newton off\" makes the simulation run faster.");
+  if (force->newton) error->warning(FLERR,"Pair style uses does not use \"newton\" setting. You might test if \"newton off\" makes the simulation run faster.");
   MYDBG(printf("# CUDA PairCGCMMCoulLongCuda::init_style end\n"); )
 }
 
diff --git a/src/USER-CUDA/pair_cg_cmm_cuda.cpp b/src/USER-CUDA/pair_cg_cmm_cuda.cpp
index 5471d95f23e129dcc68a5adbe91fafe295a363d1..cc3e5e585be36200ae1708c959ef198b7322dd85 100644
--- a/src/USER-CUDA/pair_cg_cmm_cuda.cpp
+++ b/src/USER-CUDA/pair_cg_cmm_cuda.cpp
@@ -61,16 +61,13 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairCGCMMCuda::PairCGCMMCuda(LAMMPS *lmp) : PairCGCMM(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	allocated2 = false;
 	cg_type_double = NULL;
diff --git a/src/USER-CUDA/pair_eam_alloy_cuda.cpp b/src/USER-CUDA/pair_eam_alloy_cuda.cpp
index eb70fcc12756cb0fadb950b6342cabf155915166..fd78c57133ebf40d370a21c4cd58555494f020eb 100644
--- a/src/USER-CUDA/pair_eam_alloy_cuda.cpp
+++ b/src/USER-CUDA/pair_eam_alloy_cuda.cpp
@@ -34,7 +34,7 @@ PairEAMAlloyCuda::PairEAMAlloyCuda(LAMMPS *lmp) : PairEAMCuda(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
   one_coeff = 1;
 }
@@ -51,12 +51,12 @@ void PairEAMAlloyCuda::coeff(int narg, char **arg)
   if (!allocated) allocate();
 
   if (narg != 3 + atom->ntypes)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   // insure I,J args are * *
 
   if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   // read EAM setfl file
 
@@ -83,7 +83,7 @@ void PairEAMAlloyCuda::coeff(int narg, char **arg)
     for (j = 0; j < setfl->nelements; j++)
       if (strcmp(arg[i],setfl->elements[j]) == 0) break;
     if (j < setfl->nelements) map[i-2] = j;
-    else error->all("No matching element in EAM potential file");
+    else error->all(FLERR,"No matching element in EAM potential file");
   }
 
   // clear setflag since coeff() called once with I,J = * *
@@ -107,7 +107,7 @@ void PairEAMAlloyCuda::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -129,7 +129,7 @@ void PairEAMAlloyCuda::read_file(char *filename)
     if (fptr == NULL) {
       char str[128];
       sprintf(str,"Cannot open EAM potential file %s",filename);
-      error->one(str);
+      error->one(FLERR,str);
     }
   }
 
@@ -150,7 +150,7 @@ void PairEAMAlloyCuda::read_file(char *filename)
   sscanf(line,"%d",&file->nelements);
   int nwords = atom->count_words(line);
   if (nwords != file->nelements + 1)
-    error->all("Incorrect element names in EAM potential file");
+    error->all(FLERR,"Incorrect element names in EAM potential file");
   
   char **words = new char*[file->nelements+1];
   nwords = 0;
diff --git a/src/USER-CUDA/pair_eam_cuda.cpp b/src/USER-CUDA/pair_eam_cuda.cpp
index 6d012a80a35e90761dbec6d35f76e865e2124272..1c9c710a9fd1424cf0ac6aef05b3b84cc3dca47f 100644
--- a/src/USER-CUDA/pair_eam_cuda.cpp
+++ b/src/USER-CUDA/pair_eam_cuda.cpp
@@ -62,16 +62,13 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairEAMCuda::PairEAMCuda(LAMMPS *lmp) : PairEAM(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	allocated2 = false;
 	cuda->shared_data.pair.cudable_force = 1;
diff --git a/src/USER-CUDA/pair_eam_fs_cuda.cpp b/src/USER-CUDA/pair_eam_fs_cuda.cpp
index c7dd6e4ee386ea592dec5343d8cda66fcde92a53..13efb5a4feefa33e7bae1737570f188c80bf104e 100644
--- a/src/USER-CUDA/pair_eam_fs_cuda.cpp
+++ b/src/USER-CUDA/pair_eam_fs_cuda.cpp
@@ -34,7 +34,7 @@ PairEAMFSCuda::PairEAMFSCuda(LAMMPS *lmp) : PairEAMCuda(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
   one_coeff = 1;
 }
@@ -51,12 +51,12 @@ void PairEAMFSCuda::coeff(int narg, char **arg)
   if (!allocated) allocate();
 
   if (narg != 3 + atom->ntypes)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   // insure I,J args are * *
 
   if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   // read EAM Finnis-Sinclair file
 
@@ -83,7 +83,7 @@ void PairEAMFSCuda::coeff(int narg, char **arg)
     for (j = 0; j < fs->nelements; j++)
       if (strcmp(arg[i],fs->elements[j]) == 0) break;
     if (j < fs->nelements) map[i-2] = j;
-    else error->all("No matching element in EAM potential file");
+    else error->all(FLERR,"No matching element in EAM potential file");
   }
 
   // clear setflag since coeff() called once with I,J = * *
@@ -107,7 +107,7 @@ void PairEAMFSCuda::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -129,7 +129,7 @@ void PairEAMFSCuda::read_file(char *filename)
     if (fptr == NULL) {
       char str[128];
       sprintf(str,"Cannot open EAM potential file %s",filename);
-      error->one(str);
+      error->one(FLERR,str);
     }
   }
 
@@ -150,7 +150,7 @@ void PairEAMFSCuda::read_file(char *filename)
   sscanf(line,"%d",&file->nelements);
   int nwords = atom->count_words(line);
   if (nwords != file->nelements + 1)
-    error->all("Incorrect element names in EAM potential file");
+    error->all(FLERR,"Incorrect element names in EAM potential file");
   
   char **words = new char*[file->nelements+1];
   nwords = 0;
diff --git a/src/USER-CUDA/pair_gran_hooke_cuda.cpp b/src/USER-CUDA/pair_gran_hooke_cuda.cpp
index 6d3dd73248a2990f3767b4eb77449c1ec0301f5b..74a3dbca8d6b4e571fdd71a4a91900a10b1491b5 100644
--- a/src/USER-CUDA/pair_gran_hooke_cuda.cpp
+++ b/src/USER-CUDA/pair_gran_hooke_cuda.cpp
@@ -63,16 +63,13 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairGranHookeCuda::PairGranHookeCuda(LAMMPS *lmp) : PairGranHooke(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	allocated2 = false;
 	cuda->shared_data.pair.cudable_force = 1;
@@ -163,9 +160,9 @@ void PairGranHookeCuda::init_style()
   }
 
   if (!atom->radius_flag || !atom->omega_flag || !atom->torque_flag)
-    error->all("Pair granular requires atom attributes radius, omega, torque");
+    error->all(FLERR,"Pair granular requires atom attributes radius, omega, torque");
   if (comm->ghost_velocity == 0)
-    error->all("Pair granular requires ghost atoms store velocity");
+    error->all(FLERR,"Pair granular requires ghost atoms store velocity");
 
   // need a half neigh list and optionally a granular history neigh list
 
diff --git a/src/USER-CUDA/pair_lj96_cut_cuda.cpp b/src/USER-CUDA/pair_lj96_cut_cuda.cpp
index f60c61bf2869a95dcfd72f1bde985f1e9f469a63..408665d85e2d028e0529d85cba145435fe8f95fc 100644
--- a/src/USER-CUDA/pair_lj96_cut_cuda.cpp
+++ b/src/USER-CUDA/pair_lj96_cut_cuda.cpp
@@ -61,16 +61,13 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairLJ96CutCuda::PairLJ96CutCuda(LAMMPS *lmp) : PairLJ96Cut(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	allocated2 = false;
 	cuda->shared_data.pair.cudable_force = 1;
diff --git a/src/USER-CUDA/pair_lj_charmm_coul_charmm_cuda.cpp b/src/USER-CUDA/pair_lj_charmm_coul_charmm_cuda.cpp
index a5a08046a9ce8e88a4cb7c9e3636816ccf6aae72..bcd35690944acdd1b4ca7d71e726ebabb76c1da7 100644
--- a/src/USER-CUDA/pair_lj_charmm_coul_charmm_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_charmm_coul_charmm_cuda.cpp
@@ -46,16 +46,13 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairLJCharmmCoulCharmmCuda::PairLJCharmmCoulCharmmCuda(LAMMPS *lmp) : PairLJCharmmCoulCharmm(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	allocated2 = false;
 	cuda->shared_data.pair.cudable_force = 1;
@@ -130,7 +127,7 @@ void PairLJCharmmCoulCharmmCuda::coeff(int narg, char **arg)
 void PairLJCharmmCoulCharmmCuda::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style lj/charmm/coul/long requires atom attribute q");
+    error->all(FLERR,"Pair style lj/charmm/coul/long requires atom attribute q");
   // request regular or rRESPA neighbor lists
 
 	if(atom->molecular)
@@ -146,7 +143,7 @@ void PairLJCharmmCoulCharmmCuda::init_style()
     neighbor->requests[irequest]->cudable = 1; 
 
    if (cut_lj_inner >= cut_lj || cut_coul_inner >= cut_coul)
-    error->all("Pair inner cutoff >= Pair outer cutoff");
+    error->all(FLERR,"Pair inner cutoff >= Pair outer cutoff");
 
   cut_lj_innersq = cut_lj_inner * cut_lj_inner;
   cut_ljsq = cut_lj * cut_lj;
diff --git a/src/USER-CUDA/pair_lj_charmm_coul_charmm_implicit_cuda.cpp b/src/USER-CUDA/pair_lj_charmm_coul_charmm_implicit_cuda.cpp
index f127d9e31a5b577bb6ac83718256bab029ed0f35..10696094c05ac3a22655e0bf6e253de7b9690970 100644
--- a/src/USER-CUDA/pair_lj_charmm_coul_charmm_implicit_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_charmm_coul_charmm_implicit_cuda.cpp
@@ -46,16 +46,13 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairLJCharmmCoulCharmmImplicitCuda::PairLJCharmmCoulCharmmImplicitCuda(LAMMPS *lmp) : PairLJCharmmCoulCharmmImplicit(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	allocated2 = false;
 	cuda->shared_data.pair.cudable_force = 1;
@@ -130,7 +127,7 @@ void PairLJCharmmCoulCharmmImplicitCuda::coeff(int narg, char **arg)
 void PairLJCharmmCoulCharmmImplicitCuda::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style lj/charmm/coul/long requires atom attribute q");
+    error->all(FLERR,"Pair style lj/charmm/coul/long requires atom attribute q");
   // request regular or rRESPA neighbor lists
 
   int irequest;
@@ -141,7 +138,7 @@ void PairLJCharmmCoulCharmmImplicitCuda::init_style()
     neighbor->requests[irequest]->cudable = 1; 
 
    if (cut_lj_inner >= cut_lj || cut_coul_inner >= cut_coul)
-    error->all("Pair inner cutoff >= Pair outer cutoff");
+    error->all(FLERR,"Pair inner cutoff >= Pair outer cutoff");
 
   cut_lj_innersq = cut_lj_inner * cut_lj_inner;
   cut_ljsq = cut_lj * cut_lj;
diff --git a/src/USER-CUDA/pair_lj_charmm_coul_long_cuda.cpp b/src/USER-CUDA/pair_lj_charmm_coul_long_cuda.cpp
index 434f098f3785dfb655b86bd001d8094c1fb690f5..29629f1ed512c73ff253d1202c598edaa9003252 100644
--- a/src/USER-CUDA/pair_lj_charmm_coul_long_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_charmm_coul_long_cuda.cpp
@@ -46,9 +46,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define EWALD_F   1.12837917
 #define EWALD_P   0.3275911
 #define A1        0.254829592
@@ -62,7 +59,7 @@ PairLJCharmmCoulLongCuda::PairLJCharmmCoulLongCuda(LAMMPS *lmp) : PairLJCharmmCo
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	allocated2 = false;
 	cuda->shared_data.pair.cudable_force = 1;
@@ -139,7 +136,7 @@ void PairLJCharmmCoulLongCuda::coeff(int narg, char **arg)
 void PairLJCharmmCoulLongCuda::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style lj/charmm/coul/long requires atom attribute q");
+    error->all(FLERR,"Pair style lj/charmm/coul/long requires atom attribute q");
   // request regular or rRESPA neighbor lists
 
   int irequest;
@@ -151,7 +148,7 @@ void PairLJCharmmCoulLongCuda::init_style()
     neighbor->requests[irequest]->cudable = 1; 
  
   if (cut_lj_inner >= cut_lj) 
-    error->all("Pair inner cutoff >= Pair outer cutoff");
+    error->all(FLERR,"Pair inner cutoff >= Pair outer cutoff");
 
   cut_lj_innersq = cut_lj_inner * cut_lj_inner;
   cut_ljsq = cut_lj * cut_lj;
@@ -165,13 +162,13 @@ void PairLJCharmmCoulLongCuda::init_style()
   cuda->shared_data.pair.cut_coulsq_global=cut_coulsq;
 
   if (force->kspace == NULL)
-    error->all("Pair style is incompatible with KSpace style");
+    error->all(FLERR,"Pair style is incompatible with KSpace style");
   g_ewald = force->kspace->g_ewald;
   cuda->shared_data.pair.g_ewald=g_ewald;
   cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
   
 
-  if(ncoultablebits) error->warning("# CUDA: You asked for the useage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
+  if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the useage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
 }
 
 void PairLJCharmmCoulLongCuda::init_list(int id, NeighList *ptr)
diff --git a/src/USER-CUDA/pair_lj_class2_coul_cut_cuda.cpp b/src/USER-CUDA/pair_lj_class2_coul_cut_cuda.cpp
index a75a70ba013c1f732be7bed41c693d2d52956ab0..702f2089c9dbd14b246d9279aeca7667df966341 100644
--- a/src/USER-CUDA/pair_lj_class2_coul_cut_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_class2_coul_cut_cuda.cpp
@@ -46,16 +46,13 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairLJClass2CoulCutCuda::PairLJClass2CoulCutCuda(LAMMPS *lmp) : PairLJClass2CoulCut(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	allocated2 = false;
 	cuda->shared_data.pair.cudable_force = 1;
@@ -123,7 +120,7 @@ void PairLJClass2CoulCutCuda::coeff(int narg, char **arg)
 void PairLJClass2CoulCutCuda::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style lj/cut/coul/cut/cuda requires atom attribute q");
+    error->all(FLERR,"Pair style lj/cut/coul/cut/cuda requires atom attribute q");
   // request regular or rRESPA neighbor lists
 
   int irequest;
diff --git a/src/USER-CUDA/pair_lj_class2_coul_long_cuda.cpp b/src/USER-CUDA/pair_lj_class2_coul_long_cuda.cpp
index 5c1d3a6fff02694754b5ceb793a15300d5fb593d..44f0fb3f2ff223b5b8d9d5f9126a3a745a556c47 100644
--- a/src/USER-CUDA/pair_lj_class2_coul_long_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_class2_coul_long_cuda.cpp
@@ -46,9 +46,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define EWALD_F   1.12837917
 #define EWALD_P   0.3275911
 #define A1        0.254829592
@@ -62,7 +59,7 @@ PairLJClass2CoulLongCuda::PairLJClass2CoulLongCuda(LAMMPS *lmp) : PairLJClass2Co
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	allocated2 = false;
 	cuda->shared_data.pair.cudable_force = 1;
@@ -128,7 +125,7 @@ void PairLJClass2CoulLongCuda::coeff(int narg, char **arg)
 void PairLJClass2CoulLongCuda::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style lj/cut/coul/long requires atom attribute q");
+    error->all(FLERR,"Pair style lj/cut/coul/long requires atom attribute q");
   // request regular or rRESPA neighbor lists
 
   int irequest;
@@ -144,15 +141,15 @@ void PairLJClass2CoulLongCuda::init_style()
   cuda->shared_data.pair.cut_coulsq_global=cut_coulsq;
   // set rRESPA cutoffs
 
-  if (force->newton) error->warning("Pair style uses does not use \"newton\" setting. You might test if \"newton off\" makes the simulation run faster.");
+  if (force->newton) error->warning(FLERR,"Pair style uses does not use \"newton\" setting. You might test if \"newton off\" makes the simulation run faster.");
   if (force->kspace == NULL)
-    error->all("Pair style is incompatible with KSpace style");
+    error->all(FLERR,"Pair style is incompatible with KSpace style");
   g_ewald = force->kspace->g_ewald;
   cuda->shared_data.pair.g_ewald=g_ewald;
   cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
   
 
-  if(ncoultablebits) error->warning("# CUDA: You asked for the useage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
+  if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the useage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
 }
 
 void PairLJClass2CoulLongCuda::init_list(int id, NeighList *ptr)
diff --git a/src/USER-CUDA/pair_lj_class2_cuda.cpp b/src/USER-CUDA/pair_lj_class2_cuda.cpp
index 98d8d8746891ead78fb679fc7c5cafd7341f1c9f..a218dc9cc805dc1463612f0597f7083f72499543 100644
--- a/src/USER-CUDA/pair_lj_class2_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_class2_cuda.cpp
@@ -61,16 +61,13 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairLJClass2Cuda::PairLJClass2Cuda(LAMMPS *lmp) : PairLJClass2(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	allocated2 = false;
 	cuda->shared_data.pair.cudable_force = 1;
diff --git a/src/USER-CUDA/pair_lj_cut_coul_cut_cuda.cpp b/src/USER-CUDA/pair_lj_cut_coul_cut_cuda.cpp
index ce2c36bc27e15a9b486433ef70e65983f8fb35d1..ac80ff52146867871d7b48b7cb0d9a8f3ef73cb1 100644
--- a/src/USER-CUDA/pair_lj_cut_coul_cut_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_cut_coul_cut_cuda.cpp
@@ -46,16 +46,13 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairLJCutCoulCutCuda::PairLJCutCoulCutCuda(LAMMPS *lmp) : PairLJCutCoulCut(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	allocated2 = false;
 	cuda->shared_data.pair.cudable_force = 1;
@@ -123,7 +120,7 @@ void PairLJCutCoulCutCuda::coeff(int narg, char **arg)
 void PairLJCutCoulCutCuda::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style lj/cut/coul/cut/cuda requires atom attribute q");
+    error->all(FLERR,"Pair style lj/cut/coul/cut/cuda requires atom attribute q");
   // request regular or rRESPA neighbor lists
 
   int irequest;
diff --git a/src/USER-CUDA/pair_lj_cut_coul_debye_cuda.cpp b/src/USER-CUDA/pair_lj_cut_coul_debye_cuda.cpp
index a1e553d78dcd6a451be25be9d85cf674f737fb58..bc9a6f33bab3b364c98de7552018b37327b4b9e4 100644
--- a/src/USER-CUDA/pair_lj_cut_coul_debye_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_cut_coul_debye_cuda.cpp
@@ -46,16 +46,13 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairLJCutCoulDebyeCuda::PairLJCutCoulDebyeCuda(LAMMPS *lmp) : PairLJCutCoulDebye(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	allocated2 = false;
 	cuda->shared_data.pair.cudable_force = 1;
@@ -124,7 +121,7 @@ void PairLJCutCoulDebyeCuda::coeff(int narg, char **arg)
 void PairLJCutCoulDebyeCuda::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style lj/cut/coul/debye/cuda requires atom attribute q");
+    error->all(FLERR,"Pair style lj/cut/coul/debye/cuda requires atom attribute q");
   // request regular or rRESPA neighbor lists
 
   int irequest;
diff --git a/src/USER-CUDA/pair_lj_cut_coul_long_cuda.cpp b/src/USER-CUDA/pair_lj_cut_coul_long_cuda.cpp
index 80d0f7de3f87026946fd58a25c829a20b9e4c6ee..12ea4b6d1f499a8901a7879dfe5ed322ff22f11f 100644
--- a/src/USER-CUDA/pair_lj_cut_coul_long_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_cut_coul_long_cuda.cpp
@@ -46,9 +46,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define EWALD_F   1.12837917
 #define EWALD_P   0.3275911
 #define A1        0.254829592
@@ -62,7 +59,7 @@ PairLJCutCoulLongCuda::PairLJCutCoulLongCuda(LAMMPS *lmp) : PairLJCutCoulLong(lm
 {
   cuda = lmp->cuda;
   if(cuda == NULL)
-      error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+      error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	allocated2 = false;
 	cuda->shared_data.pair.cudable_force = 1;
@@ -128,7 +125,7 @@ void PairLJCutCoulLongCuda::coeff(int narg, char **arg)
 void PairLJCutCoulLongCuda::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style lj/cut/coul/long requires atom attribute q");
+    error->all(FLERR,"Pair style lj/cut/coul/long requires atom attribute q");
   // request regular or rRESPA neighbor lists
 
   int irequest;
@@ -182,15 +179,15 @@ void PairLJCutCoulLongCuda::init_style()
     cut_respa = ((Respa *) update->integrate)->cutoff;
   else cut_respa = NULL;
 
-  if (force->newton) error->warning("Pair style uses does not use \"newton\" setting. You might test if \"newton off\" makes the simulation run faster.");
+  if (force->newton) error->warning(FLERR,"Pair style uses does not use \"newton\" setting. You might test if \"newton off\" makes the simulation run faster.");
   if (force->kspace == NULL)
-    error->all("Pair style is incompatible with KSpace style");
+    error->all(FLERR,"Pair style is incompatible with KSpace style");
   g_ewald = force->kspace->g_ewald;
   cuda->shared_data.pair.g_ewald=g_ewald;
   cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
   
 
-  if(ncoultablebits) error->warning("# CUDA: You asked for the useage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
+  if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the useage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
 }
 
 void PairLJCutCoulLongCuda::init_list(int id, NeighList *ptr)
diff --git a/src/USER-CUDA/pair_lj_cut_cuda.cpp b/src/USER-CUDA/pair_lj_cut_cuda.cpp
index 29dfbb8145578945cadc8a4fdcb1d896b1dc3ca8..c865f2136177e797036ed80b59942bc9277ee22b 100644
--- a/src/USER-CUDA/pair_lj_cut_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_cut_cuda.cpp
@@ -61,16 +61,13 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairLJCutCuda::PairLJCutCuda(LAMMPS *lmp) : PairLJCut(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	allocated2 = false;
 	cuda->shared_data.pair.cudable_force = 1;
diff --git a/src/USER-CUDA/pair_lj_cut_experimental_cuda.cpp b/src/USER-CUDA/pair_lj_cut_experimental_cuda.cpp
index a8700008d630f636a424a0bda3d95a0acdc9a05e..50dfaa5fa9a3742b5b03160c7e397b3394b15c4e 100644
--- a/src/USER-CUDA/pair_lj_cut_experimental_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_cut_experimental_cuda.cpp
@@ -61,16 +61,13 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairLJCutExperimentalCuda::PairLJCutExperimentalCuda(LAMMPS *lmp) : PairLJCut(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	allocated2 = false;
 	cuda->shared_data.pair.cudable_force = 1;
diff --git a/src/USER-CUDA/pair_lj_expand_cuda.cpp b/src/USER-CUDA/pair_lj_expand_cuda.cpp
index f06f227afff592175631d3aaa22acf913bd382c6..79f5f77c80a9689b15eb08b4ed11ba9d5c2fa2aa 100644
--- a/src/USER-CUDA/pair_lj_expand_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_expand_cuda.cpp
@@ -61,16 +61,13 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairLJExpandCuda::PairLJExpandCuda(LAMMPS *lmp) : PairLJExpand(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	allocated2 = false;
 	cuda->shared_data.pair.cudable_force = 1;
diff --git a/src/USER-CUDA/pair_lj_gromacs_coul_gromacs_cuda.cpp b/src/USER-CUDA/pair_lj_gromacs_coul_gromacs_cuda.cpp
index 8e05acc4f17dc07de126cd80711b5b3c5861f606..862d180e96a727b9aeb24d84fa00736f8d2ef0ab 100644
--- a/src/USER-CUDA/pair_lj_gromacs_coul_gromacs_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_gromacs_coul_gromacs_cuda.cpp
@@ -46,16 +46,13 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairLJGromacsCoulGromacsCuda::PairLJGromacsCoulGromacsCuda(LAMMPS *lmp) : PairLJGromacsCoulGromacs(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	allocated2 = false;
 	cuda->shared_data.pair.cudable_force = 1;
@@ -140,7 +137,7 @@ void PairLJGromacsCoulGromacsCuda::coeff(int narg, char **arg)
 void PairLJGromacsCoulGromacsCuda::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style lj/gromacs/coul/gromacs requires atom attribute q");
+    error->all(FLERR,"Pair style lj/gromacs/coul/gromacs requires atom attribute q");
   // request regular or rRESPA neighbor lists
 
 	if(atom->molecular)
@@ -156,7 +153,7 @@ void PairLJGromacsCoulGromacsCuda::init_style()
     neighbor->requests[irequest]->cudable = 1; 
 
    if (cut_lj_inner >= cut_lj || cut_coul_inner >= cut_coul)
-    error->all("Pair inner cutoff >= Pair outer cutoff");
+    error->all(FLERR,"Pair inner cutoff >= Pair outer cutoff");
 
   cut_lj_innersq = cut_lj_inner * cut_lj_inner;
   cut_ljsq = cut_lj * cut_lj;
diff --git a/src/USER-CUDA/pair_lj_gromacs_cuda.cpp b/src/USER-CUDA/pair_lj_gromacs_cuda.cpp
index 97bf05aac48910062940a09544b963dac5d3bacb..518ab5632579e956a8ba5014e0fd60efb89e535b 100644
--- a/src/USER-CUDA/pair_lj_gromacs_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_gromacs_cuda.cpp
@@ -46,16 +46,13 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairLJGromacsCuda::PairLJGromacsCuda(LAMMPS *lmp) : PairLJGromacs(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	allocated2 = false;
 	cuda->shared_data.pair.cudable_force = 1;
diff --git a/src/USER-CUDA/pair_lj_smooth_cuda.cpp b/src/USER-CUDA/pair_lj_smooth_cuda.cpp
index 25f2c5059a8af88405d4568a6daccae58d558ee0..84a4d9086a5e1a09354d71897ef7bac1da1163a5 100644
--- a/src/USER-CUDA/pair_lj_smooth_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_smooth_cuda.cpp
@@ -46,16 +46,13 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairLJSmoothCuda::PairLJSmoothCuda(LAMMPS *lmp) : PairLJSmooth(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	allocated2 = false;
 	cuda->shared_data.pair.cudable_force = 1;
diff --git a/src/USER-CUDA/pair_morse_cuda.cpp b/src/USER-CUDA/pair_morse_cuda.cpp
index befacd34132c8fb97d2c94da71961903ad46e4e1..ec2375fb924593f0d0275e4043f301a36282c4b4 100644
--- a/src/USER-CUDA/pair_morse_cuda.cpp
+++ b/src/USER-CUDA/pair_morse_cuda.cpp
@@ -61,16 +61,13 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairMorseCuda::PairMorseCuda(LAMMPS *lmp) : PairMorse(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	allocated2 = false;
 	cuda->shared_data.pair.cudable_force = 1;
diff --git a/src/USER-CUDA/pppm_cuda.cpp b/src/USER-CUDA/pppm_cuda.cpp
index ffa5d179746017af9b2e92c86d23dc7e07fffb9e..8167eb1d7232304c76d4ced2e5be0824b74e350b 100644
--- a/src/USER-CUDA/pppm_cuda.cpp
+++ b/src/USER-CUDA/pppm_cuda.cpp
@@ -70,9 +70,6 @@ using namespace LAMMPS_NS;
 #define LARGE 10000.0
 #define EPS_HOC 1.0e-7
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 
 void printArray(double* data,int nx, int ny, int nz)
 {
@@ -102,11 +99,11 @@ PPPMCuda::PPPMCuda(LAMMPS *lmp, int narg, char **arg) : PPPM(lmp, (narg==2?1:nar
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-  if ((narg > 3)||(narg<1)) error->all("Illegal kspace_style pppm/cuda command");
+  if ((narg > 3)||(narg<1)) error->all(FLERR,"Illegal kspace_style pppm/cuda command");
   #ifndef FFT_CUFFT
-  error->all("Using kspace_style pppm/cuda without cufft is not possible. Compile with cufft=1 to include cufft. Aborting.");
+  error->all(FLERR,"Using kspace_style pppm/cuda without cufft is not possible. Compile with cufft=1 to include cufft. Aborting.");
   #endif
   precision = atof(arg[0]);
   if(narg>1)
@@ -213,23 +210,23 @@ void PPPMCuda::init()
   // error check
 
   if (domain->triclinic)
-    error->all("Cannot (yet) use PPPMCuda with triclinic box");
-  if (domain->dimension == 2) error->all("Cannot use PPPMCuda with 2d simulation");
+    error->all(FLERR,"Cannot (yet) use PPPMCuda with triclinic box");
+  if (domain->dimension == 2) error->all(FLERR,"Cannot use PPPMCuda with 2d simulation");
 
-  if (!atom->q_flag) error->all("Kspace style requires atom attribute q");
+  if (!atom->q_flag) error->all(FLERR,"Kspace style requires atom attribute q");
 
   if (slabflag == 0 && domain->nonperiodic > 0)
-    error->all("Cannot use nonperiodic boundaries with PPPMCuda");
+    error->all(FLERR,"Cannot use nonperiodic boundaries with PPPMCuda");
   if (slabflag == 1) {
     if (domain->xperiodic != 1 || domain->yperiodic != 1 || 
 	domain->boundary[2][0] != 1 || domain->boundary[2][1] != 1)
-      error->all("Incorrect boundaries with slab PPPMCuda");
+      error->all(FLERR,"Incorrect boundaries with slab PPPMCuda");
   }
 
   if (order > MAXORDER) {
     char str[128];
     sprintf(str,"PPPMCuda order cannot be greater than %d",MAXORDER);
-    error->all(str);
+    error->all(FLERR,str);
   }
   // free all arrays previously allocated
 
@@ -240,11 +237,11 @@ void PPPMCuda::init()
   qqrd2e = force->qqrd2e;
 
   if (force->pair == NULL)
-    error->all("KSpace style is incompatible with Pair style");
+    error->all(FLERR,"KSpace style is incompatible with Pair style");
   int itmp=0;
   double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp);
   if (p_cutoff == NULL)
-    error->all("KSpace style is incompatible with Pair style");
+    error->all(FLERR,"KSpace style is incompatible with Pair style");
   cutoff = *p_cutoff;
 
   // if kspace is TIP4P, extract TIP4P params from pair style
@@ -253,14 +250,14 @@ void PPPMCuda::init()
 
   if (strcmp(force->kspace_style,"pppm/tip4p") == 0) {
     if (force->pair == NULL)
-      error->all("KSpace style is incompatible with Pair style");
+      error->all(FLERR,"KSpace style is incompatible with Pair style");
     double *p_qdist = (double *) force->pair->extract("qdist",itmp);
     int *p_typeO = (int *) force->pair->extract("typeO",itmp);
     int *p_typeH = (int *) force->pair->extract("typeH",itmp);
     int *p_typeA = (int *) force->pair->extract("typeA",itmp);
     int *p_typeB = (int *) force->pair->extract("typeB",itmp);
     if (!p_qdist || !p_typeO || !p_typeH || !p_typeA || !p_typeB)
-      error->all("KSpace style is incompatible with Pair style");
+      error->all(FLERR,"KSpace style is incompatible with Pair style");
     qdist = *p_qdist;
     typeO = *p_typeO;
     typeH = *p_typeH;
@@ -268,7 +265,7 @@ void PPPMCuda::init()
     int typeB = *p_typeB;
 
     if (force->angle == NULL || force->bond == NULL)
-      error->all("Bond and angle potentials must be defined for TIP4P");
+      error->all(FLERR,"Bond and angle potentials must be defined for TIP4P");
     double theta = force->angle->equilibrium_angle(typeA);
     double blen = force->bond->equilibrium_distance(typeB);
     alpha = qdist / (2.0 * cos(0.5*theta) * blen);
@@ -289,11 +286,11 @@ void PPPMCuda::init()
   qsqsum = tmp;
 
   if (qsqsum == 0.0)
-    error->all("Cannot use kspace solver on system with no charge");
+    error->all(FLERR,"Cannot use kspace solver on system with no charge");
   if (fabs(qsum) > SMALL && me == 0) {
     char str[128];
     sprintf(str,"System is not charge neutral, net charge = %g",qsum);
-    error->warning(str);
+    error->warning(FLERR,str);
   }
 
   // setup FFT grid resolution and g_ewald
@@ -305,14 +302,14 @@ void PPPMCuda::init()
   while (order > 0) {
 
     if (iteration && me == 0)
-      error->warning("Reducing PPPMCuda order b/c stencil extends "
+      error->warning(FLERR,"Reducing PPPMCuda order b/c stencil extends "
 		     "beyond neighbor processor");
     iteration++;
 
     set_grid();
 
     if (nx_pppm >= OFFSET || ny_pppm >= OFFSET || nz_pppm >= OFFSET)
-      error->all("PPPMCuda grid is too large");
+      error->all(FLERR,"PPPMCuda grid is too large");
 
     // global indices of PPPMCuda grid range from 0 to N-1
     // nlo_in,nhi_in = lower/upper limits of the 3d sub-brick of
@@ -484,7 +481,7 @@ void PPPMCuda::init()
     order--;
   }
 
-  if (order == 0) error->all("PPPMCuda order has been reduced to 0");
+  if (order == 0) error->all(FLERR,"PPPMCuda order has been reduced to 0");
   //printf("PPPMCuda: order is %i\n");
 
 
@@ -1395,7 +1392,7 @@ void PPPMCuda::set_grid()
     g_ewald = gew2;
     fmid = diffpr(h_x,h_y,h_z,q2,acons);
 
-    if (f*fmid >= 0.0) error->all("Cannot compute PPPMCuda G");
+    if (f*fmid >= 0.0) error->all(FLERR,"Cannot compute PPPMCuda G");
     rtb = f < 0.0 ? (dgew=gew2-gew1,gew1) : (dgew=gew1-gew2,gew2);
     ncount = 0;
     while (fabs(dgew) > SMALL && fmid != 0.0) {
@@ -1404,7 +1401,7 @@ void PPPMCuda::set_grid()
       fmid = diffpr(h_x,h_y,h_z,q2,acons);      
       if (fmid <= 0.0) rtb = g_ewald;
       ncount++;
-      if (ncount > LARGE) error->all("Cannot compute PPPMCuda G");
+      if (ncount > LARGE) error->all(FLERR,"Cannot compute PPPMCuda G");
     }
   }
 
@@ -1449,7 +1446,7 @@ void PPPMCuda::make_power_of_prime(int* n)
 {
 
 	if((precisionmodify!='+')&&(precisionmodify!='-')&&(precisionmodify!='c'))
-    {error->all("Unknown Option for PPPMCuda, assumeing '='");return;}
+    {error->all(FLERR,"Unknown Option for PPPMCuda, assumeing '='");return;}
     int oldn=*n;
     int* primelist=new int[1000];
     int count=0;
@@ -1555,7 +1552,7 @@ void PPPMCuda::particle_map()
 
   int flag_all;
   MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_SUM,world);
-  if (flag_all) error->all("Out of range atoms - cannot compute PPPMCuda!");
+  if (flag_all) error->all(FLERR,"Out of range atoms - cannot compute PPPMCuda!");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/USER-CUDA/verlet_cuda.cpp b/src/USER-CUDA/verlet_cuda.cpp
index 1a75e55de33a94fbc3c2f91b049c8bc8e09b3f84..0c3f675fae46d3a185c477b043fbf492fd6974f8 100644
--- a/src/USER-CUDA/verlet_cuda.cpp
+++ b/src/USER-CUDA/verlet_cuda.cpp
@@ -21,7 +21,6 @@
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
 
-
 #include <cstdlib>
 #include <cstdio>
 #include <cstring>
@@ -55,14 +54,12 @@
 
 using namespace LAMMPS_NS;
 
-#define MAX(a, b) ((a)>(b) ? (a) : (b))
 #define MAKETIMEING
 
-
 VerletCuda::VerletCuda(LAMMPS *lmp, int narg, char **arg) : Verlet(lmp, narg, arg) {	
   cuda = lmp->cuda;
    if(cuda == NULL)
-        error->all("You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
 	modify_cuda=(ModifyCuda*) modify;
 }
@@ -541,17 +538,17 @@ void VerletCuda::run(int n)
 	if(cuda->shared_data.me==0)
 	{
 	  if((not cuda->shared_data.pair.cudable_force)&&(force->pair))
-		  error->warning("# CUDA: You asked for a Verlet integration using Cuda, "
+		  error->warning(FLERR,"# CUDA: You asked for a Verlet integration using Cuda, "
 			             "but selected a pair force which has not yet been ported to Cuda");
 	  if((not cuda->shared_data.pppm.cudable_force)&&(force->kspace))
-		  error->warning("# CUDA: You asked for a Verlet integration using Cuda, "
+		  error->warning(FLERR,"# CUDA: You asked for a Verlet integration using Cuda, "
 						 "but selected a kspace force which has not yet been ported to Cuda");
       if(modify_cuda->n_post_integrate_host+modify_cuda->n_pre_exchange_host+modify_cuda->n_pre_neighbor_host+modify_cuda->n_pre_force_host+modify_cuda->n_post_force_host+modify_cuda->n_end_of_step_host+modify_cuda->n_initial_integrate_host+modify_cuda->n_final_integrate_host)
-		  error->warning("# CUDA: You asked for a Verlet integration using Cuda, "
+		  error->warning(FLERR,"# CUDA: You asked for a Verlet integration using Cuda, "
 						 "but several fixes have not yet been ported to Cuda.\n"
 						 "This can cause a severe speed penalty due to frequent data synchronization between host and GPU.");
 	  if(atom->firstgroupname) 
-		  error->warning("Warning: firstgroupname is used, this will cause additional data transfers.");
+		  error->warning(FLERR,"Warning: firstgroupname is used, this will cause additional data transfers.");
 	}
     cuda->uploadAll();
   
diff --git a/src/USER-EFF/atom_vec_electron.cpp b/src/USER-EFF/atom_vec_electron.cpp
index c7affbc38473eeb8c8a6fd9a51ccc57581a7664e..006de86019c591d23496dfb660c2d111da674039 100644
--- a/src/USER-EFF/atom_vec_electron.cpp
+++ b/src/USER-EFF/atom_vec_electron.cpp
@@ -757,11 +757,11 @@ void AtomVecElectron::data_atom(double *coord, int imagetmp, char **values)
   
   tag[nlocal] = atoi(values[0]);
   if (tag[nlocal] <= 0)
-    error->one("Invalid atom ID in Atoms section of data file");
+    error->one(FLERR,"Invalid atom ID in Atoms section of data file");
   
   type[nlocal] = atoi(values[1]);
   if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
-    error->one("Invalid atom type in Atoms section of data file");
+    error->one(FLERR,"Invalid atom type in Atoms section of data file");
   
   q[nlocal] = atof(values[2]);
   spin[nlocal] = atoi(values[3]);
@@ -793,7 +793,7 @@ int AtomVecElectron::data_atom_hybrid(int nlocal, char **values)
   spin[nlocal] = atoi(values[1]);
   eradius[nlocal] = atof(values[2]);
   if (eradius[nlocal] < 0.0)
-    error->one("Invalid eradius in Atoms section of data file");
+    error->one(FLERR,"Invalid eradius in Atoms section of data file");
   
   v[nlocal][0] = 0.0;
   v[nlocal][1] = 0.0;
diff --git a/src/USER-EFF/compute_ke_atom_eff.cpp b/src/USER-EFF/compute_ke_atom_eff.cpp
index 33c900f4b373769aedafec0b18fed024c2fced62..1b68b60d22266627164f85cf58d0dc82259eae54 100644
--- a/src/USER-EFF/compute_ke_atom_eff.cpp
+++ b/src/USER-EFF/compute_ke_atom_eff.cpp
@@ -33,7 +33,7 @@ using namespace LAMMPS_NS;
 ComputeKEAtomEff::ComputeKEAtomEff(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Illegal compute ke/atom/eff command");
+  if (narg != 3) error->all(FLERR,"Illegal compute ke/atom/eff command");
 
   peratom_flag = 1;
   size_peratom_cols = 0;
@@ -44,7 +44,7 @@ ComputeKEAtomEff::ComputeKEAtomEff(LAMMPS *lmp, int narg, char **arg) :
   // error check
 
   if (!atom->electron_flag) 
-    error->all("Compute ke/atom/eff requires atom style electron");
+    error->all(FLERR,"Compute ke/atom/eff requires atom style electron");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -62,7 +62,7 @@ void ComputeKEAtomEff::init()
   for (int i = 0; i < modify->ncompute; i++)
     if (strcmp(modify->compute[i]->style,"ke/atom/eff") == 0) count++;
   if (count > 1 && comm->me == 0)
-    error->warning("More than one compute ke/atom/eff");
+    error->warning(FLERR,"More than one compute ke/atom/eff");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/USER-EFF/compute_ke_eff.cpp b/src/USER-EFF/compute_ke_eff.cpp
index 68aaa2c25bcd497bf6ef47df96a457e6c661c904..43a2a952f816da1dd17f67631709a0b8969d2ca7 100644
--- a/src/USER-EFF/compute_ke_eff.cpp
+++ b/src/USER-EFF/compute_ke_eff.cpp
@@ -32,7 +32,7 @@ using namespace LAMMPS_NS;
 ComputeKEEff::ComputeKEEff(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Illegal compute ke/eff command");
+  if (narg != 3) error->all(FLERR,"Illegal compute ke/eff command");
 
   scalar_flag = 1;
   extscalar = 1;
@@ -40,7 +40,7 @@ ComputeKEEff::ComputeKEEff(LAMMPS *lmp, int narg, char **arg) :
   // error check
 
   if (!atom->electron_flag) 
-    error->all("Compute ke/eff requires atom style electron");
+    error->all(FLERR,"Compute ke/eff requires atom style electron");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/USER-EFF/compute_temp_deform_eff.cpp b/src/USER-EFF/compute_temp_deform_eff.cpp
index 7bb53b90853292acacc11b0b374acc7a299b19cc..ccba4d782c97fc099f64cd0f83fe01566918f480 100644
--- a/src/USER-EFF/compute_temp_deform_eff.cpp
+++ b/src/USER-EFF/compute_temp_deform_eff.cpp
@@ -41,10 +41,10 @@ enum{NO_REMAP,X_REMAP,V_REMAP};                   // same as fix_deform.cpp
 ComputeTempDeformEff::ComputeTempDeformEff(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Illegal compute temp/deform/eff command");
+  if (narg != 3) error->all(FLERR,"Illegal compute temp/deform/eff command");
 
   if (!atom->electron_flag) 
-    error->all("Compute temp/deform/eff requires atom style electron");
+    error->all(FLERR,"Compute temp/deform/eff requires atom style electron");
 
   scalar_flag = vector_flag = 1;
   size_vector = 6;
@@ -83,12 +83,12 @@ void ComputeTempDeformEff::init()
     if (strcmp(modify->fix[i]->style,"deform") == 0) {
       if (((FixDeform *) modify->fix[i])->remapflag == X_REMAP &&
           comm->me == 0)
-        error->warning("Using compute temp/deform/eff with inconsistent "
+        error->warning(FLERR,"Using compute temp/deform/eff with inconsistent "
                        "fix deform remap option");
       break;
     }
   if (i == modify->nfix && comm->me == 0)
-    error->warning("Using compute temp/deform/eff with no fix deform defined");
+    error->warning(FLERR,"Using compute temp/deform/eff with no fix deform defined");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/USER-EFF/compute_temp_eff.cpp b/src/USER-EFF/compute_temp_eff.cpp
index 4f7cc40c1b3618d321fa045f11322a1d313114ce..e2089a0d6024b2523fd2e3473687ed08c1731d00 100644
--- a/src/USER-EFF/compute_temp_eff.cpp
+++ b/src/USER-EFF/compute_temp_eff.cpp
@@ -36,7 +36,7 @@ ComputeTempEff::ComputeTempEff(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
   if (!atom->electron_flag) 
-    error->all("Compute temp/eff requires atom style electron");
+    error->all(FLERR,"Compute temp/eff requires atom style electron");
 
   scalar_flag = vector_flag = 1;
   size_vector = 6;
diff --git a/src/USER-EFF/compute_temp_region_eff.cpp b/src/USER-EFF/compute_temp_region_eff.cpp
index 9bcabee2a82ad22e68315fac71ab35aefd295754..f43e92095f29880015a83dfa48a4716f01d7a3ed 100644
--- a/src/USER-EFF/compute_temp_region_eff.cpp
+++ b/src/USER-EFF/compute_temp_region_eff.cpp
@@ -36,13 +36,13 @@ ComputeTempRegionEff::ComputeTempRegionEff(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
   if (!atom->electron_flag) 
-    error->all("Compute temp/region/eff requires atom style electron");
+    error->all(FLERR,"Compute temp/region/eff requires atom style electron");
 
-  if (narg != 4) error->all("Illegal compute temp/region/eff command");
+  if (narg != 4) error->all(FLERR,"Illegal compute temp/region/eff command");
 
   iregion = domain->find_region(arg[3]);
   if (iregion == -1)
-    error->all("Region ID for compute temp/region/eff does not exist");
+    error->all(FLERR,"Region ID for compute temp/region/eff does not exist");
   int n = strlen(arg[3]) + 1;
   idregion = new char[n];
   strcpy(idregion,arg[3]);
@@ -76,7 +76,7 @@ void ComputeTempRegionEff::init()
 
   iregion = domain->find_region(idregion);
   if (iregion == -1)
-    error->all("Region ID for compute temp/region/eff does not exist");
+    error->all(FLERR,"Region ID for compute temp/region/eff does not exist");
 
   dof = 0.0;
 }
diff --git a/src/USER-EFF/fix_nh_eff.cpp b/src/USER-EFF/fix_nh_eff.cpp
index 70f2544c2d5d2726905dbe09a9a225bc5221c881..e3dde84178f689d183115f54baeda9a799555208 100644
--- a/src/USER-EFF/fix_nh_eff.cpp
+++ b/src/USER-EFF/fix_nh_eff.cpp
@@ -31,7 +31,7 @@ enum{NOBIAS,BIAS};
 FixNHEff::FixNHEff(LAMMPS *lmp, int narg, char **arg) : FixNH(lmp, narg, arg)
 {
   if (!atom->electron_flag) 
-    error->all("Fix nvt/nph/npt/eff requires atom style electron");
+    error->all(FLERR,"Fix nvt/nph/npt/eff requires atom style electron");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/USER-EFF/fix_nph_eff.cpp b/src/USER-EFF/fix_nph_eff.cpp
index 98f76c346c8b731a3e01525afdc0e07274dd9250..7cf5be647d66b982d9ea07b517608a51c765060b 100644
--- a/src/USER-EFF/fix_nph_eff.cpp
+++ b/src/USER-EFF/fix_nph_eff.cpp
@@ -24,9 +24,9 @@ FixNPHEff::FixNPHEff(LAMMPS *lmp, int narg, char **arg) :
   FixNHEff(lmp, narg, arg)
 {
   if (tstat_flag)
-    error->all("Temperature control can not be used with fix nph/eff");
+    error->all(FLERR,"Temperature control can not be used with fix nph/eff");
   if (!pstat_flag)
-    error->all("Pressure control must be used with fix nph/eff");
+    error->all(FLERR,"Pressure control must be used with fix nph/eff");
 
   // create a new compute temp style
   // id = fix-ID + temp
diff --git a/src/USER-EFF/fix_npt_eff.cpp b/src/USER-EFF/fix_npt_eff.cpp
index d71a25d461dd468005ec74032088804876245d51..3b27e9b967ad9ebf3600f0a163cf38ff87ce394a 100644
--- a/src/USER-EFF/fix_npt_eff.cpp
+++ b/src/USER-EFF/fix_npt_eff.cpp
@@ -24,9 +24,9 @@ FixNPTEff::FixNPTEff(LAMMPS *lmp, int narg, char **arg) :
   FixNHEff(lmp, narg, arg)
 {
   if (!tstat_flag)
-    error->all("Temperature control must be used with fix npt/eff");
+    error->all(FLERR,"Temperature control must be used with fix npt/eff");
   if (!pstat_flag)
-    error->all("Pressure control must be used with fix npt/eff");
+    error->all(FLERR,"Pressure control must be used with fix npt/eff");
 
   // create a new compute temp style
   // id = fix-ID + temp
diff --git a/src/USER-EFF/fix_nve_eff.cpp b/src/USER-EFF/fix_nve_eff.cpp
index 392f6b7862914f14fbd6817d6abff07dc31ae49d..1466c777dfc8097f8bf65d7a982d8d1e0370a3dd 100644
--- a/src/USER-EFF/fix_nve_eff.cpp
+++ b/src/USER-EFF/fix_nve_eff.cpp
@@ -34,7 +34,7 @@ FixNVEEff::FixNVEEff(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
   if (!atom->electron_flag) 
-    error->all("Fix nve/eff requires atom style electron");
+    error->all(FLERR,"Fix nve/eff requires atom style electron");
 
   time_integrate = 1;
 }
diff --git a/src/USER-EFF/fix_nvt_eff.cpp b/src/USER-EFF/fix_nvt_eff.cpp
index b742b66ee35e0aa534a5af0c76b684ded9d68e42..a40cd4aefa3f85ac99fa7b944f2dedeb934343e9 100644
--- a/src/USER-EFF/fix_nvt_eff.cpp
+++ b/src/USER-EFF/fix_nvt_eff.cpp
@@ -26,9 +26,9 @@ FixNVTEff::FixNVTEff(LAMMPS *lmp, int narg, char **arg) :
   FixNHEff(lmp, narg, arg)
 {
   if (!tstat_flag)
-    error->all("Temperature control must be used with fix nvt/eff");
+    error->all(FLERR,"Temperature control must be used with fix nvt/eff");
   if (pstat_flag)
-    error->all("Pressure control can not be used with fix nvt/eff");
+    error->all(FLERR,"Pressure control can not be used with fix nvt/eff");
 
   // create a new compute temp style
   // id = fix-ID + temp
diff --git a/src/USER-EFF/fix_nvt_sllod_eff.cpp b/src/USER-EFF/fix_nvt_sllod_eff.cpp
index 435d70c20c3b31e7830086ab024124c639c855b1..0d38c1904942eca917aaab30aa7718520a2030ee 100644
--- a/src/USER-EFF/fix_nvt_sllod_eff.cpp
+++ b/src/USER-EFF/fix_nvt_sllod_eff.cpp
@@ -33,9 +33,9 @@ FixNVTSllodEff::FixNVTSllodEff(LAMMPS *lmp, int narg, char **arg) :
   FixNHEff(lmp, narg, arg)
 {
   if (!tstat_flag)
-    error->all("Temperature control must be used with fix nvt/sllod/eff");
+    error->all(FLERR,"Temperature control must be used with fix nvt/sllod/eff");
   if (pstat_flag)
-    error->all("Pressure control can not be used with fix nvt/sllod/eff");
+    error->all(FLERR,"Pressure control can not be used with fix nvt/sllod/eff");
 
   // default values
 
@@ -66,7 +66,7 @@ void FixNVTSllodEff::init()
   FixNHEff::init();
 
   if (!temperature->tempbias)
-    error->all("Temperature for fix nvt/sllod/eff does not have a bias");
+    error->all(FLERR,"Temperature for fix nvt/sllod/eff does not have a bias");
 
   nondeformbias = 0;
   if (strcmp(temperature->style,"temp/deform/eff") != 0) nondeformbias = 1;
@@ -77,12 +77,12 @@ void FixNVTSllodEff::init()
   for (i = 0; i < modify->nfix; i++)
     if (strcmp(modify->fix[i]->style,"deform") == 0) {
       if (((FixDeform *) modify->fix[i])->remapflag != V_REMAP)
-	error->all("Using fix nvt/sllod/eff with inconsistent fix deform "
+	error->all(FLERR,"Using fix nvt/sllod/eff with inconsistent fix deform "
 		   "remap option");
       break;
     }
   if (i == modify->nfix)
-    error->all("Using fix nvt/sllod/eff with no fix deform defined");
+    error->all(FLERR,"Using fix nvt/sllod/eff with no fix deform defined");
 }
 
 
diff --git a/src/USER-EFF/fix_temp_rescale_eff.cpp b/src/USER-EFF/fix_temp_rescale_eff.cpp
index e5a0d19be748ee938d5ddc3c6978dbc63b5c52d4..b6f4d585f717c5b1d6209f78dd50a8097c1a2f9e 100644
--- a/src/USER-EFF/fix_temp_rescale_eff.cpp
+++ b/src/USER-EFF/fix_temp_rescale_eff.cpp
@@ -39,10 +39,10 @@ enum{NOBIAS,BIAS};
 FixTempRescaleEff::FixTempRescaleEff(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 8) error->all("Illegal fix temp/rescale/eff command");
+  if (narg < 8) error->all(FLERR,"Illegal fix temp/rescale/eff command");
 
   nevery = atoi(arg[3]);
-  if (nevery <= 0) error->all("Illegal fix temp/rescale/eff command");
+  if (nevery <= 0) error->all(FLERR,"Illegal fix temp/rescale/eff command");
 
   scalar_flag = 1;
   global_freq = nevery;
@@ -98,7 +98,7 @@ void FixTempRescaleEff::init()
 {
   int icompute = modify->find_compute(id_temp);
   if (icompute < 0)
-    error->all("Temperature ID for fix temp/rescale/eff does not exist");
+    error->all(FLERR,"Temperature ID for fix temp/rescale/eff does not exist");
   temperature = modify->compute[icompute];
 
   if (temperature->tempbias) which = BIAS;
@@ -111,7 +111,7 @@ void FixTempRescaleEff::end_of_step()
 {
   double t_current = temperature->compute_scalar();
   if (t_current == 0.0)
-    error->all("Computed temperature for fix temp/rescale/eff cannot be 0.0");
+    error->all(FLERR,"Computed temperature for fix temp/rescale/eff cannot be 0.0");
 
   double delta = update->ntimestep - update->beginstep;
   delta /= update->endstep - update->beginstep;
@@ -167,7 +167,7 @@ void FixTempRescaleEff::end_of_step()
 int FixTempRescaleEff::modify_param(int narg, char **arg)
 {
   if (strcmp(arg[0],"temp/eff") == 0) {
-    if (narg < 2) error->all("Illegal fix_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
     if (tflag) {
       modify->delete_compute(id_temp);
       tflag = 0;
@@ -178,13 +178,13 @@ int FixTempRescaleEff::modify_param(int narg, char **arg)
     strcpy(id_temp,arg[1]);
 
     int icompute = modify->find_compute(id_temp);
-    if (icompute < 0) error->all("Could not find fix_modify temperature ID");
+    if (icompute < 0) error->all(FLERR,"Could not find fix_modify temperature ID");
     temperature = modify->compute[icompute];
 
     if (temperature->tempflag == 0)
-      error->all("Fix_modify temperature ID does not compute temperature");
+      error->all(FLERR,"Fix_modify temperature ID does not compute temperature");
     if (temperature->igroup != igroup && comm->me == 0)
-      error->warning("Group for fix_modify temp != fix group");
+      error->warning(FLERR,"Group for fix_modify temp != fix group");
     return 2;
   }
   return 0;
diff --git a/src/USER-EFF/pair_eff_cut.cpp b/src/USER-EFF/pair_eff_cut.cpp
index 85d2a1d1af5d26b23037a9bb94bab238d143e2e4..8f99134239bec019efa5e0f05f63b362c972a052 100644
--- a/src/USER-EFF/pair_eff_cut.cpp
+++ b/src/USER-EFF/pair_eff_cut.cpp
@@ -34,9 +34,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairEffCut::PairEffCut(LAMMPS *lmp) : Pair(lmp)
@@ -694,7 +691,7 @@ void PairEffCut::allocate()
 void PairEffCut::settings(int narg, char **arg)
 {
   if (narg != 1 && narg != 3 && narg != 4 && narg != 7) 
-    error->all("Illegal pair_style command");
+    error->all(FLERR,"Illegal pair_style command");
 
   // Defaults ECP parameters for Si
   PAULI_CORE_A = 0.320852;
@@ -714,7 +711,7 @@ void PairEffCut::settings(int narg, char **arg)
     limit_size_flag = 0;
     flexible_pressure_flag = 0;
     if (strcmp(arg[1],"ecp") != 0)
-      error->all("Illegal pair_style command");
+      error->all(FLERR,"Illegal pair_style command");
     else {
       PAULI_CORE_A = force->numeric(arg[2]);
       PAULI_CORE_B = force->numeric(arg[3]);
@@ -725,7 +722,7 @@ void PairEffCut::settings(int narg, char **arg)
     limit_size_flag = force->inumeric(arg[1]);
     flexible_pressure_flag = force->inumeric(arg[2]);
     if (strcmp(arg[3],"ecp") != 0)
-      error->all("Illegal pair_style command");
+      error->all(FLERR,"Illegal pair_style command");
     else {
       PAULI_CORE_A = force->numeric(arg[4]);
       PAULI_CORE_B = force->numeric(arg[5]);
@@ -740,7 +737,7 @@ void PairEffCut::settings(int narg, char **arg)
   } else if (force->qqr2e==1.0) {	// electron units
     h2e = 1.0;
     hhmss2e = 1.0;
-  } else error->all("Check your units");
+  } else error->all(FLERR,"Check your units");
 
   // reset cutoffs that have been explicitly set
   
@@ -758,7 +755,7 @@ void PairEffCut::settings(int narg, char **arg)
 
 void PairEffCut::coeff(int narg, char **arg)
 {
-  if (narg < 2 || narg > 3) error->all("Incorrect args for pair coefficients");
+  if (narg < 2 || narg > 3) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
   
   int ilo,ihi,jlo,jhi;
@@ -777,7 +774,7 @@ void PairEffCut::coeff(int narg, char **arg)
     }
   }
   
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -790,7 +787,7 @@ void PairEffCut::init_style()
 
   if (!atom->q_flag || !atom->spin_flag || 
       !atom->eradius_flag || !atom->erforce_flag)
-    error->all("Pair eff/cut requires atom attributes "
+    error->all(FLERR,"Pair eff/cut requires atom attributes "
 	       "q, spin, eradius, erforce");
 
   // add hook to minimizer for eradius and erforce
@@ -802,7 +799,7 @@ void PairEffCut::init_style()
 
   if (update->whichflag == 1) { 
     if (force->qqr2e == 332.06371 && update->dt == 1.0)
-      error->all("You must lower the default real units timestep for pEFF ");
+      error->all(FLERR,"You must lower the default real units timestep for pEFF ");
   }
 
   // need a half neigh list and optionally a granular history neigh list
diff --git a/src/USER-EWALDN/ewald_n.cpp b/src/USER-EWALDN/ewald_n.cpp
index d45b90f05dabd5b33727f287d659ff467228aee9..ed05ca504457590242c22446684984c215287d47 100644
--- a/src/USER-EWALDN/ewald_n.cpp
+++ b/src/USER-EWALDN/ewald_n.cpp
@@ -44,7 +44,7 @@ enum{GEOMETRIC,ARITHMETIC,SIXTHPOWER};         // same as in pair.cpp
 
 EwaldN::EwaldN(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg)
 {
-  if (narg!=1) error->all(KSPACE_ILLEGAL);
+  if (narg!=1) error->all(FLERR,KSPACE_ILLEGAL);
   precision = fabs(atof(arg[0]));
   memset(function, 0, EWALD_NORDER*sizeof(int));
   kenergy = kvirial = NULL;
@@ -78,13 +78,13 @@ void EwaldN::init()
   }
 
   if (domain->dimension == 2)				// check for errors
-    error->all("Cannot use EwaldN with 2d simulation");
+    error->all(FLERR,"Cannot use EwaldN with 2d simulation");
   if (slabflag == 0 && domain->nonperiodic > 0)
-    error->all("Cannot use nonperiodic boundaries with EwaldN");
+    error->all(FLERR,"Cannot use nonperiodic boundaries with EwaldN");
   if (slabflag == 1) {
     if (domain->xperiodic != 1 || domain->yperiodic != 1 || 
 	domain->boundary[2][0] != 1 || domain->boundary[2][1] != 1)
-      error->all("Incorrect boundaries with slab EwaldN");
+      error->all(FLERR,"Incorrect boundaries with slab EwaldN");
   }
 
   qqrd2e = force->qqrd2e;				// check pair_style
@@ -98,7 +98,7 @@ void EwaldN::init()
   int *ptr = pair ? (int *) pair->extract("ewald_order",tmp) : NULL;
   double *cutoff = pair ? (double *) pair->extract("cut_coul",tmp) : NULL;
   if (!(ptr||cutoff)) 
-    error->all("KSpace style is incompatible with Pair style");
+    error->all(FLERR,"KSpace style is incompatible with Pair style");
   int ewald_order = ptr ? *((int *) ptr) : 1<<1;
   int ewald_mix = ptr ? *((int *) pair->extract("ewald_mix",tmp)) : GEOMETRIC;
   memset(function, 0, EWALD_NFUNCS*sizeof(int));
@@ -115,10 +115,10 @@ void EwaldN::init()
 	  if (ewald_mix==GEOMETRIC) { k = 1; break; }
 	  else if (ewald_mix==ARITHMETIC) { k = 2; break; }
 	  sprintf(str, "%s pair_style %s", KSPACE_MIX, force->pair_style);
-	  error->all(str);
+	  error->all(FLERR,str);
 	default:
 	  sprintf(str, "%s pair_style %s", KSPACE_ORDER, force->pair_style);
-	  error->all(str);
+	  error->all(FLERR,str);
       }
       nfunctions += function[k] = 1;
       nsums += n[k];
@@ -309,7 +309,7 @@ void EwaldN::init_coeffs()				// local pair coeffs
     double **epsilon = (double **) force->pair->extract("epsilon",tmp);
     double **sigma = (double **) force->pair->extract("sigma",tmp);
     if (!(epsilon&&sigma))
-      error->all("epsilon or sigma reference not set by pair style in ewald/n");
+      error->all(FLERR,"epsilon or sigma reference not set by pair style in ewald/n");
     double eps_i, sigma_i, sigma_n, *bi = B = new double[7*n+7];
     double c[7] = {
       1.0, sqrt(6.0), sqrt(15.0), sqrt(20.0), sqrt(15.0), sqrt(6.0), 1.0};
diff --git a/src/USER-EWALDN/pair_buck_coul.cpp b/src/USER-EWALDN/pair_buck_coul.cpp
index bb2f4f0ed0356177ea4205a602c5e35bd70b9b01..74e9e56476be745ab923b69541f0d7b1c195d902 100644
--- a/src/USER-EWALDN/pair_buck_coul.cpp
+++ b/src/USER-EWALDN/pair_buck_coul.cpp
@@ -36,9 +36,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define EWALD_F   1.12837917
 #define EWALD_P   0.3275911
 #define A1        0.254829592
@@ -72,10 +69,10 @@ void PairBuckCoul::options(char **arg, int order)
   char *option[] = {"long", "cut", "off", NULL};
   int i;
 
-  if (!*arg) error->all(PAIR_ILLEGAL);
+  if (!*arg) error->all(FLERR,PAIR_ILLEGAL);
   for (i=0; option[i]&&strcmp(arg[0], option[i]); ++i);
   switch (i) {
-    default: error->all(PAIR_ILLEGAL);
+    default: error->all(FLERR,PAIR_ILLEGAL);
     case 0: ewald_order |= 1<<order; break;		// set kspace r^-order
     case 2: ewald_off |= 1<<order;			// turn r^-order off
     case 1: break;
@@ -85,19 +82,19 @@ void PairBuckCoul::options(char **arg, int order)
 
 void PairBuckCoul::settings(int narg, char **arg)
 {
-  if (narg != 3 && narg != 4) error->all("Illegal pair_style command");
+  if (narg != 3 && narg != 4) error->all(FLERR,"Illegal pair_style command");
  
   ewald_order = 0;
   ewald_off = 0;
   options(arg, 6);
   options(++arg, 1);
-  if (!comm->me && ewald_order&(1<<6)) error->warning(PAIR_MIX);
-  if (!comm->me && ewald_order==((1<<1)|(1<<6))) error->warning(PAIR_LARGEST);
-  if (!*(++arg)) error->all(PAIR_MISSING);
-  if (ewald_off&(1<<6)) error->all(PAIR_LJ_OFF);
-  if (!((ewald_order^ewald_off)&(1<<1))) error->all(PAIR_COUL_CUT);
+  if (!comm->me && ewald_order&(1<<6)) error->warning(FLERR,PAIR_MIX);
+  if (!comm->me && ewald_order==((1<<1)|(1<<6))) error->warning(FLERR,PAIR_LARGEST);
+  if (!*(++arg)) error->all(FLERR,PAIR_MISSING);
+  if (ewald_off&(1<<6)) error->all(FLERR,PAIR_LJ_OFF);
+  if (!((ewald_order^ewald_off)&(1<<1))) error->all(FLERR,PAIR_COUL_CUT);
   cut_buck_global = force->numeric(*(arg++));
-  if (*arg&&(ewald_order&0x42==0x42)) error->all(PAIR_CUTOFF);
+  if (*arg&&(ewald_order&0x42==0x42)) error->all(FLERR,PAIR_CUTOFF);
   if (narg == 4) cut_coul = force->numeric(*arg);
   else cut_coul = cut_buck_global;
 
@@ -191,7 +188,7 @@ void *PairBuckCoul::extract(char *id, int &dim)
 
 void PairBuckCoul::coeff(int narg, char **arg)
 {
-  if (narg < 5 || narg > 6) error->all("Incorrect args for pair coefficients");
+  if (narg < 5 || narg > 6) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -217,7 +214,7 @@ void PairBuckCoul::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -230,7 +227,7 @@ void PairBuckCoul::init_style()
   // require an atom style with charge defined
 
   if (!atom->q_flag && (ewald_order&(1<<1)))
-    error->all(
+    error->all(FLERR,
 	"Invoking coulombic in pair style lj/coul requires atom attribute q");
 
   // request regular or rRESPA neighbor lists
@@ -282,12 +279,12 @@ void PairBuckCoul::init_style()
 
   if (ewald_order&(1<<1)) {				// r^-1 kspace
     if (force->kspace == NULL) 
-      error->all("Pair style is incompatible with KSpace style");
+      error->all(FLERR,"Pair style is incompatible with KSpace style");
     g_ewald = force->kspace->g_ewald;
   }
   if (ewald_order&(1<<6)) {				// r^-6 kspace
     if (!force->kspace && strcmp(force->kspace_style,"ewald/n"))
-      error->all("Pair style is incompatible with KSpace style");
+      error->all(FLERR,"Pair style is incompatible with KSpace style");
     g_ewald = force->kspace->g_ewald;
   }
 
@@ -315,7 +312,7 @@ void PairBuckCoul::init_list(int id, NeighList *ptr)
 
 double PairBuckCoul::init_one(int i, int j)
 {
-  if (setflag[i][j] == 0) error->all("All pair coeffs are not set");
+  if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
 
   cut_buck[i][j] = cut_buck_read[i][j];
   buck_a[i][j] = buck_a_read[i][j];
@@ -333,7 +330,7 @@ double PairBuckCoul::init_one(int i, int j)
   // check interior rRESPA cutoff
 
   if (cut_respa && MIN(cut_buck[i][j],cut_coul) < cut_respa[3])
-    error->all("Pair cutoff < Respa interior cutoff");
+    error->all(FLERR,"Pair cutoff < Respa interior cutoff");
      
   if (offset_flag) {
     double rexp = exp(-cut_buck[i][j]/buck_rho[i][j]);
diff --git a/src/USER-EWALDN/pair_lj_coul.cpp b/src/USER-EWALDN/pair_lj_coul.cpp
index b6ee94bbdab1e5edb4bc16e28f3c9268d6a15b07..4e1692680f314233cb77d82b7e437ea6f616fc24 100644
--- a/src/USER-EWALDN/pair_lj_coul.cpp
+++ b/src/USER-EWALDN/pair_lj_coul.cpp
@@ -36,9 +36,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define EWALD_F   1.12837917
 #define EWALD_P   0.3275911
 #define A1        0.254829592
@@ -71,10 +68,10 @@ void PairLJCoul::options(char **arg, int order)
   char *option[] = {"long", "cut", "off", NULL};
   int i;
 
-  if (!*arg) error->all(PAIR_ILLEGAL);
+  if (!*arg) error->all(FLERR,PAIR_ILLEGAL);
   for (i=0; option[i]&&strcmp(arg[0], option[i]); ++i);
   switch (i) {
-    default: error->all(PAIR_ILLEGAL);
+    default: error->all(FLERR,PAIR_ILLEGAL);
     case 0: ewald_order |= 1<<order; break;		// set kspace r^-order
     case 2: ewald_off |= 1<<order;			// turn r^-order off
     case 1: break;
@@ -84,18 +81,18 @@ void PairLJCoul::options(char **arg, int order)
 
 void PairLJCoul::settings(int narg, char **arg)
 {
-  if (narg != 3 && narg != 4) error->all("Illegal pair_style command");
+  if (narg != 3 && narg != 4) error->all(FLERR,"Illegal pair_style command");
 
   ewald_off = 0;
   ewald_order = 0;
   options(arg, 6);
   options(++arg, 1);
-  if (!comm->me && ewald_order&(1<<6)) error->warning(PAIR_MIX);
-  if (!comm->me && ewald_order==((1<<1)|(1<<6))) error->warning(PAIR_LARGEST);
-  if (!*(++arg)) error->all(PAIR_MISSING);
-  if (!((ewald_order^ewald_off)&(1<<1))) error->all(PAIR_COUL_CUT);
+  if (!comm->me && ewald_order&(1<<6)) error->warning(FLERR,PAIR_MIX);
+  if (!comm->me && ewald_order==((1<<1)|(1<<6))) error->warning(FLERR,PAIR_LARGEST);
+  if (!*(++arg)) error->all(FLERR,PAIR_MISSING);
+  if (!((ewald_order^ewald_off)&(1<<1))) error->all(FLERR,PAIR_COUL_CUT);
   cut_lj_global = force->numeric(*(arg++));
-  if (*arg&&(ewald_order&0x42==0x42)) error->all(PAIR_CUTOFF);
+  if (*arg&&(ewald_order&0x42==0x42)) error->all(FLERR,PAIR_CUTOFF);
   if (narg == 4) cut_coul = force->numeric(*arg);
   else cut_coul = cut_lj_global;
 
@@ -188,7 +185,7 @@ void *PairLJCoul::extract(char *id, int &dim)
 
 void PairLJCoul::coeff(int narg, char **arg)
 {
-  if (narg < 4 || narg > 5) error->all("Incorrect args for pair coefficients");
+  if (narg < 4 || narg > 5) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -212,7 +209,7 @@ void PairLJCoul::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -228,7 +225,7 @@ void PairLJCoul::init_style()
   // require an atom style with charge defined
 
   if (!atom->q_flag && (ewald_order&(1<<1)))
-    error->all(
+    error->all(FLERR,
 	"Invoking coulombic in pair style lj/coul requires atom attribute q");
 
   // request regular or rRESPA neighbor lists
@@ -280,15 +277,15 @@ void PairLJCoul::init_style()
 
   if (ewald_order&(1<<1)) {				// r^-1 kspace
     if (force->kspace == NULL) 
-      error->all("Pair style is incompatible with KSpace style");
+      error->all(FLERR,"Pair style is incompatible with KSpace style");
     for (i=0; style1[i]&&strcmp(force->kspace_style, style1[i]); ++i);
-    if (!style1[i]) error->all("Pair style is incompatible with KSpace style");
+    if (!style1[i]) error->all(FLERR,"Pair style is incompatible with KSpace style");
   }
   if (ewald_order&(1<<6)) {				// r^-6 kspace
     if (force->kspace == NULL) 
-      error->all("Pair style is incompatible with KSpace style");
+      error->all(FLERR,"Pair style is incompatible with KSpace style");
     for (i=0; style6[i]&&strcmp(force->kspace_style, style6[i]); ++i);
-    if (!style6[i]) error->all("Pair style is incompatible with KSpace style");
+    if (!style6[i]) error->all(FLERR,"Pair style is incompatible with KSpace style");
   }
   if (force->kspace) g_ewald = force->kspace->g_ewald;
 
@@ -343,7 +340,7 @@ double PairLJCoul::init_one(int i, int j)
   // check interior rRESPA cutoff
 
   if (cut_respa && MIN(cut_lj[i][j],cut_coul) < cut_respa[3])
-    error->all("Pair cutoff < Respa interior cutoff");
+    error->all(FLERR,"Pair cutoff < Respa interior cutoff");
  
   if (offset_flag) {
     double ratio = sigma[i][j] / cut_lj[i][j];
diff --git a/src/USER-MISC/angle_cosine_shift.cpp b/src/USER-MISC/angle_cosine_shift.cpp
index 4c6c7cf74ae53c1493c15ec50d2f08e2aafccd0a..2fa2ad2b96124723d642f42a25a8be8665ce0412 100644
--- a/src/USER-MISC/angle_cosine_shift.cpp
+++ b/src/USER-MISC/angle_cosine_shift.cpp
@@ -168,7 +168,7 @@ void AngleCosineShift::allocate()
 
 void AngleCosineShift::coeff(int narg, char **arg)
 {
-  if (narg != 3) error->all("Incorrect args for angle coefficients");
+  if (narg != 3) error->all(FLERR,"Incorrect args for angle coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -190,7 +190,7 @@ void AngleCosineShift::coeff(int narg, char **arg)
     count++;
   }
 
-  if (count == 0) error->all("Incorrect args for angle coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for angle coefficients");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/USER-MISC/angle_cosine_shift_exp.cpp b/src/USER-MISC/angle_cosine_shift_exp.cpp
index 7cbfd5bcfc596e4955a8426c22508b4ad9ad8573..cd6a4960d93228ce4368d966f188c11bd8487c0a 100644
--- a/src/USER-MISC/angle_cosine_shift_exp.cpp
+++ b/src/USER-MISC/angle_cosine_shift_exp.cpp
@@ -190,7 +190,7 @@ void AngleCosineShiftExp::allocate()
 
 void AngleCosineShiftExp::coeff(int narg, char **arg)
 {
-  if (narg != 4) error->all("Incorrect args for angle coefficients");
+  if (narg != 4) error->all(FLERR,"Incorrect args for angle coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -215,7 +215,7 @@ void AngleCosineShiftExp::coeff(int narg, char **arg)
     count++;
   }
 
-  if (count == 0) error->all("Incorrect args for angle coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for angle coefficients");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/USER-MISC/bond_harmonic_shift.cpp b/src/USER-MISC/bond_harmonic_shift.cpp
index b051c7dff5d541fe72d4ba03acbe600c9074fb37..958dad69f811d7e3ec7f25f5f614d0f389bb40ea 100644
--- a/src/USER-MISC/bond_harmonic_shift.cpp
+++ b/src/USER-MISC/bond_harmonic_shift.cpp
@@ -125,7 +125,7 @@ void BondHarmonicShift::allocate()
 
 void BondHarmonicShift::coeff(int narg, char **arg)
 {
-  if (narg != 4) error->all("Incorrect args for bond coefficients");
+  if (narg != 4) error->all(FLERR,"Incorrect args for bond coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -144,7 +144,7 @@ void BondHarmonicShift::coeff(int narg, char **arg)
     count++;
   }
 
-  if (count == 0) error->all("Incorrect args for bond coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for bond coefficients");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/USER-MISC/bond_harmonic_shift_cut.cpp b/src/USER-MISC/bond_harmonic_shift_cut.cpp
index 68f622488faea5c1e0a5f9b9fd926a5078a68f68..da78a54aed8ea438b0e147d63f961d606a19cd65 100644
--- a/src/USER-MISC/bond_harmonic_shift_cut.cpp
+++ b/src/USER-MISC/bond_harmonic_shift_cut.cpp
@@ -126,7 +126,7 @@ void BondHarmonicShiftCut::allocate()
 
 void BondHarmonicShiftCut::coeff(int narg, char **arg)
 {
-  if (narg != 4) error->all("Incorrect args for bond coefficients");
+  if (narg != 4) error->all(FLERR,"Incorrect args for bond coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -145,7 +145,7 @@ void BondHarmonicShiftCut::coeff(int narg, char **arg)
     count++;
   }
 
-  if (count == 0) error->all("Incorrect args for bond coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for bond coefficients");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/USER-MISC/compute_ackland_atom.cpp b/src/USER-MISC/compute_ackland_atom.cpp
index fa50b5f9d2b6ba6e65deb8cb2ad3ad44850e1df9..33b2d8a8e0f9727fce6206497ac0744322e1e2e6 100644
--- a/src/USER-MISC/compute_ackland_atom.cpp
+++ b/src/USER-MISC/compute_ackland_atom.cpp
@@ -40,7 +40,7 @@ enum{UNKNOWN,BCC,FCC,HCP,ICO};
 ComputeAcklandAtom::ComputeAcklandAtom(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Illegal compute ackland/atom command");
+  if (narg != 3) error->all(FLERR,"Illegal compute ackland/atom command");
 
   peratom_flag = 1;
   size_peratom_cols = 0;
@@ -82,7 +82,7 @@ void ComputeAcklandAtom::init()
   for (int i = 0; i < modify->ncompute; i++)
     if (strcmp(modify->compute[i]->style,"ackland/atom") == 0) count++;
   if (count > 1 && comm->me == 0)
-    error->warning("More than one compute ackland/atom");
+    error->warning(FLERR,"More than one compute ackland/atom");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/USER-MISC/compute_temp_rotate.cpp b/src/USER-MISC/compute_temp_rotate.cpp
index 60f704e4e21b546c5a6cfef61a195e8f5813a384..539683f4f438af059186b6f6d234c747d0c06480 100644
--- a/src/USER-MISC/compute_temp_rotate.cpp
+++ b/src/USER-MISC/compute_temp_rotate.cpp
@@ -32,15 +32,12 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 ComputeTempRotate::ComputeTempRotate(LAMMPS *lmp, int narg, char **arg) : 
   Compute(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Illegal compute temp/rotate command");
+  if (narg != 3) error->all(FLERR,"Illegal compute temp/rotate command");
 
   scalar_flag = vector_flag = 1;
   size_vector = 6;
diff --git a/src/USER-MISC/dihedral_cosine_shift_exp.cpp b/src/USER-MISC/dihedral_cosine_shift_exp.cpp
index 88258b430c359d7148797f8d16aa73a7ca52e9b5..29e15fe6cec1d55f46028d6e947b907c43f573bf 100644
--- a/src/USER-MISC/dihedral_cosine_shift_exp.cpp
+++ b/src/USER-MISC/dihedral_cosine_shift_exp.cpp
@@ -144,7 +144,7 @@ void DihedralCosineShiftExp::compute(int eflag, int vflag)
 	sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
 		me,update->ntimestep,
 		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(str,0);
+	error->warning(FLERR,str,0);
 	fprintf(screen,"  1st atom: %d %g %g %g\n",
 		me,x[i1][0],x[i1][1],x[i1][2]);
 	fprintf(screen,"  2nd atom: %d %g %g %g\n",
@@ -273,7 +273,7 @@ void DihedralCosineShiftExp::allocate()
 
 void DihedralCosineShiftExp::coeff(int narg, char **arg)
 {
-  if (narg != 4) error->all("Incorrect args for dihedral coefficients");
+  if (narg != 4) error->all(FLERR,"Incorrect args for dihedral coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi;
@@ -298,7 +298,7 @@ void DihedralCosineShiftExp::coeff(int narg, char **arg)
     count++;
   }
 
-  if (count == 0) error->all("Incorrect args for dihedral coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for dihedral coefficients");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/USER-MISC/fix_addtorque.cpp b/src/USER-MISC/fix_addtorque.cpp
index e12a4658b4b471667e02cc8bc1a12f100d80d15e..bf1a8b58aa5f92a2607a6527083455822d04dfe5 100644
--- a/src/USER-MISC/fix_addtorque.cpp
+++ b/src/USER-MISC/fix_addtorque.cpp
@@ -39,7 +39,7 @@ enum{NONE,CONSTANT,EQUAL,ATOM};
 FixAddTorque::FixAddTorque(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg != 6) error->all("Illegal fix addtorque command");
+  if (narg != 6) error->all(FLERR,"Illegal fix addtorque command");
 
   scalar_flag = 1;
   vector_flag = 1;
@@ -108,21 +108,21 @@ void FixAddTorque::init()
 
   if (xstr) {
     xvar = input->variable->find(xstr);
-    if (xvar < 0) error->all("Variable name for fix addtorque does not exist");
+    if (xvar < 0) error->all(FLERR,"Variable name for fix addtorque does not exist");
     if (input->variable->equalstyle(xvar)) xstyle = EQUAL;
-    else error->all("Variable for fix addtorque is invalid style");
+    else error->all(FLERR,"Variable for fix addtorque is invalid style");
   }
   if (ystr) {
     yvar = input->variable->find(ystr);
-    if (yvar < 0) error->all("Variable name for fix addtorque does not exist");
+    if (yvar < 0) error->all(FLERR,"Variable name for fix addtorque does not exist");
     if (input->variable->equalstyle(yvar)) ystyle = EQUAL;
-    else error->all("Variable for fix addtorque is invalid style");
+    else error->all(FLERR,"Variable for fix addtorque is invalid style");
   }
   if (zstr) {
     zvar = input->variable->find(zstr);
-    if (zvar < 0) error->all("Variable name for fix addtorque does not exist");
+    if (zvar < 0) error->all(FLERR,"Variable name for fix addtorque does not exist");
     if (input->variable->equalstyle(zvar)) zstyle = EQUAL;
-    else error->all("Variable for fix addtorque is invalid style");
+    else error->all(FLERR,"Variable for fix addtorque is invalid style");
   }
 
   if (xstyle == EQUAL || ystyle == EQUAL || zstyle == EQUAL)
diff --git a/src/USER-MISC/fix_imd.cpp b/src/USER-MISC/fix_imd.cpp
index 3b34ac69b603cc30519c86277b6705520b932d1a..25b140318d5e4418b3a52789c3b1d7482a908622 100644
--- a/src/USER-MISC/fix_imd.cpp
+++ b/src/USER-MISC/fix_imd.cpp
@@ -444,11 +444,11 @@ FixIMD::FixIMD(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
   if (narg < 4) 
-    error->all("Illegal fix imd command");
+    error->all(FLERR,"Illegal fix imd command");
 
   imd_port = atoi(arg[3]); 
   if (imd_port < 1024)
-    error->all("Illegal fix imd parameter: port < 1024");
+    error->all(FLERR,"Illegal fix imd parameter: port < 1024");
 
   /* default values for optional flags */
   unwrap_flag = 0;
@@ -477,17 +477,17 @@ FixIMD::FixIMD(LAMMPS *lmp, int narg, char **arg) :
     } else if (0 == strcmp(arg[argsdone], "trate")) {
       imd_trate = atoi(arg[argsdone+1]);
     } else {
-      error->all("Unknown fix imd parameter");
+      error->all(FLERR,"Unknown fix imd parameter");
     }
     ++argsdone; ++argsdone;
   }
 
   /* sanity check on parameters */
   if (imd_trate < 1)
-    error->all("Illegal fix imd parameter. trate < 1.");
+    error->all(FLERR,"Illegal fix imd parameter. trate < 1.");
 
   bigint n = group->count(igroup);
-  if (n > MAXSMALLINT) error->all("Too many atoms for fix imd");
+  if (n > MAXSMALLINT) error->all(FLERR,"Too many atoms for fix imd");
   num_coords = static_cast<int> (n);
 
   MPI_Comm_rank(world,&me);
@@ -522,7 +522,7 @@ FixIMD::FixIMD(LAMMPS *lmp, int narg, char **arg) :
   }
   MPI_Bcast(&imd_terminate, 1, MPI_INT, 0, world);
   if (imd_terminate)
-    error->all("LAMMPS Terminated on error in IMD.");
+    error->all(FLERR,"LAMMPS Terminated on error in IMD.");
     
   /* storage required to communicate a single coordinate or force. */
   size_one = sizeof(struct commdata);
@@ -702,7 +702,7 @@ void FixIMD::setup(int)
   MPI_Bcast(&imd_inactive, 1, MPI_INT, 0, world);
   MPI_Bcast(&imd_terminate, 1, MPI_INT, 0, world);
   if (imd_terminate)
-    error->all("LAMMPS terminated on error in setting up IMD connection.");
+    error->all(FLERR,"LAMMPS terminated on error in setting up IMD connection.");
 
   /* initialize and build hashtable. */
   inthash_t *hashtable=new inthash_t;
@@ -815,7 +815,7 @@ void FixIMD::post_force(int vflag)
     MPI_Bcast(&imd_inactive, 1, MPI_INT, 0, world);
     MPI_Bcast(&imd_terminate, 1, MPI_INT, 0, world);
     if (imd_terminate)
-      error->all("LAMMPS terminated on error in setting up IMD connection.");
+      error->all(FLERR,"LAMMPS terminated on error in setting up IMD connection.");
     if (imd_inactive)
       return;     /* IMD client has detached and not yet come back. do nothing. */
   }
@@ -951,7 +951,7 @@ void FixIMD::post_force(int vflag)
   MPI_Bcast(&imd_forces, 1, MPI_INT, 0, world);
   MPI_Bcast(&imd_terminate, 1, MPI_INT, 0, world);
   if (imd_terminate)
-    error->all("LAMMPS terminated on IMD request.");
+    error->all(FLERR,"LAMMPS terminated on IMD request.");
 
   if (imd_forces > 0) {
     /* check if we need to readjust the forces comm buffer on the receiving nodes. */
diff --git a/src/USER-MISC/fix_smd.cpp b/src/USER-MISC/fix_smd.cpp
index 4d251d3fe3dc035cef455a3ef90ad22819c5a099..836a11cd64fc2ef999417347ea421aef006fdfe4 100644
--- a/src/USER-MISC/fix_smd.cpp
+++ b/src/USER-MISC/fix_smd.cpp
@@ -57,20 +57,20 @@ FixSMD::FixSMD(LAMMPS *lmp, int narg, char **arg) :
 
   int argoffs=3;
   if (strcmp(arg[argoffs],"cvel") == 0) {
-    if (narg < argoffs+3) error->all("Illegal fix smd command");
+    if (narg < argoffs+3) error->all(FLERR,"Illegal fix smd command");
     styleflag |= SMD_CVEL;
     k_smd = atof(arg[argoffs+1]);
     v_smd = atof(arg[argoffs+2]); // to be multiplied by update->dt when used.
     argoffs += 3;
   } else if (strcmp(arg[argoffs],"cfor") == 0) {
-    if (narg < argoffs+2) error->all("Illegal fix smd command");
+    if (narg < argoffs+2) error->all(FLERR,"Illegal fix smd command");
     styleflag |= SMD_CFOR;
     f_smd = atof(arg[argoffs+1]);
     argoffs += 2;
-  } else error->all("Illegal fix smd command");
+  } else error->all(FLERR,"Illegal fix smd command");
   
   if (strcmp(arg[argoffs],"tether") == 0) {
-    if (narg < argoffs+5) error->all("Illegal fix smd command");
+    if (narg < argoffs+5) error->all(FLERR,"Illegal fix smd command");
     styleflag |= SMD_TETHER;
     if (strcmp(arg[argoffs+1],"NULL") == 0) xflag = 0;
     else xc = atof(arg[argoffs+1]);
@@ -79,16 +79,16 @@ FixSMD::FixSMD(LAMMPS *lmp, int narg, char **arg) :
     if (strcmp(arg[argoffs+3],"NULL") == 0) zflag = 0;
     else zc = atof(arg[argoffs+3]);
     r0 = atof(arg[argoffs+4]);
-    if (r0 < 0) error->all("R0 < 0 for fix smd command");
+    if (r0 < 0) error->all(FLERR,"R0 < 0 for fix smd command");
     argoffs += 5;
   } else if (strcmp(arg[argoffs],"couple") == 0) {
-    if (narg < argoffs+6) error->all("Illegal fix smd command");
+    if (narg < argoffs+6) error->all(FLERR,"Illegal fix smd command");
     styleflag |= SMD_COUPLE;
     igroup2 = group->find(arg[argoffs+1]);
     if (igroup2 == -1) 
-      error->all("Could not find fix smd couple group ID"); 
+      error->all(FLERR,"Could not find fix smd couple group ID"); 
     if (igroup2 == igroup) 
-      error->all("Two groups cannot be the same in fix smd couple"); 
+      error->all(FLERR,"Two groups cannot be the same in fix smd couple"); 
     group2bit = group->bitmask[igroup2];
 
     if (strcmp(arg[argoffs+2],"NULL") == 0) xflag = 0;
@@ -102,9 +102,9 @@ FixSMD::FixSMD(LAMMPS *lmp, int narg, char **arg) :
     else zc = atof(arg[argoffs+4]);
     
     r0 = atof(arg[argoffs+5]);
-    if (r0 < 0) error->all("R0 < 0 for fix smd command");
+    if (r0 < 0) error->all(FLERR,"R0 < 0 for fix smd command");
     argoffs +=6;
-  } else error->all("Illegal fix smd command");
+  } else error->all(FLERR,"Illegal fix smd command");
 
   force_flag = 0;
   ftotal[0] = ftotal[1] = ftotal[2] = 0.0;
diff --git a/src/USER-MISC/pair_cdeam.cpp b/src/USER-MISC/pair_cdeam.cpp
index 2d0e224f1cc37c0daff1722a11cfa1d673bb6f9c..b2e6265a2c72c6aaf2ac862bb3bfa7df487dc209 100644
--- a/src/USER-MISC/pair_cdeam.cpp
+++ b/src/USER-MISC/pair_cdeam.cpp
@@ -41,7 +41,7 @@ using namespace LAMMPS_NS;
 	inline void my_failure(Error* error, const char* file, int line) {
 		char str[1024];
 		sprintf(str,"Assertion failure: File %s, line %i", file, line);
-		error->one(str);
+		error->one(FLERR,str);
 	}
 #else
 	#define ASSERT(cond)
@@ -66,7 +66,7 @@ PairCDEAM::PairCDEAM(LAMMPS *lmp, int _cdeamVersion) : PairEAM(lmp), PairEAMAllo
 		comm_reverse = 2;
 	}
 	else {
-		error->all("Invalid CD-EAM potential version.");
+		error->all(FLERR,"Invalid CD-EAM potential version.");
 	}
 }
 
@@ -202,7 +202,7 @@ void PairCDEAM::compute(int eflag, int vflag)
 	//
 	//for(i = 0; i < nlocal + atom->nghost; i++) {
 	//	if(rho[i] == 0 && (type[i] == speciesA || type[i] == speciesB))
-	//		error->one("CD-EAM potential routine: Detected atom with zero electron density.");
+	//		error->one(FLERR,"CD-EAM potential routine: Detected atom with zero electron density.");
 	//}
 
 	// Stage II
@@ -421,7 +421,7 @@ void PairCDEAM::coeff(int narg, char **arg)
 
 	// Make sure the EAM file is a CD-EAM binary alloy.
 	if(setfl->nelements < 2)
-		error->all("The EAM file must contain at least 2 elements to be used with the eam/cd pair style.");
+		error->all(FLERR,"The EAM file must contain at least 2 elements to be used with the eam/cd pair style.");
 
 	// Read in the coefficients of the h polynomial from the end of the EAM file.
 	read_h_coeff(arg[2]);
@@ -434,19 +434,19 @@ void PairCDEAM::coeff(int narg, char **arg)
 	for(int i = 1; i <= atom->ntypes; i++) {
 		if(map[i] == 0) {
 			if(speciesA >= 0)
-				error->all("The first element from the EAM file may only be mapped to a single atom type.");
+				error->all(FLERR,"The first element from the EAM file may only be mapped to a single atom type.");
 			speciesA = i;
 		}
 		if(map[i] == 1) {
 			if(speciesB >= 0)
-				error->all("The second element from the EAM file may only be mapped to a single atom type.");
+				error->all(FLERR,"The second element from the EAM file may only be mapped to a single atom type.");
 			speciesB = i;
 		}
 	}
 	if(speciesA < 0)
-		error->all("The first element from the EAM file must be mapped to exactly one atom type.");
+		error->all(FLERR,"The first element from the EAM file must be mapped to exactly one atom type.");
 	if(speciesB < 0)
-		error->all("The second element from the EAM file must be mapped to exactly one atom type.");
+		error->all(FLERR,"The second element from the EAM file must be mapped to exactly one atom type.");
 }
 
 /* ----------------------------------------------------------------------
@@ -463,7 +463,7 @@ void PairCDEAM::read_h_coeff(char *filename)
 		if (fp == NULL) {
 			char str[128];
 			sprintf(str,"Cannot open EAM potential file %s", filename);
-			error->one(str);
+			error->one(FLERR,str);
 		}
 
 		// h coefficients are stored at the end of the file.
@@ -480,7 +480,7 @@ void PairCDEAM::read_h_coeff(char *filename)
 			hcoeff[i++] = atof(ptr);
 		}
 		if(i != nhcoeff || nhcoeff < 1)
-			error->one("Failed to read h(x) function coefficients from EAM file.");
+			error->one(FLERR,"Failed to read h(x) function coefficients from EAM file.");
 
 		// Close the potential file.
 		fclose(fp);
diff --git a/src/USER-MISC/pair_dipole_sf.cpp b/src/USER-MISC/pair_dipole_sf.cpp
index f437571790973bc8da27387a2314645213b36750..8adf066352d38405d4fb1757f466a46bb78ad0c6 100644
--- a/src/USER-MISC/pair_dipole_sf.cpp
+++ b/src/USER-MISC/pair_dipole_sf.cpp
@@ -28,9 +28,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairDipoleSF::PairDipoleSF(LAMMPS *lmp) : Pair(lmp)
@@ -326,7 +323,7 @@ void PairDipoleSF::allocate()
 void PairDipoleSF::settings(int narg, char **arg)
 {
   if (narg < 1 || narg > 2)
-    error->all("Incorrect args in pair_style command");
+    error->all(FLERR,"Incorrect args in pair_style command");
 
   cut_lj_global = force->numeric(arg[0]);
   if (narg == 1) cut_coul_global = cut_lj_global;
@@ -352,7 +349,7 @@ void PairDipoleSF::settings(int narg, char **arg)
 void PairDipoleSF::coeff(int narg, char **arg)
 {
   if (narg < 4 || narg > 6) 
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -379,7 +376,7 @@ void PairDipoleSF::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -389,7 +386,7 @@ void PairDipoleSF::coeff(int narg, char **arg)
 void PairDipoleSF::init_style()
 {
   if (!atom->q_flag || !atom->mu_flag || !atom->torque_flag)
-    error->all("Pair dipole/sf requires atom attributes q, mu, torque");
+    error->all(FLERR,"Pair dipole/sf requires atom attributes q, mu, torque");
 
   neighbor->request(this);
 }
diff --git a/src/USER-MISC/pair_edip.cpp b/src/USER-MISC/pair_edip.cpp
index 369877ab3d944e84f0c6b897f1f5d439d26667d8..77e5ee20da513002f188a0fe1ca14e5dc0a78e79 100755
--- a/src/USER-MISC/pair_edip.cpp
+++ b/src/USER-MISC/pair_edip.cpp
@@ -616,7 +616,7 @@ void PairEDIP::allocate()
 
 void PairEDIP::settings(int narg, char **arg)
 {
-  if (narg != 0) error->all("Illegal pair_style command");
+  if (narg != 0) error->all(FLERR,"Illegal pair_style command");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -757,12 +757,12 @@ void PairEDIP::coeff(int narg, char **arg)
   if (!allocated) allocate();
 
   if (narg != 3 + atom->ntypes)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   // insure I,J args are * *
 
   if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   // read args that map atom types to elements in potential file
   // map[i] = which element the Ith atom type is, -1 if NULL
@@ -815,7 +815,7 @@ void PairEDIP::coeff(int narg, char **arg)
 	count++;
       }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 
   // allocate tables and internal structures
 
@@ -831,9 +831,9 @@ void PairEDIP::coeff(int narg, char **arg)
 void PairEDIP::init_style()
 {
   if (atom->tag_enable == 0)
-    error->all("Pair style EDIP requires atom IDs");
+    error->all(FLERR,"Pair style EDIP requires atom IDs");
   if (force->newton_pair == 0)
-    error->all("Pair style EDIP requires newton pair on");
+    error->all(FLERR,"Pair style EDIP requires newton pair on");
 
   // need a full neighbor list
 
@@ -848,7 +848,7 @@ void PairEDIP::init_style()
 
 double PairEDIP::init_one(int i, int j)
 {
-  if (setflag[i][j] == 0) error->all("All pair coeffs are not set");
+  if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
 
   return cutmax;
 }
@@ -872,7 +872,7 @@ void PairEDIP::read_file(char *file)
     if (fp == NULL) {
       char str[128];
       sprintf(str,"Cannot open EDIP potential file %s",file);
-      error->one(str);
+      error->one(FLERR,str);
     }
   }
 
@@ -923,7 +923,7 @@ void PairEDIP::read_file(char *file)
     }
 
     if (nwords != params_per_line)
-      error->all("Incorrect format in EDIP potential file");
+      error->all(FLERR,"Incorrect format in EDIP potential file");
 
     // words = ptrs to all words in line
 
@@ -980,7 +980,7 @@ void PairEDIP::read_file(char *file)
 	params[nparams].eta < 0.0 || params[nparams].gamm < 0.0 ||
 	params[nparams].lambda < 0.0 || params[nparams].mu < 0.0 ||
 	params[nparams].rho < 0.0 || params[nparams].sigma < 0.0)
-      error->all("Illegal EDIP parameter");
+      error->all(FLERR,"Illegal EDIP parameter");
     
     nparams++;
   }
@@ -1009,11 +1009,11 @@ void PairEDIP::setup()
 	for (m = 0; m < nparams; m++) {
 	  if (i == params[m].ielement && j == params[m].jelement && 
 	      k == params[m].kelement) {
-	    if (n >= 0) error->all("Potential file has duplicate entry");
+	    if (n >= 0) error->all(FLERR,"Potential file has duplicate entry");
 	    n = m;
 	  }
 	}
-	if (n < 0) error->all("Potential file is missing an entry");
+	if (n < 0) error->all(FLERR,"Potential file is missing an entry");
 	elem2param[i][j][k] = n;
       }
 
diff --git a/src/USER-MISC/pair_lj_sf.cpp b/src/USER-MISC/pair_lj_sf.cpp
index b4a278188a0a39cf1c8371b3bd5c958c4fe9ab9a..633b8be2e87412c6d7eaea10a841b186cfb6b50b 100644
--- a/src/USER-MISC/pair_lj_sf.cpp
+++ b/src/USER-MISC/pair_lj_sf.cpp
@@ -28,9 +28,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairLJShiftedForce::PairLJShiftedForce(LAMMPS *lmp) : Pair(lmp) {}
@@ -173,12 +170,12 @@ void PairLJShiftedForce::allocate()
 
 void PairLJShiftedForce::settings(int narg, char **arg)
 {
-  if (narg != 1) error->all("Illegal pair_style command");
+  if (narg != 1) error->all(FLERR,"Illegal pair_style command");
 
   cut_global = force->numeric(arg[0]);
 
   if (cut_global <= 0.0)
-    error->all("Illegal pair_style command");
+    error->all(FLERR,"Illegal pair_style command");
   
   // reset cutoffs that have been explicitly set
 
@@ -196,7 +193,7 @@ void PairLJShiftedForce::settings(int narg, char **arg)
 
 void PairLJShiftedForce::coeff(int narg, char **arg)
 {
-  if (narg < 4 || narg > 5) error->all("Incorrect args for pair coefficients");
+  if (narg < 4 || narg > 5) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -210,7 +207,7 @@ void PairLJShiftedForce::coeff(int narg, char **arg)
   if (narg == 5) cut_one = force->numeric(arg[4]);
 
   if (cut_one <= 0.0)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
   
   int count = 0;
   for (int i = ilo; i <= ihi; i++) {
@@ -223,7 +220,7 @@ void PairLJShiftedForce::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/USER-REAXC/fix_qeq_reax.cpp b/src/USER-REAXC/fix_qeq_reax.cpp
index 0c7784aaddf19a1c2fc9e20bd9f2dabc2c24b5a7..b68da226f4d17d0d708446bdf8287aed022d97a9 100644
--- a/src/USER-REAXC/fix_qeq_reax.cpp
+++ b/src/USER-REAXC/fix_qeq_reax.cpp
@@ -50,15 +50,12 @@ using namespace LAMMPS_NS;
 #define MIN_CAP 50
 #define MIN_NBRS 100
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) : 
   Fix(lmp, narg, arg)
 {
-  if (narg != 8) error->all("Illegal fix qeq/reax command"); 
+  if (narg != 8) error->all(FLERR,"Illegal fix qeq/reax command"); 
   
   nevery = atoi(arg[3]);
   swa = atof(arg[4]);
@@ -148,13 +145,13 @@ void FixQEqReax::pertype_parameters(char *arg)
   if (strcmp(arg,"reax/c") == 0) {
     reaxflag = 1;
     Pair *pair = force->pair_match("reax/c",1);
-    if (pair == NULL) error->all("No pair reax/c for fix qeq/reax");
+    if (pair == NULL) error->all(FLERR,"No pair reax/c for fix qeq/reax");
     int tmp;
     chi = (double *) pair->extract("chi",tmp);
     eta = (double *) pair->extract("eta",tmp);
     gamma = (double *) pair->extract("gamma",tmp);
     if (chi == NULL || eta == NULL || gamma == NULL)
-      error->all("Fix qeq/reax could not extract params from pair reax/c");
+      error->all(FLERR,"Fix qeq/reax could not extract params from pair reax/c");
     return;
   }
 
@@ -171,17 +168,17 @@ void FixQEqReax::pertype_parameters(char *arg)
 
   if (comm->me == 0) {
     if ((pf = fopen(arg,"r")) == NULL)
-      error->one("Fix qeq/reax parameter file could not be found");
+      error->one(FLERR,"Fix qeq/reax parameter file could not be found");
     
     for (i = 1; i <= ntypes && !feof(pf); i++) {
       fscanf(pf,"%d %lg %lg %lg",&itype,&v1,&v2,&v3);
       if (itype < 1 || itype > ntypes)
-	error->one("Fix qeq/reax invalid atom type in param file");
+	error->one(FLERR,"Fix qeq/reax invalid atom type in param file");
       chi[itype] = v1;
       eta[itype] = v2;
       gamma[itype] = v3;
     }
-    if (i <= ntypes) error->one("Invalid param file for fix qeq/reax");
+    if (i <= ntypes) error->one(FLERR,"Invalid param file for fix qeq/reax");
     fclose(pf);
   }
 
@@ -287,7 +284,7 @@ void FixQEqReax::reallocate_matrix()
 
 void FixQEqReax::init()
 {
-  if (!atom->q_flag) error->all("Fix qeq/reax requires atom attribute q");
+  if (!atom->q_flag) error->all(FLERR,"Fix qeq/reax requires atom attribute q");
 	
   // need a half neighbor list w/ Newton off
   // built whenever re-neighboring occurs
@@ -333,11 +330,11 @@ void FixQEqReax::init_taper()
   double d7, swa2, swa3, swb2, swb3;
 
   if (fabs(swa) > 0.01 && comm->me == 0)
-    error->warning("Fix qeq/reax has non-zero lower Taper radius cutoff");
+    error->warning(FLERR,"Fix qeq/reax has non-zero lower Taper radius cutoff");
   if (swb < 0)
-    error->all( "Fix qeq/reax has negative upper Taper radius cutoff");
+    error->all(FLERR, "Fix qeq/reax has negative upper Taper radius cutoff");
   else if (swb < 5 && comm->me == 0)
-    error->warning("Fix qeq/reax has very low Taper radius cutoff");
+    error->warning(FLERR,"Fix qeq/reax has very low Taper radius cutoff");
 
   d7 = pow( swb - swa, 7 );
   swa2 = SQR( swa );
@@ -536,8 +533,8 @@ void FixQEqReax::compute_H()
     char str[128];
     sprintf(str,"H matrix size has been exceeded: m_fill=%d H.m=%d\n",
 	     m_fill, H.m );
-    error->warning(str);
-    error->all("Fix qeq/reax has insufficient QEq matrix size");
+    error->warning(FLERR,str);
+    error->all(FLERR,"Fix qeq/reax has insufficient QEq matrix size");
   }
 }
 
@@ -606,7 +603,7 @@ int FixQEqReax::CG( double *b, double *x )
   }
 
   if (i >= 100 && comm->me == 0)
-    error->warning("Fix qeq/reax CG convergence failed");
+    error->warning(FLERR,"Fix qeq/reax CG convergence failed");
 
   return i;
 }
diff --git a/src/USER-REAXC/pair_reax_c.cpp b/src/USER-REAXC/pair_reax_c.cpp
index 023dc2db369788f3b35d45bf8b9f2b4a609941a4..96bdb293e647145ac122a6676efec17d240526b4 100644
--- a/src/USER-REAXC/pair_reax_c.cpp
+++ b/src/USER-REAXC/pair_reax_c.cpp
@@ -162,7 +162,7 @@ void PairReaxC::allocate( )
 
 void PairReaxC::settings(int narg, char **arg)
 {
-  if (narg != 1 && narg != 3) error->all("Illegal pair_style command");
+  if (narg != 1 && narg != 3) error->all(FLERR,"Illegal pair_style command");
 
   // read name of control file or use default controls
 
@@ -196,12 +196,12 @@ void PairReaxC::settings(int narg, char **arg)
 
   while (iarg < narg) {
     if (strcmp(arg[iarg],"checkqeq") == 0) {
-      if (iarg+2 > narg) error->all("Illegal pair_style reax/c command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal pair_style reax/c command");
       if (strcmp(arg[iarg+1],"yes") == 0) qeqflag = 1;
       else if (strcmp(arg[iarg+1],"no") == 0) qeqflag = 0;
-      else error->all("Illegal pair_style reax/c command");
+      else error->all(FLERR,"Illegal pair_style reax/c command");
       iarg += 2;
-    } else error->all("Illegal pair_style reax/c command");
+    } else error->all(FLERR,"Illegal pair_style reax/c command");
   }
 
   // LAMMPS is responsible for generating nbrs
@@ -216,12 +216,12 @@ void PairReaxC::coeff( int nargs, char **args )
   if (!allocated) allocate();
 
   if (nargs != 3 + atom->ntypes)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   // insure I,J args are * *
 
   if (strcmp(args[0],"*") != 0 || strcmp(args[1],"*") != 0)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   // read ffield file
 
@@ -244,7 +244,7 @@ void PairReaxC::coeff( int nargs, char **args )
     // error check
 
     if (itmp < 0 || itmp >= nreax_types)
-      error->all("Non-existent ReaxFF type");
+      error->all(FLERR,"Non-existent ReaxFF type");
 
   }
 
@@ -257,21 +257,21 @@ void PairReaxC::coeff( int nargs, char **args )
       count++;
     }
     
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairReaxC::init_style( )
 {
-  if (!atom->q_flag) error->all("Pair reax/c requires atom attribute q");
+  if (!atom->q_flag) error->all(FLERR,"Pair reax/c requires atom attribute q");
   firstwarn = 1;
 
   int iqeq;
   for (iqeq = 0; iqeq < modify->nfix; iqeq++)
     if (strcmp(modify->fix[iqeq]->style,"qeq/reax") == 0) break;
   if (iqeq == modify->nfix && qeqflag == 1) 
-    error->all("Pair reax/c requires use of fix qeq/reax");
+    error->all(FLERR,"Pair reax/c requires use of fix qeq/reax");
 
   system->n = atom->nlocal; // my atoms
   system->N = atom->nlocal + atom->nghost; // mine + ghosts
@@ -284,9 +284,9 @@ void PairReaxC::init_style( )
   system->big_box.box_norms[2] = 0;
 
   if (atom->tag_enable == 0)
-    error->all("Pair style reax/c requires atom IDs");
+    error->all(FLERR,"Pair style reax/c requires atom IDs");
   if (force->newton_pair == 0)
-    error->all("Pair style reax/c requires newton pair on");
+    error->all(FLERR,"Pair style reax/c requires newton pair on");
 
   // need a half neighbor list w/ Newton off
   // built whenever re-neighboring occurs
@@ -343,7 +343,7 @@ void PairReaxC::setup( )
     int num_nbrs = estimate_reax_lists();
     if(!Make_List(system->total_cap, num_nbrs, TYP_FAR_NEIGHBOR, 
 		  lists+FAR_NBRS, world))
-      error->all("Pair reax/c problem in far neighbor list");
+      error->all(FLERR,"Pair reax/c problem in far neighbor list");
   
     write_reax_lists();
     Initialize( system, control, data, workspace, &lists, out_control, 
@@ -398,7 +398,7 @@ void PairReaxC::compute(int eflag, int vflag)
   if ((eflag_atom || vflag_atom) && firstwarn) {
     firstwarn = 0;
     if (comm->me == 0) 
-      error->warning("Pair reax/c cannot yet compute "
+      error->warning(FLERR,"Pair reax/c cannot yet compute "
 		     "per-atom energy or stress");
   }
 
diff --git a/src/USER-SPH/atom_vec_meso.cpp b/src/USER-SPH/atom_vec_meso.cpp
index c977a8e324cc7d2763e3378029b35a088f3700fb..b69686824c34ac13048a33d3adbf823211c6ef66 100644
--- a/src/USER-SPH/atom_vec_meso.cpp
+++ b/src/USER-SPH/atom_vec_meso.cpp
@@ -60,7 +60,7 @@ void AtomVecMeso::grow(int n) {
 		nmax = n;
 	atom->nmax = nmax;
 	if (nmax < 0 || nmax > MAXSMALLINT)
-		error->one("Per-processor system is too big");
+		error->one(FLERR,"Per-processor system is too big");
 
 	tag = memory->grow(atom->tag, nmax, "atom:tag");
 	type = memory->grow(atom->type, nmax, "atom:type");
@@ -783,11 +783,11 @@ void AtomVecMeso::data_atom(double *coord, int imagetmp, char **values) {
 
 	tag[nlocal] = atoi(values[0]);
 	if (tag[nlocal] <= 0)
-		error->one("Invalid atom ID in Atoms section of data file");
+		error->one(FLERR,"Invalid atom ID in Atoms section of data file");
 
 	type[nlocal] = atoi(values[1]);
 	if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
-		error->one("Invalid atom type in Atoms section of data file");
+		error->one(FLERR,"Invalid atom type in Atoms section of data file");
 
 	rho[nlocal] = atof(values[2]);
 	e[nlocal] = atof(values[3]);
diff --git a/src/USER-SPH/compute_meso_e_atom.cpp b/src/USER-SPH/compute_meso_e_atom.cpp
index 934818584b56406a45201f4db43a2279bd39e7d1..4ee0dce518e5c91dcbc813eeffde7c308564141d 100644
--- a/src/USER-SPH/compute_meso_e_atom.cpp
+++ b/src/USER-SPH/compute_meso_e_atom.cpp
@@ -28,8 +28,8 @@ using namespace LAMMPS_NS;
 ComputeMesoEAtom::ComputeMesoEAtom(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Number of arguments for compute meso_e/atom command != 3");
-  if (atom->e_flag != 1) error->all("compute meso_e/atom command requires atom_style with energy (e.g. meso)");
+  if (narg != 3) error->all(FLERR,"Number of arguments for compute meso_e/atom command != 3");
+  if (atom->e_flag != 1) error->all(FLERR,"compute meso_e/atom command requires atom_style with energy (e.g. meso)");
 
   peratom_flag = 1;
   size_peratom_cols = 0;
@@ -54,7 +54,7 @@ void ComputeMesoEAtom::init()
   for (int i = 0; i < modify->ncompute; i++)
     if (strcmp(modify->compute[i]->style,"evector/atom") == 0) count++;
   if (count > 1 && comm->me == 0)
-    error->warning("More than one compute evector/atom");
+    error->warning(FLERR,"More than one compute evector/atom");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/USER-SPH/compute_meso_rho_atom.cpp b/src/USER-SPH/compute_meso_rho_atom.cpp
index 98aab3ad72a7b32c5e1a7a7dec9039873bdf3c68..465bbfe164e22e0f8ebe660f670e902705ba772c 100644
--- a/src/USER-SPH/compute_meso_rho_atom.cpp
+++ b/src/USER-SPH/compute_meso_rho_atom.cpp
@@ -28,8 +28,8 @@ using namespace LAMMPS_NS;
 ComputeMesoRhoAtom::ComputeMesoRhoAtom(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Illegal compute meso_rho/atom command");
-  if (atom->rho_flag != 1) error->all("compute meso_rho/atom command requires atom_style with density (e.g. meso)");
+  if (narg != 3) error->all(FLERR,"Illegal compute meso_rho/atom command");
+  if (atom->rho_flag != 1) error->all(FLERR,"compute meso_rho/atom command requires atom_style with density (e.g. meso)");
 
   peratom_flag = 1;
   size_peratom_cols = 0;
@@ -54,7 +54,7 @@ void ComputeMesoRhoAtom::init()
   for (int i = 0; i < modify->ncompute; i++)
     if (strcmp(modify->compute[i]->style,"rhoVector/atom") == 0) count++;
   if (count > 1 && comm->me == 0)
-    error->warning("More than one compute rhoVector/atom");
+    error->warning(FLERR,"More than one compute rhoVector/atom");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/USER-SPH/compute_meso_t_atom.cpp b/src/USER-SPH/compute_meso_t_atom.cpp
index 21a9a4d6605bb32b5d94b39ca6efd31c33a5deb5..5d4f1177bad747d41428f15c9175c507ad0f3028 100644
--- a/src/USER-SPH/compute_meso_t_atom.cpp
+++ b/src/USER-SPH/compute_meso_t_atom.cpp
@@ -28,9 +28,9 @@ using namespace LAMMPS_NS;
 ComputeMesoTAtom::ComputeMesoTAtom(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Number of arguments for compute meso_t/atom command != 3");
+  if (narg != 3) error->all(FLERR,"Number of arguments for compute meso_t/atom command != 3");
   if ((atom->e_flag != 1) || (atom->cv_flag != 1))
-  	error->all("compute meso_e/atom command requires atom_style with both energy and heat capacity (e.g. meso)");
+  	error->all(FLERR,"compute meso_e/atom command requires atom_style with both energy and heat capacity (e.g. meso)");
 
   peratom_flag = 1;
   size_peratom_cols = 0;
@@ -55,7 +55,7 @@ void ComputeMesoTAtom::init()
   for (int i = 0; i < modify->ncompute; i++)
     if (strcmp(modify->compute[i]->style,"meso_t/atom") == 0) count++;
   if (count > 1 && comm->me == 0)
-    error->warning("More than one compute meso_t/atom");
+    error->warning(FLERR,"More than one compute meso_t/atom");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/USER-SPH/fix_meso.cpp b/src/USER-SPH/fix_meso.cpp
index 0b8576f386b44701595a6fac43146e4ed6215b58..cfab98164e832df2870f21c3fb99d394384e0e99 100644
--- a/src/USER-SPH/fix_meso.cpp
+++ b/src/USER-SPH/fix_meso.cpp
@@ -38,11 +38,11 @@ FixMeso::FixMeso(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg) {
 
   if ((atom->e_flag != 1) || (atom->rho_flag != 1))
-    error->all(
+    error->all(FLERR,
         "fix meso command requires atom_style with both energy and density");
 
   if (narg != 3)
-    error->all("Illegal number of arguments for fix meso command");
+    error->all(FLERR,"Illegal number of arguments for fix meso command");
 
   time_integrate = 1;
 }
diff --git a/src/USER-SPH/fix_meso_stationary.cpp b/src/USER-SPH/fix_meso_stationary.cpp
index 9a08d28fd9ca66afbd3fe4418ec49abe9bb28626..793e8dd2175ebce36a86d2026bae379e570ccf96 100644
--- a/src/USER-SPH/fix_meso_stationary.cpp
+++ b/src/USER-SPH/fix_meso_stationary.cpp
@@ -38,11 +38,11 @@ FixMesoStationary::FixMesoStationary(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg) {
 
   if ((atom->e_flag != 1) || (atom->rho_flag != 1))
-    error->all(
+    error->all(FLERR,
         "fix meso/stationary command requires atom_style with both energy and density, e.g. meso");
 
   if (narg != 3)
-    error->all("Illegal number of arguments for fix meso/stationary command");
+    error->all(FLERR,"Illegal number of arguments for fix meso/stationary command");
 
   time_integrate = 0;
 }
diff --git a/src/USER-SPH/pair_sph_heatconduction.cpp b/src/USER-SPH/pair_sph_heatconduction.cpp
index e4af6f766311c95f91b70b29b7c006be97d71b30..2eacb71cf2c834d134c96a79c101f8d7a0dae0b7 100644
--- a/src/USER-SPH/pair_sph_heatconduction.cpp
+++ b/src/USER-SPH/pair_sph_heatconduction.cpp
@@ -24,9 +24,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairSPHHeatConduction::PairSPHHeatConduction(LAMMPS *lmp) :
@@ -159,7 +156,7 @@ void PairSPHHeatConduction::allocate() {
 
 void PairSPHHeatConduction::settings(int narg, char **arg) {
   if (narg != 0)
-    error->all(
+    error->all(FLERR,
         "Illegal number of setting arguments for pair_style sph/heatconduction");
 }
 
@@ -169,7 +166,7 @@ void PairSPHHeatConduction::settings(int narg, char **arg) {
 
 void PairSPHHeatConduction::coeff(int narg, char **arg) {
   if (narg != 4)
-    error->all("Incorrect number of args for pair_style sph/heatconduction coefficients");
+    error->all(FLERR,"Incorrect number of args for pair_style sph/heatconduction coefficients");
   if (!allocated)
     allocate();
 
@@ -192,7 +189,7 @@ void PairSPHHeatConduction::coeff(int narg, char **arg) {
   }
 
   if (count == 0)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -202,7 +199,7 @@ void PairSPHHeatConduction::coeff(int narg, char **arg) {
 double PairSPHHeatConduction::init_one(int i, int j) {
 
   if (setflag[i][j] == 0) {
-    error->all("All pair sph/heatconduction coeffs are not set");
+    error->all(FLERR,"All pair sph/heatconduction coeffs are not set");
   }
 
   cut[j][i] = cut[i][j];
diff --git a/src/USER-SPH/pair_sph_idealgas.cpp b/src/USER-SPH/pair_sph_idealgas.cpp
index 35baf218cb562b34e934aafdac6a5becaa56fce1..a477ed0602a9e75804ac0f1bc5d7ade853e08da3 100644
--- a/src/USER-SPH/pair_sph_idealgas.cpp
+++ b/src/USER-SPH/pair_sph_idealgas.cpp
@@ -24,9 +24,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairSPHIdealGas::PairSPHIdealGas(LAMMPS *lmp) :
@@ -201,7 +198,7 @@ void PairSPHIdealGas::allocate() {
 
 void PairSPHIdealGas::settings(int narg, char **arg) {
   if (narg != 0)
-    error->all(
+    error->all(FLERR,
         "Illegal number of setting arguments for pair_style sph/idealgas");
 }
 
@@ -211,7 +208,7 @@ void PairSPHIdealGas::settings(int narg, char **arg) {
 
 void PairSPHIdealGas::coeff(int narg, char **arg) {
   if (narg != 4)
-    error->all("Incorrect number of args for pair_style sph/idealgas coefficients");
+    error->all(FLERR,"Incorrect number of args for pair_style sph/idealgas coefficients");
   if (!allocated)
     allocate();
 
@@ -234,7 +231,7 @@ void PairSPHIdealGas::coeff(int narg, char **arg) {
   }
 
   if (count == 0)
-    error->all("Incorrect args for pair sph/idealgas coefficients");
+    error->all(FLERR,"Incorrect args for pair sph/idealgas coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -244,7 +241,7 @@ void PairSPHIdealGas::coeff(int narg, char **arg) {
 double PairSPHIdealGas::init_one(int i, int j) {
 
   if (setflag[i][j] == 0) {
-      error->all("All pair sph/idealgas coeffs are not set");
+      error->all(FLERR,"All pair sph/idealgas coeffs are not set");
   }
 
   cut[j][i] = cut[i][j];
diff --git a/src/USER-SPH/pair_sph_lj.cpp b/src/USER-SPH/pair_sph_lj.cpp
index fd92cddc8fb5e9463467e954ff0803a85c998f79..4d73ef03f81db9bbaf4e67aa6a73c67bd44ffdf6 100644
--- a/src/USER-SPH/pair_sph_lj.cpp
+++ b/src/USER-SPH/pair_sph_lj.cpp
@@ -24,9 +24,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairSPHLJ::PairSPHLJ(LAMMPS *lmp) :
@@ -208,7 +205,7 @@ void PairSPHLJ::allocate() {
 
 void PairSPHLJ::settings(int narg, char **arg) {
   if (narg != 0)
-    error->all(
+    error->all(FLERR,
         "Illegal number of setting arguments for pair_style sph/lj");
 }
 
@@ -218,7 +215,7 @@ void PairSPHLJ::settings(int narg, char **arg) {
 
 void PairSPHLJ::coeff(int narg, char **arg) {
   if (narg != 4)
-    error->all(
+    error->all(FLERR,
         "Incorrect args for pair_style sph/lj coefficients");
   if (!allocated)
     allocate();
@@ -242,7 +239,7 @@ void PairSPHLJ::coeff(int narg, char **arg) {
   }
 
   if (count == 0)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -252,7 +249,7 @@ void PairSPHLJ::coeff(int narg, char **arg) {
 double PairSPHLJ::init_one(int i, int j) {
 
   if (setflag[i][j] == 0) {
-    error->all("All pair sph/lj coeffs are not set");
+    error->all(FLERR,"All pair sph/lj coeffs are not set");
   }
 
   cut[j][i] = cut[i][j];
diff --git a/src/USER-SPH/pair_sph_rhosum.cpp b/src/USER-SPH/pair_sph_rhosum.cpp
index b846b1bb499d2fc0580191c63fdea78ff4156ff1..f022e6dc40c0bc94b28a0e7359cc790a588d52bc 100644
--- a/src/USER-SPH/pair_sph_rhosum.cpp
+++ b/src/USER-SPH/pair_sph_rhosum.cpp
@@ -27,9 +27,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairSPHRhoSum::PairSPHRhoSum(LAMMPS *lmp) :
@@ -229,7 +226,7 @@ void PairSPHRhoSum::allocate() {
 
 void PairSPHRhoSum::settings(int narg, char **arg) {
   if (narg != 1)
-    error->all(
+    error->all(FLERR,
         "Illegal number of setting arguments for pair_style sph/rhosum");
   nstep = force->inumeric(arg[0]);
 }
@@ -240,7 +237,7 @@ void PairSPHRhoSum::settings(int narg, char **arg) {
 
 void PairSPHRhoSum::coeff(int narg, char **arg) {
   if (narg != 3)
-    error->all("Incorrect number of args for sph/rhosum coefficients");
+    error->all(FLERR,"Incorrect number of args for sph/rhosum coefficients");
   if (!allocated)
     allocate();
 
@@ -261,7 +258,7 @@ void PairSPHRhoSum::coeff(int narg, char **arg) {
   }
 
   if (count == 0)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -270,7 +267,7 @@ void PairSPHRhoSum::coeff(int narg, char **arg) {
 
 double PairSPHRhoSum::init_one(int i, int j) {
   if (setflag[i][j] == 0) {
-    error->all("All pair sph/rhosum coeffs are not set");
+    error->all(FLERR,"All pair sph/rhosum coeffs are not set");
   }
 
   cut[j][i] = cut[i][j];
diff --git a/src/USER-SPH/pair_sph_taitwater.cpp b/src/USER-SPH/pair_sph_taitwater.cpp
index 0226d8fed49a16049991782d705a3ea29dcc1444..86723dd4c89ba0be2281ff5843382b203d471bd4 100644
--- a/src/USER-SPH/pair_sph_taitwater.cpp
+++ b/src/USER-SPH/pair_sph_taitwater.cpp
@@ -24,9 +24,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairSPHTaitwater::PairSPHTaitwater(LAMMPS *lmp) :
@@ -229,7 +226,7 @@ void PairSPHTaitwater::allocate() {
 
 void PairSPHTaitwater::settings(int narg, char **arg) {
   if (narg != 0)
-    error->all(
+    error->all(FLERR,
         "Illegal number of setting arguments for pair_style sph/taitwater");
 }
 
@@ -239,7 +236,7 @@ void PairSPHTaitwater::settings(int narg, char **arg) {
 
 void PairSPHTaitwater::coeff(int narg, char **arg) {
   if (narg != 6)
-    error->all(
+    error->all(FLERR,
         "Incorrect args for pair_style sph/taitwater coefficients");
   if (!allocated)
     allocate();
@@ -274,7 +271,7 @@ void PairSPHTaitwater::coeff(int narg, char **arg) {
   }
 
   if (count == 0)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -284,7 +281,7 @@ void PairSPHTaitwater::coeff(int narg, char **arg) {
 double PairSPHTaitwater::init_one(int i, int j) {
 
   if (setflag[i][j] == 0) {
-    error->all("Not all pair sph/taitwater coeffs are set");
+    error->all(FLERR,"Not all pair sph/taitwater coeffs are set");
   }
 
   cut[j][i] = cut[i][j];
diff --git a/src/USER-SPH/pair_sph_taitwater_morris.cpp b/src/USER-SPH/pair_sph_taitwater_morris.cpp
index 5e5eb1d098e877aee374758d41bc2c98e65f2f5b..d1092cf6e1ab576de54129788dffef6e617d064f 100644
--- a/src/USER-SPH/pair_sph_taitwater_morris.cpp
+++ b/src/USER-SPH/pair_sph_taitwater_morris.cpp
@@ -24,9 +24,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairSPHTaitwaterMorris::PairSPHTaitwaterMorris(LAMMPS *lmp) :
@@ -230,7 +227,7 @@ void PairSPHTaitwaterMorris::allocate() {
 
 void PairSPHTaitwaterMorris::settings(int narg, char **arg) {
   if (narg != 0)
-    error->all(
+    error->all(FLERR,
         "Illegal number of setting arguments for pair_style sph/taitwater/morris");
 }
 
@@ -240,7 +237,7 @@ void PairSPHTaitwaterMorris::settings(int narg, char **arg) {
 
 void PairSPHTaitwaterMorris::coeff(int narg, char **arg) {
   if (narg != 6)
-    error->all(
+    error->all(FLERR,
         "Incorrect args for pair_style sph/taitwater/morris coefficients");
   if (!allocated)
     allocate();
@@ -271,7 +268,7 @@ void PairSPHTaitwaterMorris::coeff(int narg, char **arg) {
   }
 
   if (count == 0)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -281,7 +278,7 @@ void PairSPHTaitwaterMorris::coeff(int narg, char **arg) {
 double PairSPHTaitwaterMorris::init_one(int i, int j) {
 
   if (setflag[i][j] == 0) {
-    error->all("Not all pair sph/taitwater/morris coeffs are not set");
+    error->all(FLERR,"Not all pair sph/taitwater/morris coeffs are not set");
   }
 
   cut[j][i] = cut[i][j];
diff --git a/src/XTC/dump_xtc.cpp b/src/XTC/dump_xtc.cpp
index f5355cdf5fa08a820758a9a29bf68c00ee7fb0fa..12d3719dad5880809846ce35792588e8650344e8 100644
--- a/src/XTC/dump_xtc.cpp
+++ b/src/XTC/dump_xtc.cpp
@@ -54,9 +54,9 @@ int xdr3dfcoord(XDR *, float *, int *, float *);
 
 DumpXTC::DumpXTC(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg)
 {
-  if (narg != 5) error->all("Illegal dump xtc command");
+  if (narg != 5) error->all(FLERR,"Illegal dump xtc command");
   if (binary || compressed || multifile || multiproc)
-    error->all("Invalid dump xtc filename");
+    error->all(FLERR,"Invalid dump xtc filename");
 
   size_one = 3;
   sort_flag = 1;
@@ -70,7 +70,7 @@ DumpXTC::DumpXTC(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg)
 
   bigint n = group->count(igroup);
   if (n > MAXSMALLINT/3/sizeof(float)) 
-    error->all("Too many atoms for dump xtc");
+    error->all(FLERR,"Too many atoms for dump xtc");
   natoms = static_cast<int> (n);
 
   memory->create(coords,3*natoms,"dump:coords");
@@ -103,11 +103,11 @@ DumpXTC::~DumpXTC()
 void DumpXTC::init_style()
 {
   if (sort_flag == 0 || sortcol != 0)
-    error->all("Dump xtc requires sorting by atom ID");
+    error->all(FLERR,"Dump xtc requires sorting by atom ID");
 
   // check that flush_flag is not set since dump::write() will use it
 
-  if (flush_flag) error->all("Cannot set dump_modify flush for dump xtc");
+  if (flush_flag) error->all(FLERR,"Cannot set dump_modify flush for dump xtc");
 
   // check that dump frequency has not changed and is not a variable
 
@@ -115,11 +115,11 @@ void DumpXTC::init_style()
   for (idump = 0; idump < output->ndump; idump++)
     if (strcmp(id,output->dump[idump]->id) == 0) break;
   if (output->every_dump[idump] == 0)
-    error->all("Cannot use variable every setting for dump xtc");
+    error->all(FLERR,"Cannot use variable every setting for dump xtc");
 
   if (nevery_save == 0) nevery_save = output->every_dump[idump];
   else if (nevery_save != output->every_dump[idump])
-    error->all("Cannot change dump_modify every for dump xtc");
+    error->all(FLERR,"Cannot change dump_modify every for dump xtc");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -131,17 +131,17 @@ void DumpXTC::openfile()
 
   fp = NULL;
   if (me == 0)
-    if (xdropen(&xd,filename,"w") == 0) error->one("Cannot open dump file");
+    if (xdropen(&xd,filename,"w") == 0) error->one(FLERR,"Cannot open dump file");
 }
 
 /* ---------------------------------------------------------------------- */
 
 void DumpXTC::write_header(bigint nbig)
 {
-  if (nbig > MAXSMALLINT) error->all("Too many atoms for dump xtc");
+  if (nbig > MAXSMALLINT) error->all(FLERR,"Too many atoms for dump xtc");
   int n = nbig;
   if (update->ntimestep > MAXSMALLINT)
-    error->all("Too big a timestep for dump xtc");
+    error->all(FLERR,"Too big a timestep for dump xtc");
   int ntimestep = update->ntimestep;
 
   // all procs realloc coords if total count grew
@@ -281,19 +281,19 @@ void DumpXTC::write_data(int n, double *mybuf)
 int DumpXTC::modify_param(int narg, char **arg)
 {
   if (strcmp(arg[0],"unwrap") == 0) {
-    if (narg < 2) error->all("Illegal dump_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
     if (strcmp(arg[1],"yes") == 0) unwrap_flag = 1;
     else if (strcmp(arg[1],"no") == 0) unwrap_flag = 0;
-    else error->all("Illegal dump_modify command");
+    else error->all(FLERR,"Illegal dump_modify command");
     return 2;
   } else if (strcmp(arg[0],"precision") == 0) {
-    if (narg < 2) error->all("Illegal dump_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
     precision = atof(arg[1]);
     if ((fabs(precision-10.0) > EPS) && (fabs(precision-100.0) > EPS) && 
 	(fabs(precision-1000.0) > EPS) && (fabs(precision-10000.0) > EPS) && 
 	(fabs(precision-100000.0) > EPS) && 
 	(fabs(precision-1000000.0) > EPS)) 
-      error->all("Illegal dump_modify command");
+      error->all(FLERR,"Illegal dump_modify command");
     return 2;
   }
   return 0;
diff --git a/src/angle.cpp b/src/angle.cpp
index 0073044d3cae12d120acddb0e4f2883b670e2bc3..fbed9116a9c3e6d5b161186278e99ab0cb26abac 100644
--- a/src/angle.cpp
+++ b/src/angle.cpp
@@ -49,9 +49,9 @@ Angle::~Angle()
 
 void Angle::init()
 {
-  if (!allocated) error->all("Angle coeffs are not set");
+  if (!allocated) error->all(FLERR,"Angle coeffs are not set");
   for (int i = 1; i <= atom->nangletypes; i++)
-    if (setflag[i] == 0) error->all("All angle coeffs are not set");
+    if (setflag[i] == 0) error->all(FLERR,"All angle coeffs are not set");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/atom.cpp b/src/atom.cpp
index a0f65365e6bd513f7951225a5d1c13efd38e9dfe..f42b1250f1c3219d7976284d7fb458ef26ee67f1 100644
--- a/src/atom.cpp
+++ b/src/atom.cpp
@@ -42,9 +42,6 @@ using namespace LAMMPS_NS;
 #define EPSILON 1.0e-6
 #define CUDA_CHUNK 3000
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 Atom::Atom(LAMMPS *lmp) : Pointers(lmp)
@@ -322,7 +319,7 @@ AtomVec *Atom::new_avec(const char *style, int narg, char **arg,
 #include "style_atom.h"
 #undef ATOM_CLASS
 
-  else error->all("Invalid atom style");
+  else error->all(FLERR,"Invalid atom style");
 
   return NULL;
 }
@@ -348,7 +345,7 @@ void Atom::init()
   if (firstgroupname) {
     firstgroup = group->find(firstgroupname);
     if (firstgroup < 0)
-      error->all("Could not find atom_modify first group ID");
+      error->all(FLERR,"Could not find atom_modify first group ID");
   } else firstgroup = -1;
 
   // init AtomVec
@@ -391,20 +388,20 @@ AtomVec *Atom::style_match(const char *style)
 
 void Atom::modify_params(int narg, char **arg)
 {
-  if (narg == 0) error->all("Illegal atom_modify command");
+  if (narg == 0) error->all(FLERR,"Illegal atom_modify command");
 
   int iarg = 0;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"map") == 0) {
-      if (iarg+2 > narg) error->all("Illegal atom_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal atom_modify command");
       if (strcmp(arg[iarg+1],"array") == 0) map_style = 1;
       else if (strcmp(arg[iarg+1],"hash") == 0) map_style = 2;
-      else error->all("Illegal atom_modify command");
+      else error->all(FLERR,"Illegal atom_modify command");
       if (domain->box_exist) 
-	error->all("Atom_modify map command after simulation box is defined");
+	error->all(FLERR,"Atom_modify map command after simulation box is defined");
       iarg += 2;
     } else if (strcmp(arg[iarg],"first") == 0) {
-      if (iarg+2 > narg) error->all("Illegal atom_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal atom_modify command");
       if (strcmp(arg[iarg+1],"all") == 0) {
 	delete [] firstgroupname;
 	firstgroupname = NULL;
@@ -416,16 +413,16 @@ void Atom::modify_params(int narg, char **arg)
       }
       iarg += 2;
     } else if (strcmp(arg[iarg],"sort") == 0) {
-      if (iarg+3 > narg) error->all("Illegal atom_modify command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal atom_modify command");
       sortfreq = atoi(arg[iarg+1]);
       userbinsize = atof(arg[iarg+2]);
       if (sortfreq < 0 || userbinsize < 0.0)
-	error->all("Illegal atom_modify command");
+	error->all(FLERR,"Illegal atom_modify command");
       if (sortfreq >= 0 && firstgroupname) 
-	error->all("Atom_modify sort and first options "
+	error->all(FLERR,"Atom_modify sort and first options "
 		   "cannot be used together");
       iarg += 3;
-    } else error->all("Illegal atom_modify command");
+    } else error->all(FLERR,"Illegal atom_modify command");
   }
 }
 
@@ -446,7 +443,7 @@ void Atom::map_init()
   map_delete();
 
   if (tag_enable == 0)
-    error->all("Cannot create an atom map unless atoms have IDs");
+    error->all(FLERR,"Cannot create an atom map unless atoms have IDs");
 
   int max = 0;
   for (int i = 0; i < nlocal; i++) max = MAX(max,tag[i]);
@@ -764,7 +761,7 @@ void Atom::data_atoms(int n, char *buf)
   *next = '\n';
 
   if (nwords != avec->size_data_atom && nwords != avec->size_data_atom + 3)
-    error->all("Incorrect atom format in data file");
+    error->all(FLERR,"Incorrect atom format in data file");
 
   char **values = new char*[nwords];
 
@@ -814,10 +811,10 @@ void Atom::data_atoms(int n, char *buf)
     next = strchr(buf,'\n');
 
     values[0] = strtok(buf," \t\n\r\f");
-    if (values[0] == NULL) error->all("Incorrect atom format in data file");
+    if (values[0] == NULL) error->all(FLERR,"Incorrect atom format in data file");
     for (m = 1; m < nwords; m++) {
       values[m] = strtok(NULL," \t\n\r\f");
-      if (values[m] == NULL) error->all("Incorrect atom format in data file");
+      if (values[m] == NULL) error->all(FLERR,"Incorrect atom format in data file");
     }
 
     if (imageflag)
@@ -863,7 +860,7 @@ void Atom::data_vels(int n, char *buf)
   *next = '\n';
 
   if (nwords != avec->size_data_vel)
-    error->all("Incorrect velocity format in data file");
+    error->all(FLERR,"Incorrect velocity format in data file");
 
   char **values = new char*[nwords];
 
@@ -880,7 +877,7 @@ void Atom::data_vels(int n, char *buf)
 
     tagdata = atoi(values[0]);
     if (tagdata <= 0 || tagdata > map_tag_max)
-      error->one("Invalid atom ID in Velocities section of data file");
+      error->one(FLERR,"Invalid atom ID in Velocities section of data file");
     if ((m = map(tagdata)) >= 0) avec->data_vel(m,&values[1]);
 
     buf = next + 1;
@@ -906,7 +903,7 @@ void Atom::data_bonus(int n, char *buf, AtomVec *avec_bonus)
   *next = '\n';
 
   if (nwords != avec_bonus->size_data_bonus)
-    error->all("Incorrect bonus data format in data file");
+    error->all(FLERR,"Incorrect bonus data format in data file");
 
   char **values = new char*[nwords];
 
@@ -923,7 +920,7 @@ void Atom::data_bonus(int n, char *buf, AtomVec *avec_bonus)
 
     tagdata = atoi(values[0]);
     if (tagdata <= 0 || tagdata > map_tag_max)
-      error->one("Invalid atom ID in Bonus section of data file");
+      error->one(FLERR,"Invalid atom ID in Bonus section of data file");
 
     // ok to call child's data_atom_bonus() method thru parent avec_bonus,
     // since data_bonus() was called with child ptr, and method is virtual
@@ -952,9 +949,9 @@ void Atom::data_bonds(int n, char *buf)
     sscanf(buf,"%d %d %d %d",&tmp,&itype,&atom1,&atom2);
     if (atom1 <= 0 || atom1 > map_tag_max || 
 	atom2 <= 0 || atom2 > map_tag_max)
-      error->one("Invalid atom ID in Bonds section of data file");
+      error->one(FLERR,"Invalid atom ID in Bonds section of data file");
     if (itype <= 0 || itype > nbondtypes)
-      error->one("Invalid bond type in Bonds section of data file");
+      error->one(FLERR,"Invalid bond type in Bonds section of data file");
     if ((m = map(atom1)) >= 0) {
       bond_type[m][num_bond[m]] = itype;
       bond_atom[m][num_bond[m]] = atom2;
@@ -988,9 +985,9 @@ void Atom::data_angles(int n, char *buf)
     if (atom1 <= 0 || atom1 > map_tag_max || 
 	atom2 <= 0 || atom2 > map_tag_max || 
 	atom3 <= 0 || atom3 > map_tag_max)
-      error->one("Invalid atom ID in Angles section of data file");
+      error->one(FLERR,"Invalid atom ID in Angles section of data file");
     if (itype <= 0 || itype > nangletypes)
-      error->one("Invalid angle type in Angles section of data file");
+      error->one(FLERR,"Invalid angle type in Angles section of data file");
     if ((m = map(atom2)) >= 0) {
       angle_type[m][num_angle[m]] = itype;
       angle_atom1[m][num_angle[m]] = atom1;
@@ -1036,9 +1033,9 @@ void Atom::data_dihedrals(int n, char *buf)
 	atom2 <= 0 || atom2 > map_tag_max || 
 	atom3 <= 0 || atom3 > map_tag_max || 
 	atom4 <= 0 || atom4 > map_tag_max)
-      error->one("Invalid atom ID in Dihedrals section of data file");
+      error->one(FLERR,"Invalid atom ID in Dihedrals section of data file");
     if (itype <= 0 || itype > ndihedraltypes)
-      error->one("Invalid dihedral type in Dihedrals section of data file");
+      error->one(FLERR,"Invalid dihedral type in Dihedrals section of data file");
     if ((m = map(atom2)) >= 0) {
       dihedral_type[m][num_dihedral[m]] = itype;
       dihedral_atom1[m][num_dihedral[m]] = atom1;
@@ -1095,9 +1092,9 @@ void Atom::data_impropers(int n, char *buf)
 	atom2 <= 0 || atom2 > map_tag_max || 
 	atom3 <= 0 || atom3 > map_tag_max || 
 	atom4 <= 0 || atom4 > map_tag_max)
-      error->one("Invalid atom ID in Impropers section of data file");
+      error->one(FLERR,"Invalid atom ID in Impropers section of data file");
     if (itype <= 0 || itype > nimpropertypes)
-      error->one("Invalid improper type in Impropers section of data file");
+      error->one(FLERR,"Invalid improper type in Impropers section of data file");
     if ((m = map(atom2)) >= 0) {
       improper_type[m][num_improper[m]] = itype;
       improper_atom1[m][num_improper[m]] = atom1;
@@ -1157,19 +1154,19 @@ void Atom::allocate_type_arrays()
 
 void Atom::set_mass(const char *str)
 {
-  if (mass == NULL) error->all("Cannot set mass for this atom style");
+  if (mass == NULL) error->all(FLERR,"Cannot set mass for this atom style");
 
   int itype;
   double mass_one;
   int n = sscanf(str,"%d %lg",&itype,&mass_one);
-  if (n != 2) error->all("Invalid mass line in data file");
+  if (n != 2) error->all(FLERR,"Invalid mass line in data file");
 
-  if (itype < 1 || itype > ntypes) error->all("Invalid type for mass set");
+  if (itype < 1 || itype > ntypes) error->all(FLERR,"Invalid type for mass set");
 
   mass[itype] = mass_one;
   mass_setflag[itype] = 1;
 
-  if (mass[itype] <= 0.0) error->all("Invalid mass value");
+  if (mass[itype] <= 0.0) error->all(FLERR,"Invalid mass value");
 }
 
 /* ----------------------------------------------------------------------
@@ -1179,13 +1176,13 @@ void Atom::set_mass(const char *str)
 
 void Atom::set_mass(int itype, double value)
 {
-  if (mass == NULL) error->all("Cannot set mass for this atom style");
-  if (itype < 1 || itype > ntypes) error->all("Invalid type for mass set");
+  if (mass == NULL) error->all(FLERR,"Cannot set mass for this atom style");
+  if (itype < 1 || itype > ntypes) error->all(FLERR,"Invalid type for mass set");
 
   mass[itype] = value;
   mass_setflag[itype] = 1;
 
-  if (mass[itype] <= 0.0) error->all("Invalid mass value");
+  if (mass[itype] <= 0.0) error->all(FLERR,"Invalid mass value");
 }
 
 /* ----------------------------------------------------------------------
@@ -1195,17 +1192,17 @@ void Atom::set_mass(int itype, double value)
 
 void Atom::set_mass(int narg, char **arg)
 {
-  if (mass == NULL) error->all("Cannot set mass for this atom style");
+  if (mass == NULL) error->all(FLERR,"Cannot set mass for this atom style");
 
   int lo,hi;
   force->bounds(arg[0],ntypes,lo,hi);
-  if (lo < 1 || hi > ntypes) error->all("Invalid type for mass set");
+  if (lo < 1 || hi > ntypes) error->all(FLERR,"Invalid type for mass set");
 
   for (int itype = lo; itype <= hi; itype++) {
     mass[itype] = atof(arg[1]);
     mass_setflag[itype] = 1;
 
-    if (mass[itype] <= 0.0) error->all("Invalid mass value");
+    if (mass[itype] <= 0.0) error->all(FLERR,"Invalid mass value");
   }
 }
 
@@ -1229,7 +1226,7 @@ void Atom::check_mass()
 {
   if (mass == NULL) return;
   for (int itype = 1; itype <= ntypes; itype++)
-    if (mass_setflag[itype] == 0) error->all("All masses are not set");
+    if (mass_setflag[itype] == 0) error->all(FLERR,"All masses are not set");
 }
 
 /* ----------------------------------------------------------------------
@@ -1433,7 +1430,7 @@ void Atom::sort()
   //  if (current[i] != permute[i]) flag = 1;
   //int flagall;
   //MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
-  //if (flagall) error->all("Atom sort did not operate correctly");
+  //if (flagall) error->all(FLERR,"Atom sort did not operate correctly");
 }
 
 /* ----------------------------------------------------------------------
@@ -1463,7 +1460,7 @@ void Atom::setup_sort_bins()
       binsize = pow(1.0*CUDA_CHUNK/natoms*area,1.0/2.0);
     }
   }
-  if (binsize == 0.0) error->all("Atom sorting has bin size = 0.0");
+  if (binsize == 0.0) error->all(FLERR,"Atom sorting has bin size = 0.0");
 
   double bininv = 1.0/binsize;
 
@@ -1495,7 +1492,7 @@ void Atom::setup_sort_bins()
   bininvz = nbinz / (bboxhi[2]-bboxlo[2]);
 
   if (1.0*nbinx*nbiny*nbinz > INT_MAX) 
-    error->one("Too many atom sorting bins");
+    error->one(FLERR,"Too many atom sorting bins");
 
   nbins = nbinx*nbiny*nbinz;
 
diff --git a/src/atom_vec_atomic.cpp b/src/atom_vec_atomic.cpp
index a0bf79a1275b2fa7e69307d10701342af8113f56..e4e2dcf5eebc8f952e3e7825510f79b6c34e4b78 100644
--- a/src/atom_vec_atomic.cpp
+++ b/src/atom_vec_atomic.cpp
@@ -56,7 +56,7 @@ void AtomVecAtomic::grow(int n)
   else nmax = n;
   atom->nmax = nmax;
   if (nmax < 0 || nmax > MAXSMALLINT)
-    error->one("Per-processor system is too big");
+    error->one(FLERR,"Per-processor system is too big");
 
   tag = memory->grow(atom->tag,nmax,"atom:tag");
   type = memory->grow(atom->type,nmax,"atom:type");
@@ -596,11 +596,11 @@ void AtomVecAtomic::data_atom(double *coord, int imagetmp, char **values)
 
   tag[nlocal] = atoi(values[0]);
   if (tag[nlocal] <= 0)
-    error->one("Invalid atom ID in Atoms section of data file");
+    error->one(FLERR,"Invalid atom ID in Atoms section of data file");
 
   type[nlocal] = atoi(values[1]);
   if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
-    error->one("Invalid atom type in Atoms section of data file");
+    error->one(FLERR,"Invalid atom type in Atoms section of data file");
 
   x[nlocal][0] = coord[0];
   x[nlocal][1] = coord[1];
diff --git a/src/atom_vec_charge.cpp b/src/atom_vec_charge.cpp
index 5def3bd99fadd57a940ee94ca40f23d5e1992ab3..81fc7a8ef855c6296175a1e97e058b8a58be2541 100644
--- a/src/atom_vec_charge.cpp
+++ b/src/atom_vec_charge.cpp
@@ -58,7 +58,7 @@ void AtomVecCharge::grow(int n)
   else nmax = n;
   atom->nmax = nmax;
   if (nmax < 0 || nmax > MAXSMALLINT)
-    error->one("Per-processor system is too big");
+    error->one(FLERR,"Per-processor system is too big");
 
   tag = memory->grow(atom->tag,nmax,"atom:tag");
   type = memory->grow(atom->type,nmax,"atom:type");
@@ -647,11 +647,11 @@ void AtomVecCharge::data_atom(double *coord, int imagetmp, char **values)
 
   tag[nlocal] = atoi(values[0]);
   if (tag[nlocal] <= 0)
-    error->one("Invalid atom ID in Atoms section of data file");
+    error->one(FLERR,"Invalid atom ID in Atoms section of data file");
 
   type[nlocal] = atoi(values[1]);
   if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
-    error->one("Invalid atom type in Atoms section of data file");
+    error->one(FLERR,"Invalid atom type in Atoms section of data file");
 
   q[nlocal] = atof(values[2]);
 
diff --git a/src/atom_vec_ellipsoid.cpp b/src/atom_vec_ellipsoid.cpp
index 2ccb91a6ca360054f72fb4f1980628deb5b73dcd..d0cf4ce1124f26c6ffa27f99eaf5b2528533e219 100755
--- a/src/atom_vec_ellipsoid.cpp
+++ b/src/atom_vec_ellipsoid.cpp
@@ -78,7 +78,7 @@ void AtomVecEllipsoid::grow(int n)
   else nmax = n;
   atom->nmax = nmax;
   if (nmax < 0 || nmax > MAXSMALLINT)
-    error->one("Per-processor system is too big");
+    error->one(FLERR,"Per-processor system is too big");
 
   tag = memory->grow(atom->tag,nmax,"atom:tag");
   type = memory->grow(atom->type,nmax,"atom:type");
@@ -118,7 +118,7 @@ void AtomVecEllipsoid::grow_bonus()
 {
   nmax_bonus += DELTA_BONUS;
   if (nmax_bonus < 0 || nmax_bonus > MAXSMALLINT)
-    error->one("Per-processor system is too big");
+    error->one(FLERR,"Per-processor system is too big");
 
   bonus = (Bonus *) memory->srealloc(bonus,nmax_bonus*sizeof(Bonus),
 				     "atom:bonus");
@@ -1121,20 +1121,20 @@ void AtomVecEllipsoid::data_atom(double *coord, int imagetmp, char **values)
 
   tag[nlocal] = atoi(values[0]);
   if (tag[nlocal] <= 0)
-    error->one("Invalid atom ID in Atoms section of data file");
+    error->one(FLERR,"Invalid atom ID in Atoms section of data file");
 
   type[nlocal] = atoi(values[1]);
   if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
-    error->one("Invalid atom type in Atoms section of data file");
+    error->one(FLERR,"Invalid atom type in Atoms section of data file");
 
   ellipsoid[nlocal] = atoi(values[2]);
   if (ellipsoid[nlocal] == 0) ellipsoid[nlocal] = -1;
   else if (ellipsoid[nlocal] == 1) ellipsoid[nlocal] = 0;
-  else error->one("Invalid atom type in Atoms section of data file");
+  else error->one(FLERR,"Invalid atom type in Atoms section of data file");
 
   rmass[nlocal] = atof(values[3]);
   if (rmass[nlocal] <= 0.0)
-    error->one("Invalid density in Atoms section of data file");
+    error->one(FLERR,"Invalid density in Atoms section of data file");
 
   x[nlocal][0] = coord[0];
   x[nlocal][1] = coord[1];
@@ -1163,11 +1163,11 @@ int AtomVecEllipsoid::data_atom_hybrid(int nlocal, char **values)
   ellipsoid[nlocal] = atoi(values[0]);
   if (ellipsoid[nlocal] == 0) ellipsoid[nlocal] = -1;
   else if (ellipsoid[nlocal] == 1) ellipsoid[nlocal] = 0;
-  else error->one("Invalid atom type in Atoms section of data file");
+  else error->one(FLERR,"Invalid atom type in Atoms section of data file");
 
   rmass[nlocal] = atof(values[1]);
   if (rmass[nlocal] <= 0.0)
-    error->one("Invalid density in Atoms section of data file");
+    error->one(FLERR,"Invalid density in Atoms section of data file");
 
   return 2;
 }
@@ -1179,7 +1179,7 @@ int AtomVecEllipsoid::data_atom_hybrid(int nlocal, char **values)
 void AtomVecEllipsoid::data_atom_bonus(int m, char **values)
 {
   if (ellipsoid[m])
-    error->one("Assigning ellipsoid parameters to non-ellipsoid atom");
+    error->one(FLERR,"Assigning ellipsoid parameters to non-ellipsoid atom");
 
   if (nlocal_bonus == nmax_bonus) grow_bonus();
 
@@ -1188,7 +1188,7 @@ void AtomVecEllipsoid::data_atom_bonus(int m, char **values)
   shape[1] = 0.5 * atof(values[1]);
   shape[2] = 0.5 * atof(values[2]);
   if (shape[0] <= 0.0 || shape[1] <= 0.0 || shape[2] <= 0.0)
-    error->one("Invalid shape in Ellipsoids section of data file");
+    error->one(FLERR,"Invalid shape in Ellipsoids section of data file");
 
   double *quat = bonus[nlocal_bonus].quat;
   quat[0] = atof(values[3]);
diff --git a/src/atom_vec_hybrid.cpp b/src/atom_vec_hybrid.cpp
index 03c0c501ea9dd0aa93c321037068623e4cafe8e0..b6b1dabdea724cb3261c56206a74d7f10835cf6a 100644
--- a/src/atom_vec_hybrid.cpp
+++ b/src/atom_vec_hybrid.cpp
@@ -24,9 +24,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 #define DELTA 10000
 
 /* ---------------------------------------------------------------------- */
@@ -36,7 +33,7 @@ AtomVecHybrid::AtomVecHybrid(LAMMPS *lmp, int narg, char **arg) :
 {
   int i,k,dummy;
 
-  if (narg < 1) error->all("Illegal atom_style command");
+  if (narg < 1) error->all(FLERR,"Illegal atom_style command");
 
   // create sub-styles
 
@@ -47,9 +44,9 @@ AtomVecHybrid::AtomVecHybrid(LAMMPS *lmp, int narg, char **arg) :
   for (i = 0; i < narg; i++) {
     for (k = 0; k < i; k++)
       if (strcmp(arg[i],keywords[k]) == 0) 
-	error->all("Atom style hybrid cannot use same atom style twice");
+	error->all(FLERR,"Atom style hybrid cannot use same atom style twice");
     if (strcmp(arg[i],"hybrid") == 0) 
-      error->all("Atom style hybrid cannot have hybrid as an argument");
+      error->all(FLERR,"Atom style hybrid cannot have hybrid as an argument");
     styles[i] = atom->new_avec(arg[i],0,NULL,NULL,dummy);
     keywords[i] = new char[strlen(arg[i])+1];
     strcpy(keywords[i],arg[i]);
@@ -121,7 +118,7 @@ void AtomVecHybrid::grow(int n)
   else nmax = n;
   atom->nmax = nmax;
   if (nmax < 0 || nmax > MAXSMALLINT)
-    error->one("Per-processor system is too big");
+    error->one(FLERR,"Per-processor system is too big");
 
   // sub-styles perform all reallocation
   // turn off nextra_grow so hybrid can do that once below
@@ -814,11 +811,11 @@ void AtomVecHybrid::data_atom(double *coord, int imagetmp, char **values)
 
   tag[nlocal] = atoi(values[0]);
   if (tag[nlocal] <= 0)
-    error->one("Invalid atom ID in Atoms section of data file");
+    error->one(FLERR,"Invalid atom ID in Atoms section of data file");
 
   type[nlocal] = atoi(values[1]);
   if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
-    error->one("Invalid atom type in Atoms section of data file");
+    error->one(FLERR,"Invalid atom type in Atoms section of data file");
 
   x[nlocal][0] = coord[0];
   x[nlocal][1] = coord[1];
diff --git a/src/atom_vec_sphere.cpp b/src/atom_vec_sphere.cpp
index b17817412e088f7a537ee11fd7e3b220ffedfc75..babc914387d3901894b0d556992b9f13dfd2517a 100644
--- a/src/atom_vec_sphere.cpp
+++ b/src/atom_vec_sphere.cpp
@@ -89,7 +89,7 @@ void AtomVecSphere::grow(int n)
   else nmax = n;
   atom->nmax = nmax;
   if (nmax < 0 || nmax > MAXSMALLINT)
-    error->one("Per-processor system is too big");
+    error->one(FLERR,"Per-processor system is too big");
 
   tag = memory->grow(atom->tag,nmax,"atom:tag");
   type = memory->grow(atom->type,nmax,"atom:type");
@@ -949,19 +949,19 @@ void AtomVecSphere::data_atom(double *coord, int imagetmp, char **values)
 
   tag[nlocal] = atoi(values[0]);
   if (tag[nlocal] <= 0)
-    error->one("Invalid atom ID in Atoms section of data file");
+    error->one(FLERR,"Invalid atom ID in Atoms section of data file");
 
   type[nlocal] = atoi(values[1]);
   if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
-    error->one("Invalid atom type in Atoms section of data file");
+    error->one(FLERR,"Invalid atom type in Atoms section of data file");
 
   radius[nlocal] = 0.5 * atof(values[2]);
   if (radius[nlocal] < 0.0)
-    error->one("Invalid radius in Atoms section of data file");
+    error->one(FLERR,"Invalid radius in Atoms section of data file");
 
   double density = atof(values[3]);
   if (density <= 0.0)
-    error->one("Invalid density in Atoms section of data file");
+    error->one(FLERR,"Invalid density in Atoms section of data file");
 
   if (radius[nlocal] == 0.0) rmass[nlocal] = density;
   else 
@@ -994,11 +994,11 @@ int AtomVecSphere::data_atom_hybrid(int nlocal, char **values)
 {
   radius[nlocal] = 0.5 * atof(values[0]);
   if (radius[nlocal] < 0.0)
-    error->one("Invalid radius in Atoms section of data file");
+    error->one(FLERR,"Invalid radius in Atoms section of data file");
 
   double density = atof(values[1]);
   if (density <= 0.0)
-    error->one("Invalid density in Atoms section of data file");
+    error->one(FLERR,"Invalid density in Atoms section of data file");
 
   if (radius[nlocal] == 0.0) rmass[nlocal] = density;
   else 
diff --git a/src/bond.cpp b/src/bond.cpp
index b4365acf3643a083098a1e428b595ea36de026c0..92310df6532fc9ab6d12b2e7c1028a5ee3d3f311 100644
--- a/src/bond.cpp
+++ b/src/bond.cpp
@@ -50,9 +50,9 @@ Bond::~Bond()
 
 void Bond::init()
 {
-  if (!allocated) error->all("Bond coeffs are not set");
+  if (!allocated) error->all(FLERR,"Bond coeffs are not set");
   for (int i = 1; i <= atom->nbondtypes; i++)
-    if (setflag[i] == 0) error->all("All bond coeffs are not set");
+    if (setflag[i] == 0) error->all(FLERR,"All bond coeffs are not set");
   init_style();
 }
 
diff --git a/src/bond_hybrid.cpp b/src/bond_hybrid.cpp
index c06aa5647b12a2bac33e4b3fb1284ac27d6febe8..435685d5ecd19134a3f75de9aa2728b7bdc1619f 100644
--- a/src/bond_hybrid.cpp
+++ b/src/bond_hybrid.cpp
@@ -161,7 +161,7 @@ void BondHybrid::settings(int narg, char **arg)
 {
   int i,m,istyle;
 
-  if (narg < 1) error->all("Illegal bond_style command");
+  if (narg < 1) error->all(FLERR,"Illegal bond_style command");
 
   // delete old lists, since cannot just change settings
 
@@ -211,11 +211,11 @@ void BondHybrid::settings(int narg, char **arg)
   while (i < narg) {
     for (m = 0; m < nstyles; m++)
       if (strcmp(arg[i],keywords[m]) == 0) 
-	error->all("Bond style hybrid cannot use same pair style twice");
+	error->all(FLERR,"Bond style hybrid cannot use same pair style twice");
     if (strcmp(arg[i],"hybrid") == 0) 
-      error->all("Bond style hybrid cannot have hybrid as an argument");
+      error->all(FLERR,"Bond style hybrid cannot have hybrid as an argument");
     if (strcmp(arg[i],"none") == 0) 
-      error->all("Bond style hybrid cannot have none as an argument");
+      error->all(FLERR,"Bond style hybrid cannot have none as an argument");
     styles[nstyles] = force->new_bond(arg[i]);
     keywords[nstyles] = new char[strlen(arg[i])+1];
     strcpy(keywords[nstyles],arg[i]);
@@ -249,7 +249,7 @@ void BondHybrid::coeff(int narg, char **arg)
   int none = 0;
   if (m == nstyles) {
     if (strcmp(arg[1],"none") == 0) none = 1;
-    else error->all("Bond coeff for hybrid has invalid style");
+    else error->all(FLERR,"Bond coeff for hybrid has invalid style");
   }
 
   // move 1st arg to 2nd arg
@@ -285,7 +285,7 @@ void BondHybrid::init_style()
 
 double BondHybrid::equilibrium_distance(int i)
 {
-  if (map[i] < 0) error->one("Invoked bond equil distance on bond style none");
+  if (map[i] < 0) error->one(FLERR,"Invoked bond equil distance on bond style none");
   return styles[map[i]]->equilibrium_distance(i);
 }
 
@@ -334,7 +334,7 @@ void BondHybrid::read_restart(FILE *fp)
 
 double BondHybrid::single(int type, double rsq, int i, int j)
 {
-  if (map[type] < 0) error->one("Invoked bond single on bond style none");
+  if (map[type] < 0) error->one(FLERR,"Invoked bond single on bond style none");
   return styles[map[type]]->single(type,rsq,i,j);
 }
 
diff --git a/src/change_box.cpp b/src/change_box.cpp
index 2bb5ad45fe419bba912c7ef4c95ddc3ed7acaabf..34f2f67b0b4a65a6183e0b68382ec15f624483e3 100644
--- a/src/change_box.cpp
+++ b/src/change_box.cpp
@@ -32,27 +32,27 @@ ChangeBox::ChangeBox(LAMMPS *lmp) : Pointers(lmp) {}
 void ChangeBox::command(int narg, char **arg)
 {
   if (domain->box_exist == 0) 
-    error->all("Change_box command before simulation box is defined");
-  if (narg != 1) error->all("Illegal change_box command");
+    error->all(FLERR,"Change_box command before simulation box is defined");
+  if (narg != 1) error->all(FLERR,"Illegal change_box command");
 
   int style;
   if (strcmp(arg[0],"ortho") == 0) style = ORTHO;
   else if (strcmp(arg[0],"triclinic") == 0) style = TRICLINIC;
-  else error->all("Illegal change_box command");
+  else error->all(FLERR,"Illegal change_box command");
 
   if (style == ORTHO && domain->triclinic == 0)
-    error->all("Change_box operation is invalid");
+    error->all(FLERR,"Change_box operation is invalid");
   if (style == TRICLINIC && domain->triclinic == 1)
-    error->all("Change_box operation is invalid");
+    error->all(FLERR,"Change_box operation is invalid");
   if (style == ORTHO && 
       (domain->xy != 0.0 || domain->yz != 0.0 || domain->xz != 0.0))
-      error->all("Cannot change box to orthogonal when tilt is non-zero");
+      error->all(FLERR,"Cannot change box to orthogonal when tilt is non-zero");
 
   if (output->ndump)
-    error->all("Cannot change box with dumps defined");
+    error->all(FLERR,"Cannot change box with dumps defined");
   for (int i = 0; i < modify->nfix; i++)
     if (modify->fix[i]->no_change_box)
-      error->all("Cannot change box with certain fixes defined");
+      error->all(FLERR,"Cannot change box with certain fixes defined");
 
   if (style == ORTHO) domain->triclinic = 0;
   else domain->triclinic = 1;
diff --git a/src/comm.cpp b/src/comm.cpp
index b5008dc3af2f6e0a9814342bc7c88c77553a054c..e28baab37f83f28c6b35cd0385328dd18944888f 100644
--- a/src/comm.cpp
+++ b/src/comm.cpp
@@ -46,9 +46,6 @@ using namespace LAMMPS_NS;
 #define BUFFACTOR 1.5
 #define BUFMIN 1000
 #define BUFEXTRA 1000
-
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
 #define BIG 1.0e20
 
 enum{SINGLE,MULTI};
@@ -138,9 +135,9 @@ void Comm::set_procs()
   procs2box();
 
   if (procgrid[0]*procgrid[1]*procgrid[2] != nprocs)
-    error->all("Bad grid of processors");
+    error->all(FLERR,"Bad grid of processors");
   if (domain->dimension == 2 && procgrid[2] != 1)
-    error->all("Processor count in z must be 1 for 2d simulation");
+    error->all(FLERR,"Processor count in z must be 1 for 2d simulation");
 
   if (grid2proc) memory->destroy(grid2proc);
   memory->create(grid2proc,procgrid[0],procgrid[1],procgrid[2],
@@ -1341,36 +1338,36 @@ void Comm::free_multi()
 
 void Comm::set(int narg, char **arg)
 {
-  if (narg < 1) error->all("Illegal communicate command");
+  if (narg < 1) error->all(FLERR,"Illegal communicate command");
 
   if (strcmp(arg[0],"single") == 0) style = SINGLE;
   else if (strcmp(arg[0],"multi") == 0) style = MULTI;
-  else error->all("Illegal communicate command");
+  else error->all(FLERR,"Illegal communicate command");
 
   int iarg = 1;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"group") == 0) {
-      if (iarg+2 > narg) error->all("Illegal communicate command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal communicate command");
       bordergroup = group->find(arg[iarg+1]);
       if (bordergroup < 0)
-	error->all("Invalid group in communicate command");
+	error->all(FLERR,"Invalid group in communicate command");
       if (bordergroup && (atom->firstgroupname == NULL || 
 			  strcmp(arg[iarg+1],atom->firstgroupname) != 0))
-	error->all("Communicate group != atom_modify first group");
+	error->all(FLERR,"Communicate group != atom_modify first group");
       iarg += 2;
     } else if (strcmp(arg[iarg],"cutoff") == 0) {
-      if (iarg+2 > narg) error->all("Illegal communicate command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal communicate command");
       cutghostuser = atof(arg[iarg+1]);
       if (cutghostuser < 0.0) 
-	error->all("Invalid cutoff in communicate command");
+	error->all(FLERR,"Invalid cutoff in communicate command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"vel") == 0) {
-      if (iarg+2 > narg) error->all("Illegal communicate command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal communicate command");
       if (strcmp(arg[iarg+1],"yes") == 0) ghost_velocity = 1;
       else if (strcmp(arg[iarg+1],"no") == 0) ghost_velocity = 0;
-      else error->all("Illegal communicate command");
+      else error->all(FLERR,"Illegal communicate command");
       iarg += 2;
-    } else error->all("Illegal communicate command");
+    } else error->all(FLERR,"Illegal communicate command");
   }
 }
 
diff --git a/src/compute.cpp b/src/compute.cpp
index 230c15919c1754a3290c0e655273c704ea246b09..5b8dc93f2a2e2b61c959d7b41d1850132e255114 100644
--- a/src/compute.cpp
+++ b/src/compute.cpp
@@ -29,14 +29,11 @@ using namespace LAMMPS_NS;
 #define DELTA 4
 #define BIG 2000000000
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 Compute::Compute(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
 {
-  if (narg < 3) error->all("Illegal compute command");
+  if (narg < 3) error->all(FLERR,"Illegal compute command");
 
   // compute ID, group, and style
   // ID must be all alphanumeric chars or underscores
@@ -47,10 +44,10 @@ Compute::Compute(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
 
   for (int i = 0; i < n-1; i++)
     if (!isalnum(id[i]) && id[i] != '_')
-      error->all("Compute ID must be alphanumeric or underscore characters");
+      error->all(FLERR,"Compute ID must be alphanumeric or underscore characters");
 
   igroup = group->find(arg[1]);
-  if (igroup == -1) error->all("Could not find compute group ID");
+  if (igroup == -1) error->all(FLERR,"Could not find compute group ID");
   groupbit = group->bitmask[igroup];
 
   n = strlen(arg[2]) + 1;
@@ -103,27 +100,27 @@ Compute::~Compute()
 
 void Compute::modify_params(int narg, char **arg)
 {
-  if (narg == 0) error->all("Illegal compute_modify command");
+  if (narg == 0) error->all(FLERR,"Illegal compute_modify command");
 
   int iarg = 0;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"extra") == 0) {
-      if (iarg+2 > narg) error->all("Illegal compute_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal compute_modify command");
       extra_dof = atoi(arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"dynamic") == 0) {
-      if (iarg+2 > narg) error->all("Illegal compute_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal compute_modify command");
       if (strcmp(arg[iarg+1],"no") == 0) dynamic = 0;
       else if (strcmp(arg[iarg+1],"yes") == 0) dynamic = 1;
-      else error->all("Illegal compute_modify command");
+      else error->all(FLERR,"Illegal compute_modify command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"thermo") == 0) {
-      if (iarg+2 > narg) error->all("Illegal compute_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal compute_modify command");
       if (strcmp(arg[iarg+1],"no") == 0) thermoflag = 0;
       else if (strcmp(arg[iarg+1],"yes") == 0) thermoflag = 1;
-      else error->all("Illegal compute_modify command");
+      else error->all(FLERR,"Illegal compute_modify command");
       iarg += 2;
-    } else error->all("Illegal compute_modify command");
+    } else error->all(FLERR,"Illegal compute_modify command");
   }
 }
 
@@ -140,7 +137,7 @@ void Compute::reset_extra_dof()
 
 void Compute::reset_extra_compute_fix(char *)
 {
-  error->all("Compute does not allow an extra compute or fix to be reset");
+  error->all(FLERR,"Compute does not allow an extra compute or fix to be reset");
 }
 
 /* ----------------------------------------------------------------------
@@ -238,7 +235,7 @@ int Compute::molecules_in_group(int &idlo, int &idhi)
   int flagall;
   MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
   if (flagall && comm->me == 0)
-    error->warning("Atom with molecule ID = 0 included in "
+    error->warning(FLERR,"Atom with molecule ID = 0 included in "
 		   "compute molecule group");
 
   MPI_Allreduce(&lo,&idlo,1,MPI_INT,MPI_MIN,world);
@@ -280,7 +277,7 @@ int Compute::molecules_in_group(int &idlo, int &idhi)
 
   MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
   if (flagall && comm->me == 0)
-    error->warning("One or more compute molecules has atoms not in group");
+    error->warning(FLERR,"One or more compute molecules has atoms not in group");
 
   // if molmap simply stores 1 to Nmolecules, then free it
 
diff --git a/src/compute_angle_local.cpp b/src/compute_angle_local.cpp
index 6f9bce918c01785d822141caa50e1de780d215e7..a126348d3121244ba5d495032c9c4ef07572eb7b 100644
--- a/src/compute_angle_local.cpp
+++ b/src/compute_angle_local.cpp
@@ -32,10 +32,10 @@ using namespace LAMMPS_NS;
 ComputeAngleLocal::ComputeAngleLocal(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg < 4) error->all("Illegal compute angle/local command");
+  if (narg < 4) error->all(FLERR,"Illegal compute angle/local command");
 
   if (atom->avec->angles_allow == 0)
-    error->all("Compute angle/local used when angles are not allowed");
+    error->all(FLERR,"Compute angle/local used when angles are not allowed");
 
   local_flag = 1;
   nvalues = narg - 3;
@@ -50,7 +50,7 @@ ComputeAngleLocal::ComputeAngleLocal(LAMMPS *lmp, int narg, char **arg) :
     i = iarg-3;
     if (strcmp(arg[iarg],"theta") == 0) tflag = nvalues++;
     else if (strcmp(arg[iarg],"eng") == 0) eflag = nvalues++;
-    else error->all("Invalid keyword in compute angle/local command");
+    else error->all(FLERR,"Invalid keyword in compute angle/local command");
   }
 
   nmax = 0;
@@ -71,7 +71,7 @@ ComputeAngleLocal::~ComputeAngleLocal()
 void ComputeAngleLocal::init()
 {
   if (force->angle == NULL) 
-    error->all("No angle style is defined for compute angle/local");
+    error->all(FLERR,"No angle style is defined for compute angle/local");
 
   // do initial memory allocation so that memory_usage() is correct
 
diff --git a/src/compute_atom_molecule.cpp b/src/compute_atom_molecule.cpp
index 9466ae92a93ae4f64d8c9da6553bed4cec5d9c09..2bb6f7a5108330018a489e8d1d3266c5ec8c9f9c 100644
--- a/src/compute_atom_molecule.cpp
+++ b/src/compute_atom_molecule.cpp
@@ -36,10 +36,10 @@ ComputeAtomMolecule::
 ComputeAtomMolecule(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg < 4) error->all("Illegal compute atom/molecule command");
+  if (narg < 4) error->all(FLERR,"Illegal compute atom/molecule command");
 
   if (atom->molecular == 0)
-    error->all("Compute atom/molecule requires molecular atom style");
+    error->all(FLERR,"Compute atom/molecule requires molecular atom style");
 
   // parse args
 
@@ -65,7 +65,7 @@ ComputeAtomMolecule(LAMMPS *lmp, int narg, char **arg) :
       char *ptr = strchr(suffix,'[');
       if (ptr) {
 	if (suffix[strlen(suffix)-1] != ']')
-	  error->all("Illegal compute reduce command");
+	  error->all(FLERR,"Illegal compute reduce command");
 	argindex[nvalues] = atoi(ptr+1);
 	*ptr = '\0';
       } else argindex[nvalues] = 0;
@@ -75,7 +75,7 @@ ComputeAtomMolecule(LAMMPS *lmp, int narg, char **arg) :
       strcpy(ids[nvalues],suffix);
       nvalues++;
       delete [] suffix;
-    } else error->all("Illegal compute atom/molecule command");
+    } else error->all(FLERR,"Illegal compute atom/molecule command");
 
     iarg++;
   }
@@ -86,46 +86,46 @@ ComputeAtomMolecule(LAMMPS *lmp, int narg, char **arg) :
     if (which[i] == COMPUTE) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all("Compute ID for compute atom/molecule does not exist");
+	error->all(FLERR,"Compute ID for compute atom/molecule does not exist");
       if (modify->compute[icompute]->peratom_flag == 0)
-	error->all("Compute atom/molecule compute does not "
+	error->all(FLERR,"Compute atom/molecule compute does not "
 		   "calculate per-atom values");
       if (argindex[i] == 0 && 
 	  modify->compute[icompute]->size_peratom_cols != 0)
-	error->all("Compute atom/molecule compute does not "
+	error->all(FLERR,"Compute atom/molecule compute does not "
 		   "calculate a per-atom vector");
       if (argindex[i] && modify->compute[icompute]->size_peratom_cols == 0)
-	error->all("Compute atom/molecule compute does not "
+	error->all(FLERR,"Compute atom/molecule compute does not "
 		   "calculate a per-atom array");
       if (argindex[i] && 
 	  argindex[i] > modify->compute[icompute]->size_peratom_cols)
-	error->all("Compute atom/molecule compute array is "
+	error->all(FLERR,"Compute atom/molecule compute array is "
 		   "accessed out-of-range");
 
     } else if (which[i] == FIX) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0)
-	error->all("Fix ID for compute atom/molecule does not exist");
+	error->all(FLERR,"Fix ID for compute atom/molecule does not exist");
       if (modify->fix[ifix]->peratom_flag)
-	error->all("Compute atom/molecule fix does not "
+	error->all(FLERR,"Compute atom/molecule fix does not "
 		   "calculate per-atom values");
       if (argindex[i] == 0 && 
 	  modify->fix[ifix]->size_peratom_cols != 0)
-	error->all("Compute atom/molecule fix does not "
+	error->all(FLERR,"Compute atom/molecule fix does not "
 		   "calculate a per-atom vector");
       if (argindex[i] && modify->fix[ifix]->size_peratom_cols == 0)
-	error->all("Compute atom/molecule fix does not "
+	error->all(FLERR,"Compute atom/molecule fix does not "
 		   "calculate a per-atom array");
       if (argindex[i] && 
 	  argindex[i] > modify->fix[ifix]->size_peratom_cols)
-	error->all("Compute atom/molecule fix array is accessed out-of-range");
+	error->all(FLERR,"Compute atom/molecule fix array is accessed out-of-range");
 
     } else if (which[i] == VARIABLE) {
       int ivariable = input->variable->find(ids[i]);
       if (ivariable < 0)
-	error->all("Variable name for compute atom/molecule does not exist");
+	error->all(FLERR,"Variable name for compute atom/molecule does not exist");
       if (input->variable->atomstyle(ivariable) == 0)
-	error->all("Compute atom/molecule variable is not "
+	error->all(FLERR,"Compute atom/molecule variable is not "
 		   "atom-style variable");
     }
   }
@@ -179,7 +179,7 @@ void ComputeAtomMolecule::init()
 {
   int ntmp = molecules_in_group(idlo,idhi);
   if (ntmp != nmolecules)
-    error->all("Molecule count changed in compute atom/molecule");
+    error->all(FLERR,"Molecule count changed in compute atom/molecule");
 
   // set indices and check validity of all computes,fixes,variables
 
@@ -187,19 +187,19 @@ void ComputeAtomMolecule::init()
     if (which[m] == COMPUTE) {
       int icompute = modify->find_compute(ids[m]);
       if (icompute < 0)
-	error->all("Compute ID for compute atom/molecule does not exist");
+	error->all(FLERR,"Compute ID for compute atom/molecule does not exist");
       value2index[m] = icompute;
       
     } else if (which[m] == FIX) {
       int ifix = modify->find_fix(ids[m]);
       if (ifix < 0) 
-	error->all("Fix ID for compute atom/molecule does not exist");
+	error->all(FLERR,"Fix ID for compute atom/molecule does not exist");
       value2index[m] = ifix;
 
     } else if (which[m] == VARIABLE) {
       int ivariable = input->variable->find(ids[m]);
       if (ivariable < 0) 
-	error->all("Variable name for compute atom/molecule does not exist");
+	error->all(FLERR,"Variable name for compute atom/molecule does not exist");
       value2index[m] = ivariable;
 
     } else value2index[m] = -1;
@@ -301,7 +301,7 @@ void ComputeAtomMolecule::compute_one(int m)
 
   } else if (which[m] == FIX) {
     if (update->ntimestep % modify->fix[vidx]->peratom_freq)
-      error->all("Fix used in compute atom/molecule not computed "
+      error->all(FLERR,"Fix used in compute atom/molecule not computed "
 		 "at compatible time");
     Fix *fix = modify->fix[vidx];
 
diff --git a/src/compute_bond_local.cpp b/src/compute_bond_local.cpp
index af1710520ff53e2a2fe78703bb5b70a78bf66628..76feec4209cea4b1c0d5cb8a9655b1ce959a978f 100644
--- a/src/compute_bond_local.cpp
+++ b/src/compute_bond_local.cpp
@@ -32,10 +32,10 @@ using namespace LAMMPS_NS;
 ComputeBondLocal::ComputeBondLocal(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg < 4) error->all("Illegal compute bond/local command");
+  if (narg < 4) error->all(FLERR,"Illegal compute bond/local command");
 
   if (atom->avec->bonds_allow == 0)
-    error->all("Compute bond/local used when bonds are not allowed");
+    error->all(FLERR,"Compute bond/local used when bonds are not allowed");
 
   local_flag = 1;
   nvalues = narg - 3;
@@ -50,7 +50,7 @@ ComputeBondLocal::ComputeBondLocal(LAMMPS *lmp, int narg, char **arg) :
     i = iarg-3;
     if (strcmp(arg[iarg],"dist") == 0) dflag = nvalues++;
     else if (strcmp(arg[iarg],"eng") == 0) eflag = nvalues++;
-    else error->all("Invalid keyword in compute bond/local command");
+    else error->all(FLERR,"Invalid keyword in compute bond/local command");
   }
 
   nmax = 0;
@@ -71,7 +71,7 @@ ComputeBondLocal::~ComputeBondLocal()
 void ComputeBondLocal::init()
 {
   if (force->bond == NULL) 
-    error->all("No bond style is defined for compute bond/local");
+    error->all(FLERR,"No bond style is defined for compute bond/local");
 
   // do initial memory allocation so that memory_usage() is correct
 
diff --git a/src/compute_centro_atom.cpp b/src/compute_centro_atom.cpp
index c166e3c2f558a946808de299975b24d54a5ad06a..68478955c8cfc6196b49b71b831d9869e9945177 100644
--- a/src/compute_centro_atom.cpp
+++ b/src/compute_centro_atom.cpp
@@ -37,14 +37,14 @@ using namespace LAMMPS_NS;
 ComputeCentroAtom::ComputeCentroAtom(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg != 4) error->all("Illegal compute centro/atom command");
+  if (narg != 4) error->all(FLERR,"Illegal compute centro/atom command");
   
   if (strcmp(arg[3],"fcc") == 0) nnn = 12;
   else if (strcmp(arg[3],"bcc") == 0) nnn = 8;
   else nnn = atoi(arg[3]);
 
   if (nnn <= 0 || nnn % 2)
-    error->all("Illegal neighbor value for compute centro/atom command");
+    error->all(FLERR,"Illegal neighbor value for compute centro/atom command");
 
   peratom_flag = 1;
   size_peratom_cols = 0;
@@ -70,13 +70,13 @@ ComputeCentroAtom::~ComputeCentroAtom()
 void ComputeCentroAtom::init()
 {
   if (force->pair == NULL) 
-    error->all("Compute centro/atom requires a pair style be defined");
+    error->all(FLERR,"Compute centro/atom requires a pair style be defined");
 
   int count = 0;
   for (int i = 0; i < modify->ncompute; i++)
     if (strcmp(modify->compute[i]->style,"centro/atom") == 0) count++;
   if (count > 1 && comm->me == 0)
-    error->warning("More than one compute centro/atom");
+    error->warning(FLERR,"More than one compute centro/atom");
 
   // need an occasional full neighbor list
 
diff --git a/src/compute_cluster_atom.cpp b/src/compute_cluster_atom.cpp
index cb42cdbbf6536914511c13bde2da54d89ed7d61c..9b8036ad2963cf29ff220959c16de23f15390a64 100644
--- a/src/compute_cluster_atom.cpp
+++ b/src/compute_cluster_atom.cpp
@@ -29,15 +29,12 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 ComputeClusterAtom::ComputeClusterAtom(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg != 4) error->all("Illegal compute cluster/atom command");
+  if (narg != 4) error->all(FLERR,"Illegal compute cluster/atom command");
 
   double cutoff = atof(arg[3]);
   cutsq = cutoff*cutoff;
@@ -62,11 +59,11 @@ ComputeClusterAtom::~ComputeClusterAtom()
 void ComputeClusterAtom::init()
 {
   if (atom->tag_enable == 0)
-    error->all("Cannot use compute cluster/atom unless atoms have IDs");
+    error->all(FLERR,"Cannot use compute cluster/atom unless atoms have IDs");
   if (force->pair == NULL) 
-    error->all("Compute cluster/atom requires a pair style be defined");
+    error->all(FLERR,"Compute cluster/atom requires a pair style be defined");
   if (sqrt(cutsq) > force->pair->cutforce) 
-    error->all("Compute cluster/atom cutoff is longer than pairwise cutoff");
+    error->all(FLERR,"Compute cluster/atom cutoff is longer than pairwise cutoff");
 
   // need an occasional full neighbor list
   // full required so that pair of atoms on 2 procs both set their clusterID
@@ -82,7 +79,7 @@ void ComputeClusterAtom::init()
   for (int i = 0; i < modify->ncompute; i++)
     if (strcmp(modify->compute[i]->style,"cluster/atom") == 0) count++;
   if (count > 1 && comm->me == 0)
-    error->warning("More than one compute cluster/atom");
+    error->warning(FLERR,"More than one compute cluster/atom");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/compute_cna_atom.cpp b/src/compute_cna_atom.cpp
index f07ffd6fc96e971cf86b085f7e5c66dd5ced3a28..5df5b68919f679ad3a100d505188585b09e8bc80 100644
--- a/src/compute_cna_atom.cpp
+++ b/src/compute_cna_atom.cpp
@@ -33,9 +33,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-
 #define MAXNEAR 16
 #define MAXCOMMON 8
 
@@ -47,13 +44,13 @@ enum{NCOMMON,NBOND,MAXBOND,MINBOND};
 ComputeCNAAtom::ComputeCNAAtom(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg != 4) error->all("Illegal compute cna/atom command");
+  if (narg != 4) error->all(FLERR,"Illegal compute cna/atom command");
 
   peratom_flag = 1;
   size_peratom_cols = 0;
 
   double cutoff = atof(arg[3]);
-  if (cutoff < 0.0) error->all("Illegal compute cna/atom command");
+  if (cutoff < 0.0) error->all(FLERR,"Illegal compute cna/atom command");
   cutsq = cutoff*cutoff;
 
   nmax = 0;
@@ -76,22 +73,22 @@ ComputeCNAAtom::~ComputeCNAAtom()
 void ComputeCNAAtom::init()
 {
   if (force->pair == NULL) 
-    error->all("Compute cna/atom requires a pair style be defined");
+    error->all(FLERR,"Compute cna/atom requires a pair style be defined");
   if (sqrt(cutsq) > force->pair->cutforce) 
-    error->all("Compute cna/atom cutoff is longer than pairwise cutoff");
+    error->all(FLERR,"Compute cna/atom cutoff is longer than pairwise cutoff");
 
   // cannot use neighbor->cutneighmax b/c neighbor has not yet been init
 
   if (2.0*sqrt(cutsq) > force->pair->cutforce + neighbor->skin && 
       comm->me == 0)
-    error->warning("Compute cna/atom cutoff may be too large to find "
+    error->warning(FLERR,"Compute cna/atom cutoff may be too large to find "
 		   "ghost atom neighbors");
 
   int count = 0;
   for (int i = 0; i < modify->ncompute; i++)
     if (strcmp(modify->compute[i]->style,"cna/atom") == 0) count++;
   if (count > 1 && comm->me == 0)
-    error->warning("More than one compute cna/atom defined");
+    error->warning(FLERR,"More than one compute cna/atom defined");
 
   // need an occasional full neighbor list
 
@@ -192,7 +189,7 @@ void ComputeCNAAtom::compute_peratom()
   if (nerrorall && comm->me == 0) {
     char str[128];
     sprintf(str,"Too many neighbors in CNA for %d atoms",nerrorall);
-    error->warning(str,0);
+    error->warning(FLERR,str,0);
   }
 
   // compute CNA for each atom in group
@@ -353,7 +350,7 @@ void ComputeCNAAtom::compute_peratom()
   if (nerrorall && comm->me == 0) {
     char str[128];
     sprintf(str,"Too many common neighbors in CNA %d times",nerrorall);
-    error->warning(str);
+    error->warning(FLERR,str);
   }
 }
 
diff --git a/src/compute_com.cpp b/src/compute_com.cpp
index dba4d626bddcb4c9529f4ae783142dfb60e95193..d0f4296c42dad68d364e1fe44ef9a7322885b89e 100644
--- a/src/compute_com.cpp
+++ b/src/compute_com.cpp
@@ -23,7 +23,7 @@ using namespace LAMMPS_NS;
 ComputeCOM::ComputeCOM(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Illegal compute com command");
+  if (narg != 3) error->all(FLERR,"Illegal compute com command");
 
   vector_flag = 1;
   size_vector = 3;
diff --git a/src/compute_com_molecule.cpp b/src/compute_com_molecule.cpp
index 5218f415a04c71dfb281af5e44902ea41d00b15e..ad3ba957bd97c66aed0b760cb7bd451f6f8beb50 100644
--- a/src/compute_com_molecule.cpp
+++ b/src/compute_com_molecule.cpp
@@ -25,10 +25,10 @@ using namespace LAMMPS_NS;
 ComputeCOMMolecule::ComputeCOMMolecule(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Illegal compute com/molecule command");
+  if (narg != 3) error->all(FLERR,"Illegal compute com/molecule command");
 
   if (atom->molecular == 0)
-    error->all("Compute com/molecule requires molecular atom style");
+    error->all(FLERR,"Compute com/molecule requires molecular atom style");
 
   array_flag = 1;
   size_array_cols = 3;
@@ -88,7 +88,7 @@ void ComputeCOMMolecule::init()
 {
   int ntmp = molecules_in_group(idlo,idhi);
   if (ntmp != nmolecules)
-    error->all("Molecule count changed in compute com/molecule");
+    error->all(FLERR,"Molecule count changed in compute com/molecule");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/compute_coord_atom.cpp b/src/compute_coord_atom.cpp
index 5f3c087b3298fa46469861fd5996b7ff0fcbfeb5..85fe47ec4487a3952be5bca70312265fbf83e2c2 100644
--- a/src/compute_coord_atom.cpp
+++ b/src/compute_coord_atom.cpp
@@ -34,7 +34,7 @@ using namespace LAMMPS_NS;
 ComputeCoordAtom::ComputeCoordAtom(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg != 4) error->all("Illegal compute coord/atom command");
+  if (narg != 4) error->all(FLERR,"Illegal compute coord/atom command");
 
   double cutoff = atof(arg[3]);
   cutsq = cutoff*cutoff;
@@ -58,9 +58,9 @@ ComputeCoordAtom::~ComputeCoordAtom()
 void ComputeCoordAtom::init()
 {
   if (force->pair == NULL) 
-    error->all("Compute coord/atom requires a pair style be defined");
+    error->all(FLERR,"Compute coord/atom requires a pair style be defined");
   if (sqrt(cutsq) > force->pair->cutforce) 
-    error->all("Compute coord/atom cutoff is longer than pairwise cutoff");
+    error->all(FLERR,"Compute coord/atom cutoff is longer than pairwise cutoff");
 
   // need an occasional full neighbor list
 
@@ -75,7 +75,7 @@ void ComputeCoordAtom::init()
   for (int i = 0; i < modify->ncompute; i++)
     if (strcmp(modify->compute[i]->style,"coord/atom") == 0) count++;
   if (count > 1 && comm->me == 0)
-    error->warning("More than one compute coord/atom");
+    error->warning(FLERR,"More than one compute coord/atom");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/compute_dihedral_local.cpp b/src/compute_dihedral_local.cpp
index 361a0f97726174c7b31e05c7089705a40e945d14..621534671726725a2350e42963870925e3af9ee8 100644
--- a/src/compute_dihedral_local.cpp
+++ b/src/compute_dihedral_local.cpp
@@ -26,20 +26,17 @@
 using namespace LAMMPS_NS;
 
 #define DELTA 10000
-
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-#define SMALL     0.001
+#define SMALL 0.001
 
 /* ---------------------------------------------------------------------- */
 
 ComputeDihedralLocal::ComputeDihedralLocal(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg < 4) error->all("Illegal compute dihedral/local command");
+  if (narg < 4) error->all(FLERR,"Illegal compute dihedral/local command");
 
   if (atom->avec->dihedrals_allow == 0)
-    error->all("Compute dihedral/local used when dihedrals are not allowed");
+    error->all(FLERR,"Compute dihedral/local used when dihedrals are not allowed");
 
   local_flag = 1;
   nvalues = narg - 3;
@@ -53,7 +50,7 @@ ComputeDihedralLocal::ComputeDihedralLocal(LAMMPS *lmp, int narg, char **arg) :
   for (int iarg = 3; iarg < narg; iarg++) {
     i = iarg-3;
     if (strcmp(arg[iarg],"phi") == 0) pflag = nvalues++;
-    else error->all("Invalid keyword in compute dihedral/local command");
+    else error->all(FLERR,"Invalid keyword in compute dihedral/local command");
   }
 
   nmax = 0;
@@ -74,7 +71,7 @@ ComputeDihedralLocal::~ComputeDihedralLocal()
 void ComputeDihedralLocal::init()
 {
   if (force->dihedral == NULL) 
-    error->all("No dihedral style is defined for compute dihedral/local");
+    error->all(FLERR,"No dihedral style is defined for compute dihedral/local");
 
   // do initial memory allocation so that memory_usage() is correct
 
diff --git a/src/compute_displace_atom.cpp b/src/compute_displace_atom.cpp
index fbd828be5ddeaa284d431ad349ff5da3d3d776d9..59370ea831cda6562d2543f08014b1ec2850af46 100644
--- a/src/compute_displace_atom.cpp
+++ b/src/compute_displace_atom.cpp
@@ -30,7 +30,7 @@ using namespace LAMMPS_NS;
 ComputeDisplaceAtom::ComputeDisplaceAtom(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Illegal compute displace/atom command");
+  if (narg != 3) error->all(FLERR,"Illegal compute displace/atom command");
 
   peratom_flag = 1;
   size_peratom_cols = 4;
@@ -77,7 +77,7 @@ void ComputeDisplaceAtom::init()
   // set fix which stores original atom coords
 
   int ifix = modify->find_fix(id_fix);
-  if (ifix < 0) error->all("Could not find compute displace/atom fix ID");
+  if (ifix < 0) error->all(FLERR,"Could not find compute displace/atom fix ID");
   fix = modify->fix[ifix];
 }
 
diff --git a/src/compute_erotate_sphere.cpp b/src/compute_erotate_sphere.cpp
index 1aa5ad8d99c339b8cd01873c7ccf37651abb000e..47bee40890486ad930ca4ee50cd29b5794958fc6 100644
--- a/src/compute_erotate_sphere.cpp
+++ b/src/compute_erotate_sphere.cpp
@@ -30,7 +30,7 @@ using namespace LAMMPS_NS;
 ComputeERotateSphere::ComputeERotateSphere(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Illegal compute erotate/sphere command");
+  if (narg != 3) error->all(FLERR,"Illegal compute erotate/sphere command");
 
   scalar_flag = 1;
   extscalar = 1;
@@ -38,7 +38,7 @@ ComputeERotateSphere::ComputeERotateSphere(LAMMPS *lmp, int narg, char **arg) :
   // error check
 
   if (!atom->sphere_flag) 
-    error->all("Compute erotate/sphere requires atom style sphere");
+    error->all(FLERR,"Compute erotate/sphere requires atom style sphere");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/compute_group_group.cpp b/src/compute_group_group.cpp
index ebbfe16d93d20046aee3e0b6c38394f2c9228280..5393fae0be0f5b5574fabf0db165071441963e08 100644
--- a/src/compute_group_group.cpp
+++ b/src/compute_group_group.cpp
@@ -35,7 +35,7 @@ using namespace LAMMPS_NS;
 ComputeGroupGroup::ComputeGroupGroup(LAMMPS *lmp, int narg, char **arg) : 
   Compute(lmp, narg, arg)
 {
-  if (narg != 4) error->all("Illegal compute group/group command");
+  if (narg != 4) error->all(FLERR,"Illegal compute group/group command");
 
   scalar_flag = vector_flag = 1;
   size_vector = 3;
@@ -47,7 +47,7 @@ ComputeGroupGroup::ComputeGroupGroup(LAMMPS *lmp, int narg, char **arg) :
   strcpy(group2,arg[3]);
 
   jgroup = group->find(group2);
-  if (jgroup == -1) error->all("Compute group/group group ID does not exist");
+  if (jgroup == -1) error->all(FLERR,"Compute group/group group ID does not exist");
   jgroupbit = group->bitmask[jgroup];
 
   vector = new double[3];
@@ -66,13 +66,13 @@ ComputeGroupGroup::~ComputeGroupGroup()
 void ComputeGroupGroup::init()
 {
   if (force->pair == NULL)
-    error->all("No pair style defined for compute group/group");
+    error->all(FLERR,"No pair style defined for compute group/group");
 
   // if non-hybrid, then error if single_enable = 0
   // if hybrid, let hybrid determine if sub-style sets single_enable = 0
 
   if (force->pair_match("hybrid",0) == NULL && force->pair->single_enable == 0)
-    error->all("Pair style does not support compute group/group");
+    error->all(FLERR,"Pair style does not support compute group/group");
 
   pair = force->pair;
   cutsq = force->pair->cutsq;
@@ -80,7 +80,7 @@ void ComputeGroupGroup::init()
   // recheck that group 2 has not been deleted
 
   jgroup = group->find(group2);
-  if (jgroup == -1) error->all("Compute group/group group ID does not exist");
+  if (jgroup == -1) error->all(FLERR,"Compute group/group group ID does not exist");
   jgroupbit = group->bitmask[jgroup];
 
   // need an occasional half neighbor list
diff --git a/src/compute_gyration.cpp b/src/compute_gyration.cpp
index de2ebf8f1bb0f8bd03901ad6a5d0d27de26f8df4..f192ea3d69d9d03309690f85de5a04e615e794d2 100644
--- a/src/compute_gyration.cpp
+++ b/src/compute_gyration.cpp
@@ -23,7 +23,7 @@ using namespace LAMMPS_NS;
 ComputeGyration::ComputeGyration(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Illegal compute gyration command");
+  if (narg != 3) error->all(FLERR,"Illegal compute gyration command");
 
   scalar_flag = 1;
   extscalar = 0;
diff --git a/src/compute_gyration_molecule.cpp b/src/compute_gyration_molecule.cpp
index 80fdca5fa0897a0aa7f23d309b6d0b8ec439db5d..dd96079d2196b0a2f4a40f685ee6a18012a20f61 100644
--- a/src/compute_gyration_molecule.cpp
+++ b/src/compute_gyration_molecule.cpp
@@ -27,10 +27,10 @@ ComputeGyrationMolecule::ComputeGyrationMolecule(LAMMPS *lmp,
 						 int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Illegal compute gyration/molecule command");
+  if (narg != 3) error->all(FLERR,"Illegal compute gyration/molecule command");
 
   if (atom->molecular == 0)
-    error->all("Compute gyration/molecule requires molecular atom style");
+    error->all(FLERR,"Compute gyration/molecule requires molecular atom style");
 
   vector_flag = 1;
   extvector = 0;
@@ -93,7 +93,7 @@ void ComputeGyrationMolecule::init()
 {
   int ntmp = molecules_in_group(idlo,idhi);
   if (ntmp != nmolecules)
-    error->all("Molecule count changed in compute gyration/molecule");
+    error->all(FLERR,"Molecule count changed in compute gyration/molecule");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/compute_heat_flux.cpp b/src/compute_heat_flux.cpp
index 28be7c5942deac6f6091ca79de4ad95d9db86e76..f5a38a5656db610c475879eab1812d0953fbf97c 100644
--- a/src/compute_heat_flux.cpp
+++ b/src/compute_heat_flux.cpp
@@ -35,7 +35,7 @@ using namespace LAMMPS_NS;
 ComputeHeatFlux::ComputeHeatFlux(LAMMPS *lmp, int narg, char **arg) : 
   Compute(lmp, narg, arg)
 {
-  if (narg != 6) error->all("Illegal compute heat/flux command");
+  if (narg != 6) error->all(FLERR,"Illegal compute heat/flux command");
 
   vector_flag = 1;
   size_vector = 6;
@@ -60,13 +60,13 @@ ComputeHeatFlux::ComputeHeatFlux(LAMMPS *lmp, int narg, char **arg) :
   int ipe = modify->find_compute(id_pe);
   int istress = modify->find_compute(id_stress);
   if (ike < 0 || ipe < 0 || istress < 0)
-    error->all("Could not find compute heat/flux compute ID");
+    error->all(FLERR,"Could not find compute heat/flux compute ID");
   if (strcmp(modify->compute[ike]->style,"ke/atom") != 0)
-    error->all("Compute heat/flux compute ID does not compute ke/atom");
+    error->all(FLERR,"Compute heat/flux compute ID does not compute ke/atom");
   if (modify->compute[ipe]->peatomflag == 0)
-    error->all("Compute heat/flux compute ID does not compute pe/atom");
+    error->all(FLERR,"Compute heat/flux compute ID does not compute pe/atom");
   if (modify->compute[istress]->pressatomflag == 0)
-    error->all("Compute heat/flux compute ID does not compute stress/atom");
+    error->all(FLERR,"Compute heat/flux compute ID does not compute stress/atom");
 
   vector = new double[6];
 }
@@ -91,7 +91,7 @@ void ComputeHeatFlux::init()
   int ipe = modify->find_compute(id_pe);
   int istress = modify->find_compute(id_stress);
   if (ike < 0 || ipe < 0 || istress < 0)
-    error->all("Could not find compute heat/flux compute ID");
+    error->all(FLERR,"Could not find compute heat/flux compute ID");
 
   c_ke = modify->compute[ike];
   c_pe = modify->compute[ipe];
diff --git a/src/compute_improper_local.cpp b/src/compute_improper_local.cpp
index 65e4ec1cc94fe50049928688308603e6539610a8..7162277c396573e0950fb1f3459ffeb5cf36b59b 100644
--- a/src/compute_improper_local.cpp
+++ b/src/compute_improper_local.cpp
@@ -34,10 +34,10 @@ using namespace LAMMPS_NS;
 ComputeImproperLocal::ComputeImproperLocal(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg < 4) error->all("Illegal compute improper/local command");
+  if (narg < 4) error->all(FLERR,"Illegal compute improper/local command");
 
   if (atom->avec->impropers_allow == 0)
-    error->all("Compute improper/local used when impropers are not allowed");
+    error->all(FLERR,"Compute improper/local used when impropers are not allowed");
 
   local_flag = 1;
   nvalues = narg - 3;
@@ -51,7 +51,7 @@ ComputeImproperLocal::ComputeImproperLocal(LAMMPS *lmp, int narg, char **arg) :
   for (int iarg = 3; iarg < narg; iarg++) {
     i = iarg-3;
     if (strcmp(arg[iarg],"chi") == 0) cflag = nvalues++;
-    else error->all("Invalid keyword in compute improper/local command");
+    else error->all(FLERR,"Invalid keyword in compute improper/local command");
   }
 
   nmax = 0;
@@ -72,7 +72,7 @@ ComputeImproperLocal::~ComputeImproperLocal()
 void ComputeImproperLocal::init()
 {
   if (force->improper == NULL) 
-    error->all("No improper style is defined for compute improper/local");
+    error->all(FLERR,"No improper style is defined for compute improper/local");
 
   // do initial memory allocation so that memory_usage() is correct
 
diff --git a/src/compute_ke.cpp b/src/compute_ke.cpp
index 2db20db761ad0e9597f07d97e8266fe03c0f7cac..629f1488e1b6767a228d997f67c0d8864aadabfa 100644
--- a/src/compute_ke.cpp
+++ b/src/compute_ke.cpp
@@ -27,7 +27,7 @@ using namespace LAMMPS_NS;
 ComputeKE::ComputeKE(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Illegal compute ke command");
+  if (narg != 3) error->all(FLERR,"Illegal compute ke command");
 
   scalar_flag = 1;
   extscalar = 1;
diff --git a/src/compute_ke_atom.cpp b/src/compute_ke_atom.cpp
index 0d6fc2d9c7a2520091e7773082170ff1695b9475..6d9d45268f4562eca48b1486a88a6f36287351dc 100644
--- a/src/compute_ke_atom.cpp
+++ b/src/compute_ke_atom.cpp
@@ -28,7 +28,7 @@ using namespace LAMMPS_NS;
 ComputeKEAtom::ComputeKEAtom(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Illegal compute ke/atom command");
+  if (narg != 3) error->all(FLERR,"Illegal compute ke/atom command");
 
   peratom_flag = 1;
   size_peratom_cols = 0;
@@ -52,7 +52,7 @@ void ComputeKEAtom::init()
   for (int i = 0; i < modify->ncompute; i++)
     if (strcmp(modify->compute[i]->style,"ke/atom") == 0) count++;
   if (count > 1 && comm->me == 0)
-    error->warning("More than one compute ke/atom");
+    error->warning(FLERR,"More than one compute ke/atom");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/compute_msd.cpp b/src/compute_msd.cpp
index 3fcb99e89c3b75ef9bcdf7558006e1cb9419259a..bf2d00332e69e3c2c9a05cc01ea11fffe1a70cfb 100644
--- a/src/compute_msd.cpp
+++ b/src/compute_msd.cpp
@@ -28,7 +28,7 @@ using namespace LAMMPS_NS;
 ComputeMSD::ComputeMSD(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg < 3) error->all("Illegal compute msd command");
+  if (narg < 3) error->all(FLERR,"Illegal compute msd command");
 
   vector_flag = 1;
   size_vector = 4;
@@ -41,12 +41,12 @@ ComputeMSD::ComputeMSD(LAMMPS *lmp, int narg, char **arg) :
   int iarg = 3;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"com") == 0) {
-      if (iarg+2 > narg) error->all("Illegal compute msd command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal compute msd command");
       if (strcmp(arg[iarg+1],"no") == 0) comflag = 0;
       else if (strcmp(arg[iarg+1],"yes") == 0) comflag = 1;
-      else error->all("Illegal compute msd command");
+      else error->all(FLERR,"Illegal compute msd command");
       iarg += 2;
-    } else error->all("Illegal compute msd command");
+    } else error->all(FLERR,"Illegal compute msd command");
   }
 
   // create a new fix store/state style with or without com keyword
@@ -93,7 +93,7 @@ void ComputeMSD::init()
   // set fix which stores original atom coords
 
   int ifix = modify->find_fix(id_fix);
-  if (ifix < 0) error->all("Could not find compute msd fix ID");
+  if (ifix < 0) error->all(FLERR,"Could not find compute msd fix ID");
   fix = modify->fix[ifix];
 
   // nmsd = # of atoms in group
diff --git a/src/compute_msd_molecule.cpp b/src/compute_msd_molecule.cpp
index a4ad8b021c0a2b555f81bd79f58b1465092e5d7e..de8d2f63c5883a48307f7cdd41b83aecac277b81 100644
--- a/src/compute_msd_molecule.cpp
+++ b/src/compute_msd_molecule.cpp
@@ -25,10 +25,10 @@ using namespace LAMMPS_NS;
 ComputeMSDMolecule::ComputeMSDMolecule(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Illegal compute msd/molecule command");
+  if (narg != 3) error->all(FLERR,"Illegal compute msd/molecule command");
 
   if (atom->molecular == 0)
-    error->all("Compute msd/molecule requires molecular atom style");
+    error->all(FLERR,"Compute msd/molecule requires molecular atom style");
 
   array_flag = 1;
   size_array_cols = 4;
@@ -103,7 +103,7 @@ void ComputeMSDMolecule::init()
 {
   int ntmp = molecules_in_group(idlo,idhi);
   if (ntmp != nmolecules)
-    error->all("Molecule count changed in compute msd/molecule");
+    error->all(FLERR,"Molecule count changed in compute msd/molecule");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/compute_pair.cpp b/src/compute_pair.cpp
index 9617e016aaa8fc1a4b0e03160277809bb6ab6e1a..e5e8dbda085fde31501fdce18f4168b65b3bee92 100644
--- a/src/compute_pair.cpp
+++ b/src/compute_pair.cpp
@@ -28,8 +28,8 @@ enum{EPAIR,EVDWL,ECOUL};
 ComputePair::ComputePair(LAMMPS *lmp, int narg, char **arg) : 
   Compute(lmp, narg, arg)
 {
-  if (narg < 4 || narg > 5) error->all("Illegal compute pair command");
-  if (igroup) error->all("Compute pair must use group all");
+  if (narg < 4 || narg > 5) error->all(FLERR,"Illegal compute pair command");
+  if (igroup) error->all(FLERR,"Compute pair must use group all");
 
   scalar_flag = 1;
   extscalar = 1;
@@ -47,7 +47,7 @@ ComputePair::ComputePair(LAMMPS *lmp, int narg, char **arg) :
   } else evalue = EPAIR;
 
   pair = force->pair_match(pstyle,1);
-  if (!pair) error->all("Unrecognized pair style in compute pair command");
+  if (!pair) error->all(FLERR,"Unrecognized pair style in compute pair command");
   npair = pair->nextra;
 
   if (npair) {
@@ -75,7 +75,7 @@ void ComputePair::init()
   // recheck for pair style in case it has been deleted
 
   pair = force->pair_match(pstyle,1);
-  if (!pair) error->all("Unrecognized pair style in compute pair command");
+  if (!pair) error->all(FLERR,"Unrecognized pair style in compute pair command");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -84,7 +84,7 @@ double ComputePair::compute_scalar()
 {
   invoked_scalar = update->ntimestep;
   if (update->eflag_global != invoked_scalar)
-    error->all("Energy was not tallied on needed timestep");
+    error->all(FLERR,"Energy was not tallied on needed timestep");
 
   double eng;
   if (evalue == EPAIR) eng = pair->eng_vdwl + pair->eng_coul;
@@ -101,7 +101,7 @@ void ComputePair::compute_vector()
 {
   invoked_vector = update->ntimestep;
   if (update->eflag_global != invoked_vector)
-    error->all("Energy was not tallied on needed timestep");
+    error->all(FLERR,"Energy was not tallied on needed timestep");
 
   for (int i = 0; i < npair; i++)
     one[i] = pair->pvector[i];
diff --git a/src/compute_pair_local.cpp b/src/compute_pair_local.cpp
index aa209f24542b0f2fd8408ba14e2ad2efb3988cbe..8c35f0170243719df5f995483ab2d752cf14ee83 100644
--- a/src/compute_pair_local.cpp
+++ b/src/compute_pair_local.cpp
@@ -34,7 +34,7 @@ using namespace LAMMPS_NS;
 ComputePairLocal::ComputePairLocal(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg < 4) error->all("Illegal compute pair/local command");
+  if (narg < 4) error->all(FLERR,"Illegal compute pair/local command");
 
   local_flag = 1;
   nvalues = narg - 3;
@@ -50,7 +50,7 @@ ComputePairLocal::ComputePairLocal(LAMMPS *lmp, int narg, char **arg) :
     if (strcmp(arg[iarg],"dist") == 0) dflag = nvalues++;
     else if (strcmp(arg[iarg],"eng") == 0) eflag = nvalues++;
     else if (strcmp(arg[iarg],"force") == 0) fflag = nvalues++;
-    else error->all("Invalid keyword in compute pair/local command");
+    else error->all(FLERR,"Invalid keyword in compute pair/local command");
   }
 
   nmax = 0;
@@ -71,9 +71,9 @@ ComputePairLocal::~ComputePairLocal()
 void ComputePairLocal::init()
 {
   if (force->pair == NULL) 
-    error->all("No pair style is defined for compute pair/local");
+    error->all(FLERR,"No pair style is defined for compute pair/local");
   if (force->pair->single_enable == 0)
-    error->all("Pair style does not support compute pair/local");
+    error->all(FLERR,"Pair style does not support compute pair/local");
 
   // need an occasional half neighbor list
 
diff --git a/src/compute_pe.cpp b/src/compute_pe.cpp
index 1d72d37fedf0e76960ba6e7cd65128c7c9c34c2b..c153e15d8ac0d223fd286f05dd5561309c040acb 100644
--- a/src/compute_pe.cpp
+++ b/src/compute_pe.cpp
@@ -34,8 +34,8 @@ using namespace LAMMPS_NS;
 ComputePE::ComputePE(LAMMPS *lmp, int narg, char **arg) : 
   Compute(lmp, narg, arg)
 {
-  if (narg < 3) error->all("Illegal compute pe command");
-  if (igroup) error->all("Compute pe must use group all");
+  if (narg < 3) error->all(FLERR,"Illegal compute pe command");
+  if (igroup) error->all(FLERR,"Compute pe must use group all");
 
   scalar_flag = 1;
   extscalar = 1;
@@ -60,7 +60,7 @@ ComputePE::ComputePE(LAMMPS *lmp, int narg, char **arg) :
       else if (strcmp(arg[iarg],"dihedral") == 0) dihedralflag = 1;
       else if (strcmp(arg[iarg],"improper") == 0) improperflag = 1;
       else if (strcmp(arg[iarg],"kspace") == 0) kspaceflag = 1;
-      else error->all("Illegal compute pe command");
+      else error->all(FLERR,"Illegal compute pe command");
       iarg++;
     }
   }
@@ -72,7 +72,7 @@ double ComputePE::compute_scalar()
 {
   invoked_scalar = update->ntimestep;
   if (update->eflag_global != invoked_scalar)
-    error->all("Energy was not tallied on needed timestep");
+    error->all(FLERR,"Energy was not tallied on needed timestep");
 
   double one = 0.0;
   if (pairflag && force->pair)
diff --git a/src/compute_pe_atom.cpp b/src/compute_pe_atom.cpp
index 3d424e61c253b401456160537222a2129ff34b44..20a16ae5b02468e6a3e9a8b36b88b3df2e5c2ba0 100755
--- a/src/compute_pe_atom.cpp
+++ b/src/compute_pe_atom.cpp
@@ -32,7 +32,7 @@ using namespace LAMMPS_NS;
 ComputePEAtom::ComputePEAtom(LAMMPS *lmp, int narg, char **arg) : 
   Compute(lmp, narg, arg)
 {
-  if (narg < 3) error->all("Illegal compute pe/atom command");
+  if (narg < 3) error->all(FLERR,"Illegal compute pe/atom command");
 
   peratom_flag = 1;
   size_peratom_cols = 0;
@@ -53,7 +53,7 @@ ComputePEAtom::ComputePEAtom(LAMMPS *lmp, int narg, char **arg) :
       else if (strcmp(arg[iarg],"angle") == 0) angleflag = 1;
       else if (strcmp(arg[iarg],"dihedral") == 0) dihedralflag = 1;
       else if (strcmp(arg[iarg],"improper") == 0) improperflag = 1;
-      else error->all("Illegal compute pe/atom command");
+      else error->all(FLERR,"Illegal compute pe/atom command");
       iarg++;
     }
   }
@@ -77,7 +77,7 @@ void ComputePEAtom::compute_peratom()
 
   invoked_peratom = update->ntimestep;
   if (update->eflag_atom != invoked_peratom)
-    error->all("Per-atom energy was not tallied on needed timestep");
+    error->all(FLERR,"Per-atom energy was not tallied on needed timestep");
 
   // grow local energy array if necessary
   // needs to be atom->nmax in length
diff --git a/src/compute_pressure.cpp b/src/compute_pressure.cpp
index 94391ce527311a5edb72f2745c01a53d46e69f54..edd6910cce69be50afb7c8eee943a562c2c67c88 100644
--- a/src/compute_pressure.cpp
+++ b/src/compute_pressure.cpp
@@ -36,8 +36,8 @@ using namespace LAMMPS_NS;
 ComputePressure::ComputePressure(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg < 4) error->all("Illegal compute pressure command");
-  if (igroup) error->all("Compute pressure must use group all");
+  if (narg < 4) error->all(FLERR,"Illegal compute pressure command");
+  if (igroup) error->all(FLERR,"Compute pressure must use group all");
 
   scalar_flag = vector_flag = 1;
   size_vector = 6;
@@ -55,9 +55,9 @@ ComputePressure::ComputePressure(LAMMPS *lmp, int narg, char **arg) :
 
   int icompute = modify->find_compute(id_temp);
   if (icompute < 0) 
-    error->all("Could not find compute pressure temperature ID");
+    error->all(FLERR,"Could not find compute pressure temperature ID");
   if (modify->compute[icompute]->tempflag == 0)
-    error->all("Compute pressure temperature ID does not compute temperature");
+    error->all(FLERR,"Compute pressure temperature ID does not compute temperature");
 
   // process optional args
 
@@ -85,7 +85,7 @@ ComputePressure::ComputePressure(LAMMPS *lmp, int narg, char **arg) :
 	pairflag = 1;
 	bondflag = angleflag = dihedralflag = improperflag = 1;
 	kspaceflag = fixflag = 1;
-      } else error->all("Illegal compute pressure command");
+      } else error->all(FLERR,"Illegal compute pressure command");
       iarg++;
     }
   }
@@ -117,7 +117,7 @@ void ComputePressure::init()
 
   int icompute = modify->find_compute(id_temp);
   if (icompute < 0) 
-    error->all("Could not find compute pressure temperature ID");
+    error->all(FLERR,"Could not find compute pressure temperature ID");
   temperature = modify->compute[icompute];
 
   // detect contributions to virial
@@ -166,7 +166,7 @@ double ComputePressure::compute_scalar()
 {
   invoked_scalar = update->ntimestep;
   if (update->vflag_global != invoked_scalar)
-    error->all("Virial was not tallied on needed timestep");
+    error->all(FLERR,"Virial was not tallied on needed timestep");
 
   // invoke temperature it it hasn't been already
 
@@ -207,7 +207,7 @@ void ComputePressure::compute_vector()
 {
   invoked_vector = update->ntimestep;
   if (update->vflag_global != invoked_vector)
-    error->all("Virial was not tallied on needed timestep");
+    error->all(FLERR,"Virial was not tallied on needed timestep");
 
   // invoke temperature if it hasn't been already
 
diff --git a/src/compute_property_atom.cpp b/src/compute_property_atom.cpp
index b145139d1919cca5a33c56989b6e35b7ed823df7..f7605d55523cad77753352e03e3013f179c4459a 100644
--- a/src/compute_property_atom.cpp
+++ b/src/compute_property_atom.cpp
@@ -27,7 +27,7 @@ using namespace LAMMPS_NS;
 ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg < 4) error->all("Illegal compute property/atom command");
+  if (narg < 4) error->all(FLERR,"Illegal compute property/atom command");
 
   peratom_flag = 1;
   nvalues = narg - 3;
@@ -47,7 +47,7 @@ ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) :
       pack_choice[i] = &ComputePropertyAtom::pack_id;
     } else if (strcmp(arg[iarg],"mol") == 0) {
       if (!atom->molecule_flag)
-	error->all("Compute property/atom for "
+	error->all(FLERR,"Compute property/atom for "
 		   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_molecule;
     } else if (strcmp(arg[iarg],"type") == 0) {
@@ -107,144 +107,144 @@ ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) :
 
     } else if (strcmp(arg[iarg],"q") == 0) {
       if (!atom->q_flag)
-	error->all("Compute property/atom for "
+	error->all(FLERR,"Compute property/atom for "
 		   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_q;
     } else if (strcmp(arg[iarg],"mux") == 0) {
       if (!atom->mu_flag)
-	error->all("Compute property/atom for "
+	error->all(FLERR,"Compute property/atom for "
 		   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_mux;
     } else if (strcmp(arg[iarg],"muy") == 0) {
       if (!atom->mu_flag)
-	error->all("Compute property/atom for "
+	error->all(FLERR,"Compute property/atom for "
 		   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_muy;
     } else if (strcmp(arg[iarg],"muz") == 0) {
       if (!atom->mu_flag)
-	error->all("Compute property/atom for "
+	error->all(FLERR,"Compute property/atom for "
 		   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_muz;
     } else if (strcmp(arg[iarg],"mu") == 0) {
       if (!atom->mu_flag)
-	error->all("Compute property/atom for "
+	error->all(FLERR,"Compute property/atom for "
 		   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_mu;
 
     } else if (strcmp(arg[iarg],"radius") == 0) {
       if (!atom->radius_flag)
-	error->all("Compute property/atom for "
+	error->all(FLERR,"Compute property/atom for "
 		   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_radius;
     } else if (strcmp(arg[iarg],"diameter") == 0) {
       if (!atom->radius_flag)
-	error->all("Compute property/atom for "
+	error->all(FLERR,"Compute property/atom for "
 		   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_diameter;
     } else if (strcmp(arg[iarg],"omegax") == 0) {
       if (!atom->omega_flag)
-	error->all("Compute property/atom for "
+	error->all(FLERR,"Compute property/atom for "
 		   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_omegax;
     } else if (strcmp(arg[iarg],"omegay") == 0) {
       if (!atom->omega_flag)
-	error->all("Compute property/atom for "
+	error->all(FLERR,"Compute property/atom for "
 		   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_omegay;
     } else if (strcmp(arg[iarg],"omegaz") == 0) {
       if (!atom->omega_flag)
-	error->all("Compute property/atom for "
+	error->all(FLERR,"Compute property/atom for "
 		   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_omegaz;
     } else if (strcmp(arg[iarg],"angmomx") == 0) {
       if (!atom->angmom_flag)
-	error->all("Compute property/atom for "
+	error->all(FLERR,"Compute property/atom for "
 		   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_angmomx;
     } else if (strcmp(arg[iarg],"angmomy") == 0) {
       if (!atom->angmom_flag)
-	error->all("Compute property/atom for "
+	error->all(FLERR,"Compute property/atom for "
 		   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_angmomy;
     } else if (strcmp(arg[iarg],"angmomz") == 0) {
       if (!atom->angmom_flag)
-	error->all("Compute property/atom for "
+	error->all(FLERR,"Compute property/atom for "
 		   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_angmomz;
 
     } else if (strcmp(arg[iarg],"shapex") == 0) {
       avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
-      if (!avec) error->all("Compute property/atom for "
+      if (!avec) error->all(FLERR,"Compute property/atom for "
 			    "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_shapex;
     } else if (strcmp(arg[iarg],"shapey") == 0) {
       avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
-      if (!avec) error->all("Compute property/atom for "
+      if (!avec) error->all(FLERR,"Compute property/atom for "
 			    "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_shapey;
     } else if (strcmp(arg[iarg],"shapez") == 0) {
       avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
-      if (!avec) error->all("Compute property/atom for "
+      if (!avec) error->all(FLERR,"Compute property/atom for "
 			    "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_shapez;
     } else if (strcmp(arg[iarg],"quatw") == 0) {
       avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
-      if (!avec) error->all("Compute property/atom for "
+      if (!avec) error->all(FLERR,"Compute property/atom for "
 			    "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_quatw;
     } else if (strcmp(arg[iarg],"quati") == 0) {
       avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
-      if (!avec) error->all("Compute property/atom for "
+      if (!avec) error->all(FLERR,"Compute property/atom for "
 			    "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_quati;
     } else if (strcmp(arg[iarg],"quatj") == 0) {
       avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
-      if (!avec) error->all("Compute property/atom for "
+      if (!avec) error->all(FLERR,"Compute property/atom for "
 			    "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_quatj;
     } else if (strcmp(arg[iarg],"quatk") == 0) {
       avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
-      if (!avec) error->all("Compute property/atom for "
+      if (!avec) error->all(FLERR,"Compute property/atom for "
 			    "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_quatk;
     } else if (strcmp(arg[iarg],"tqx") == 0) {
       if (!atom->torque_flag)
-	error->all("Compute property/atom for "
+	error->all(FLERR,"Compute property/atom for "
 		   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_tqx;
     } else if (strcmp(arg[iarg],"tqy") == 0) {
       if (!atom->torque_flag)
-	error->all("Compute property/atom for "
+	error->all(FLERR,"Compute property/atom for "
 		   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_tqy;
     } else if (strcmp(arg[iarg],"tqz") == 0) {
       if (!atom->torque_flag)
-	error->all("Compute property/atom for "
+	error->all(FLERR,"Compute property/atom for "
 		   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_tqz;
 
     } else if (strcmp(arg[iarg],"spin") == 0) {
       if (!atom->spin_flag)
-	error->all("Compute property/atom for "
+	error->all(FLERR,"Compute property/atom for "
 		   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_spin;
     } else if (strcmp(arg[iarg],"eradius") == 0) {
       if (!atom->eradius_flag)
-	error->all("Compute property/atom for "
+	error->all(FLERR,"Compute property/atom for "
 		   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_eradius;
     } else if (strcmp(arg[iarg],"ervel") == 0) {
       if (!atom->ervel_flag)
-	error->all("Compute property/atom for "
+	error->all(FLERR,"Compute property/atom for "
 		   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_ervel;
     } else if (strcmp(arg[iarg],"erforce") == 0) {
       if (!atom->erforce_flag)
-	error->all("Compute property/atom for "
+	error->all(FLERR,"Compute property/atom for "
 		   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_erforce;
 
-    } else error->all("Invalid keyword in compute property/atom command");
+    } else error->all(FLERR,"Invalid keyword in compute property/atom command");
   }
 
   nmax = 0;
diff --git a/src/compute_property_local.cpp b/src/compute_property_local.cpp
index a0e615bc41a3fab3c2af038edb7dbc7c76a6f7fa..48ab145d8c83d948642aa85bc1f3ce5217d892f7 100644
--- a/src/compute_property_local.cpp
+++ b/src/compute_property_local.cpp
@@ -35,7 +35,7 @@ enum{NONE,NEIGH,PAIR,BOND,ANGLE,DIHEDRAL,IMPROPER};
 ComputePropertyLocal::ComputePropertyLocal(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg < 4) error->all("Illegal compute property/local command");
+  if (narg < 4) error->all(FLERR,"Illegal compute property/local command");
 
   local_flag = 1;
   nvalues = narg - 3;
@@ -53,127 +53,127 @@ ComputePropertyLocal::ComputePropertyLocal(LAMMPS *lmp, int narg, char **arg) :
     if (strcmp(arg[iarg],"natom1") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_patom1;
       if (kindflag != NONE && kindflag != NEIGH) 
-	error->all("Compute property/local cannot use these inputs together");
+	error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = NEIGH;
     } else if (strcmp(arg[iarg],"natom2") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_patom2;
       if (kindflag != NONE && kindflag != NEIGH) 
-	error->all("Compute property/local cannot use these inputs together");
+	error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = NEIGH;
 
     } else if (strcmp(arg[iarg],"patom1") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_patom1;
       if (kindflag != NONE && kindflag != PAIR) 
-	error->all("Compute property/local cannot use these inputs together");
+	error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = PAIR;
     } else if (strcmp(arg[iarg],"patom2") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_patom2;
       if (kindflag != NONE && kindflag != PAIR) 
-	error->all("Compute property/local cannot use these inputs together");
+	error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = PAIR;
 
     } else if (strcmp(arg[iarg],"batom1") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_batom1;
       if (kindflag != NONE && kindflag != BOND) 
-	error->all("Compute property/local cannot use these inputs together");
+	error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = BOND;
     } else if (strcmp(arg[iarg],"batom2") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_batom2;
       if (kindflag != NONE && kindflag != BOND) 
-	error->all("Compute property/local cannot use these inputs together");
+	error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = BOND;
     } else if (strcmp(arg[iarg],"btype") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_btype;
       if (kindflag != NONE && kindflag != BOND) 
-	error->all("Compute property/local cannot use these inputs together");
+	error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = BOND;
 
     } else if (strcmp(arg[iarg],"aatom1") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_aatom1;
       if (kindflag != NONE && kindflag != ANGLE) 
-	error->all("Compute property/local cannot use these inputs together");
+	error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = ANGLE;
     } else if (strcmp(arg[iarg],"aatom2") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_aatom2;
       if (kindflag != NONE && kindflag != ANGLE) 
-	error->all("Compute property/local cannot use these inputs together");
+	error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = ANGLE;
     } else if (strcmp(arg[iarg],"aatom3") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_aatom3;
       if (kindflag != NONE && kindflag != ANGLE) 
-	error->all("Compute property/local cannot use these inputs together");
+	error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = ANGLE;
     } else if (strcmp(arg[iarg],"atype") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_atype;
       if (kindflag != NONE && kindflag != ANGLE) 
-	error->all("Compute property/local cannot use these inputs together");
+	error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = ANGLE;
 
     } else if (strcmp(arg[iarg],"datom1") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_datom1;
       if (kindflag != NONE && kindflag != DIHEDRAL) 
-	error->all("Compute property/local cannot use these inputs together");
+	error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = DIHEDRAL;
     } else if (strcmp(arg[iarg],"datom2") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_datom2;
       if (kindflag != NONE && kindflag != DIHEDRAL) 
-	error->all("Compute property/local cannot use these inputs together");
+	error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = DIHEDRAL;
     } else if (strcmp(arg[iarg],"datom3") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_datom3;
       if (kindflag != NONE && kindflag != DIHEDRAL) 
-	error->all("Compute property/local cannot use these inputs together");
+	error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = DIHEDRAL;
     } else if (strcmp(arg[iarg],"datom4") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_datom4;
       if (kindflag != NONE && kindflag != DIHEDRAL) 
-	error->all("Compute property/local cannot use these inputs together");
+	error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = DIHEDRAL;
     } else if (strcmp(arg[iarg],"dtype") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_dtype;
       if (kindflag != NONE && kindflag != DIHEDRAL) 
-	error->all("Compute property/local cannot use these inputs together");
+	error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = DIHEDRAL;
 
     } else if (strcmp(arg[iarg],"iatom1") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_iatom1;
       if (kindflag != NONE && kindflag != IMPROPER) 
-	error->all("Compute property/local cannot use these inputs together");
+	error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = IMPROPER;
     } else if (strcmp(arg[iarg],"iatom2") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_iatom2;
       if (kindflag != NONE && kindflag != IMPROPER) 
-	error->all("Compute property/local cannot use these inputs together");
+	error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = IMPROPER;
     } else if (strcmp(arg[iarg],"iatom3") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_iatom3;
       if (kindflag != NONE && kindflag != IMPROPER) 
-	error->all("Compute property/local cannot use these inputs together");
+	error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = IMPROPER;
     } else if (strcmp(arg[iarg],"iatom4") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_iatom4;
       if (kindflag != NONE && kindflag != IMPROPER) 
-	error->all("Compute property/local cannot use these inputs together");
+	error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = IMPROPER;
     } else if (strcmp(arg[iarg],"itype") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_itype;
       if (kindflag != NONE && kindflag != IMPROPER) 
-	error->all("Compute property/local cannot use these inputs together");
+	error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = IMPROPER;
 
-    } else error->all("Invalid keyword in compute property/local command");
+    } else error->all(FLERR,"Invalid keyword in compute property/local command");
   }
 
   // error check
 
   if (kindflag == BOND && atom->avec->bonds_allow == 0)
-    error->all("Compute property/local for property that isn't allocated");
+    error->all(FLERR,"Compute property/local for property that isn't allocated");
   if (kindflag == ANGLE && atom->avec->angles_allow == 0)
-    error->all("Compute property/local for property that isn't allocated");
+    error->all(FLERR,"Compute property/local for property that isn't allocated");
   if (kindflag == DIHEDRAL && atom->avec->dihedrals_allow == 0)
-    error->all("Compute property/local for property that isn't allocated");
+    error->all(FLERR,"Compute property/local for property that isn't allocated");
   if (kindflag == IMPROPER && atom->avec->impropers_allow == 0)
-    error->all("Compute property/local for property that isn't allocated");
+    error->all(FLERR,"Compute property/local for property that isn't allocated");
 
   nmax = 0;
   vector = NULL;
@@ -197,9 +197,9 @@ void ComputePropertyLocal::init()
 {
   if (kindflag == NEIGH || kindflag == PAIR) {
     if (force->pair == NULL) 
-      error->all("No pair style is defined for compute property/local");
+      error->all(FLERR,"No pair style is defined for compute property/local");
     if (force->pair->single_enable == 0)
-      error->all("Pair style does not support compute property/local");
+      error->all(FLERR,"Pair style does not support compute property/local");
   }
 
   // for NEIGH/PAIR need an occasional half neighbor list
diff --git a/src/compute_property_molecule.cpp b/src/compute_property_molecule.cpp
index 7ccf0208a1ea9bd07fd67d168bfd04a74c9e79cc..65ec20ef03aa946b86a01c3a73d2214cf5ad500c 100644
--- a/src/compute_property_molecule.cpp
+++ b/src/compute_property_molecule.cpp
@@ -26,10 +26,10 @@ ComputePropertyMolecule::
 ComputePropertyMolecule(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg < 4) error->all("Illegal compute property/molecule command");
+  if (narg < 4) error->all(FLERR,"Illegal compute property/molecule command");
 
   if (atom->molecular == 0)
-    error->all("Compute property/molecule requires molecular atom style");
+    error->all(FLERR,"Compute property/molecule requires molecular atom style");
 
   nvalues = narg - 3;
 
@@ -43,7 +43,7 @@ ComputePropertyMolecule(LAMMPS *lmp, int narg, char **arg) :
       pack_choice[i] = &ComputePropertyMolecule::pack_mol;
     else if (strcmp(arg[iarg],"count") == 0)
       pack_choice[i] = &ComputePropertyMolecule::pack_count;
-    else error->all("Invalid keyword in compute property/molecule command");
+    else error->all(FLERR,"Invalid keyword in compute property/molecule command");
   }
 
   // setup molecule-based data
@@ -93,7 +93,7 @@ void ComputePropertyMolecule::init()
 {
   int ntmp = molecules_in_group(idlo,idhi);
   if (ntmp != nmolecules)
-    error->all("Molecule count changed in compute property/molecule");
+    error->all(FLERR,"Molecule count changed in compute property/molecule");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/compute_rdf.cpp b/src/compute_rdf.cpp
index 96a11ab27326d2f2333fbabde8e6ae814aae03a0..9dbe3aded069de04dec87790c3ed97c407c8e7d9 100644
--- a/src/compute_rdf.cpp
+++ b/src/compute_rdf.cpp
@@ -38,13 +38,13 @@ using namespace LAMMPS_NS;
 ComputeRDF::ComputeRDF(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg < 4 || (narg-4) % 2) error->all("Illegal compute rdf command");
+  if (narg < 4 || (narg-4) % 2) error->all(FLERR,"Illegal compute rdf command");
 
   array_flag = 1;
   extarray = 0;
 
   nbin = atoi(arg[3]);
-  if (nbin < 1) error->all("Illegal compute rdf command");
+  if (nbin < 1) error->all(FLERR,"Illegal compute rdf command");
   if (narg == 4) npairs = 1;
   else npairs = (narg-4)/2;
 
@@ -71,7 +71,7 @@ ComputeRDF::ComputeRDF(LAMMPS *lmp, int narg, char **arg) :
       force->bounds(arg[iarg],atom->ntypes,ilo[npairs],ihi[npairs]);
       force->bounds(arg[iarg+1],atom->ntypes,jlo[npairs],jhi[npairs]);
       if (ilo[npairs] > ihi[npairs] || jlo[npairs] > jhi[npairs])
-	error->all("Illegal compute rdf command");
+	error->all(FLERR,"Illegal compute rdf command");
       npairs++;
       iarg += 2;
     }
@@ -120,7 +120,7 @@ void ComputeRDF::init()
   int i,m;
 
   if (force->pair) delr = force->pair->cutforce / nbin;
-  else error->all("Compute rdf requires a pair style be defined");
+  else error->all(FLERR,"Compute rdf requires a pair style be defined");
   delrinv = 1.0/delr;
 
   // set 1st column of output array to bin coords
diff --git a/src/compute_reduce.cpp b/src/compute_reduce.cpp
index 8764afe75b2690d1547b46c45a3e23283f6cd0ac..3872661a6765b9ebd76d482257be8b59ccd0b8d6 100644
--- a/src/compute_reduce.cpp
+++ b/src/compute_reduce.cpp
@@ -39,8 +39,6 @@ enum{PERATOM,LOCAL};
 #define INVOKED_PERATOM 8
 #define INVOKED_LOCAL 16
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
 #define BIG 1.0e20
 
 /* ---------------------------------------------------------------------- */
@@ -50,14 +48,14 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) :
 {
   int iarg;
   if (strcmp(style,"reduce") == 0) {
-    if (narg < 5) error->all("Illegal compute reduce command");
+    if (narg < 5) error->all(FLERR,"Illegal compute reduce command");
     idregion = NULL;
     iarg = 3;
   } else if (strcmp(style,"reduce/region") == 0) {
-    if (narg < 6) error->all("Illegal compute reduce/region command");
+    if (narg < 6) error->all(FLERR,"Illegal compute reduce/region command");
     iregion = domain->find_region(arg[3]);
     if (iregion == -1)
-      error->all("Region ID for compute reduce/region does not exist");
+      error->all(FLERR,"Region ID for compute reduce/region does not exist");
     int n = strlen(arg[3]) + 1;
     idregion = new char[n];
     strcpy(idregion,arg[3]);
@@ -68,7 +66,7 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) :
   else if (strcmp(arg[iarg],"min") == 0) mode = MINN;
   else if (strcmp(arg[iarg],"max") == 0) mode = MAXX;
   else if (strcmp(arg[iarg],"ave") == 0) mode = AVE;
-  else error->all("Illegal compute reduce command");
+  else error->all(FLERR,"Illegal compute reduce command");
   iarg++;
 
   MPI_Comm_rank(world,&me);
@@ -129,7 +127,7 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) :
       char *ptr = strchr(suffix,'[');
       if (ptr) {
 	if (suffix[strlen(suffix)-1] != ']')
-	  error->all("Illegal compute reduce command");
+	  error->all(FLERR,"Illegal compute reduce command");
 	argindex[nvalues] = atoi(ptr+1);
 	*ptr = '\0';
       } else argindex[nvalues] = 0;
@@ -152,19 +150,19 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) :
 
   while (iarg < narg) {
     if (strcmp(arg[iarg],"replace") == 0) {
-      if (iarg+3 > narg) error->all("Illegal compute reduce command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal compute reduce command");
       if (mode != MINN && mode != MAXX)
-	error->all("Compute reduce replace requires min or max mode");
+	error->all(FLERR,"Compute reduce replace requires min or max mode");
       int col1 = atoi(arg[iarg+1]) - 1;
       int col2 = atoi(arg[iarg+2]) - 1;
       if (col1 < 0 || col1 >= nvalues || col2 < 0 || col2 >= nvalues)
-	error->all("Illegal compute reduce command");
-      if (col1 == col2)	error->all("Illegal compute reduce command");
+	error->all(FLERR,"Illegal compute reduce command");
+      if (col1 == col2)	error->all(FLERR,"Illegal compute reduce command");
       if (replace[col1] >= 0 || replace[col2] >= 0)
-	error->all("Invalid replace values in compute reduce"); 
+	error->all(FLERR,"Invalid replace values in compute reduce"); 
       replace[col1] = col2;
       iarg += 3;
-    } else error->all("Illegal compute reduce command");
+    } else error->all(FLERR,"Illegal compute reduce command");
   }
 
   // delete replace if not set
@@ -186,69 +184,69 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) :
     else if (which[i] == COMPUTE) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all("Compute ID for compute reduce does not exist");
+	error->all(FLERR,"Compute ID for compute reduce does not exist");
       if (modify->compute[icompute]->peratom_flag) {
 	flavor[i] = PERATOM;
 	if (argindex[i] == 0 && 
 	    modify->compute[icompute]->size_peratom_cols != 0)
-	  error->all("Compute reduce compute does not "
+	  error->all(FLERR,"Compute reduce compute does not "
 		     "calculate a per-atom vector");
 	if (argindex[i] && modify->compute[icompute]->size_peratom_cols == 0)
-	  error->all("Compute reduce compute does not "
+	  error->all(FLERR,"Compute reduce compute does not "
 		     "calculate a per-atom array");
 	if (argindex[i] && 
 	    argindex[i] > modify->compute[icompute]->size_peratom_cols)
-	  error->all("Compute reduce compute array is accessed out-of-range");
+	  error->all(FLERR,"Compute reduce compute array is accessed out-of-range");
       } else if (modify->compute[icompute]->local_flag) {
 	flavor[i] = LOCAL;
 	if (argindex[i] == 0 && 
 	    modify->compute[icompute]->size_local_cols != 0)
-	  error->all("Compute reduce compute does not "
+	  error->all(FLERR,"Compute reduce compute does not "
 		     "calculate a local vector");
 	if (argindex[i] && modify->compute[icompute]->size_local_cols == 0)
-	  error->all("Compute reduce compute does not "
+	  error->all(FLERR,"Compute reduce compute does not "
 		     "calculate a local array");
 	if (argindex[i] && 
 	    argindex[i] > modify->compute[icompute]->size_local_cols)
-	  error->all("Compute reduce compute array is accessed out-of-range");
-      } else error->all("Compute reduce compute calculates global values");
+	  error->all(FLERR,"Compute reduce compute array is accessed out-of-range");
+      } else error->all(FLERR,"Compute reduce compute calculates global values");
 
     } else if (which[i] == FIX) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0)
-	error->all("Fix ID for compute reduce does not exist");
+	error->all(FLERR,"Fix ID for compute reduce does not exist");
       if (modify->fix[ifix]->peratom_flag) {
 	flavor[i] = PERATOM;
 	if (argindex[i] == 0 && 
 	    modify->fix[ifix]->size_peratom_cols != 0)
-	  error->all("Compute reduce fix does not "
+	  error->all(FLERR,"Compute reduce fix does not "
 		     "calculate a per-atom vector");
 	if (argindex[i] && modify->fix[ifix]->size_peratom_cols == 0)
-	  error->all("Compute reduce fix does not "
+	  error->all(FLERR,"Compute reduce fix does not "
 		     "calculate a per-atom array");
 	if (argindex[i] && 
 	    argindex[i] > modify->fix[ifix]->size_peratom_cols)
-	  error->all("Compute reduce fix array is accessed out-of-range");
+	  error->all(FLERR,"Compute reduce fix array is accessed out-of-range");
       } else if (modify->fix[ifix]->local_flag) {
 	flavor[i] = LOCAL;
 	if (argindex[i] == 0 && 
 	    modify->fix[ifix]->size_local_cols != 0)
-	  error->all("Compute reduce fix does not "
+	  error->all(FLERR,"Compute reduce fix does not "
 		     "calculate a local vector");
 	if (argindex[i] && modify->fix[ifix]->size_local_cols == 0)
-	  error->all("Compute reduce fix does not "
+	  error->all(FLERR,"Compute reduce fix does not "
 		     "calculate a local array");
 	if (argindex[i] && 
 	    argindex[i] > modify->fix[ifix]->size_local_cols)
-	  error->all("Compute reduce fix array is accessed out-of-range");
-      } else error->all("Compute reduce fix calculates global values");
+	  error->all(FLERR,"Compute reduce fix array is accessed out-of-range");
+      } else error->all(FLERR,"Compute reduce fix calculates global values");
 
     } else if (which[i] == VARIABLE) {
       int ivariable = input->variable->find(ids[i]);
       if (ivariable < 0)
-	error->all("Variable name for compute reduce does not exist");
+	error->all(FLERR,"Variable name for compute reduce does not exist");
       if (input->variable->atomstyle(ivariable) == 0)
-	error->all("Compute reduce variable is not atom-style variable");
+	error->all(FLERR,"Compute reduce variable is not atom-style variable");
       flavor[i] = PERATOM;
     }
   }
@@ -307,19 +305,19 @@ void ComputeReduce::init()
     if (which[m] == COMPUTE) {
       int icompute = modify->find_compute(ids[m]);
       if (icompute < 0)
-	error->all("Compute ID for compute reduce does not exist");
+	error->all(FLERR,"Compute ID for compute reduce does not exist");
       value2index[m] = icompute;
       
     } else if (which[m] == FIX) {
       int ifix = modify->find_fix(ids[m]);
       if (ifix < 0) 
-	error->all("Fix ID for compute reduce does not exist");
+	error->all(FLERR,"Fix ID for compute reduce does not exist");
       value2index[m] = ifix;
 
     } else if (which[m] == VARIABLE) {
       int ivariable = input->variable->find(ids[m]);
       if (ivariable < 0) 
-	error->all("Variable name for compute reduce does not exist");
+	error->all(FLERR,"Variable name for compute reduce does not exist");
       value2index[m] = ivariable;
 
     } else value2index[m] = -1;
@@ -330,7 +328,7 @@ void ComputeReduce::init()
   if (idregion) {
     iregion = domain->find_region(idregion);
     if (iregion == -1)
-      error->all("Region ID for compute reduce/region does not exist");
+      error->all(FLERR,"Region ID for compute reduce/region does not exist");
   }
 }
 
@@ -531,7 +529,7 @@ double ComputeReduce::compute_one(int m, int flag)
 
   } else if (which[m] == FIX) {
     if (update->ntimestep % modify->fix[vidx]->peratom_freq)
-      error->all("Fix used in compute reduce not computed at compatible time");
+      error->all(FLERR,"Fix used in compute reduce not computed at compatible time");
     Fix *fix = modify->fix[vidx];
 
     if (flavor[m] == PERATOM) {
diff --git a/src/compute_reduce_region.cpp b/src/compute_reduce_region.cpp
index eff9416b1cb1e2c6a73ca605e7424873093e4b2a..648b90e1d87dc12e2c0a485e3ebe908c586816df 100644
--- a/src/compute_reduce_region.cpp
+++ b/src/compute_reduce_region.cpp
@@ -156,7 +156,7 @@ double ComputeReduceRegion::compute_one(int m, int flag)
 
   } else if (which[m] == FIX) {
     if (update->ntimestep % modify->fix[n]->peratom_freq)
-      error->all("Fix used in compute reduce not computed at compatible time");
+      error->all(FLERR,"Fix used in compute reduce not computed at compatible time");
     Fix *fix = modify->fix[n];
 
     if (flavor[m] == PERATOM) {
diff --git a/src/compute_slice.cpp b/src/compute_slice.cpp
index 51e7747e369f2da7c851e5dbb5c3362730235a5b..85e92304992ded897a308dd5f8bcf399a1905893 100644
--- a/src/compute_slice.cpp
+++ b/src/compute_slice.cpp
@@ -33,7 +33,7 @@ enum{COMPUTE,FIX};
 ComputeSlice::ComputeSlice(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg < 7) error->all("Illegal compute slice command");
+  if (narg < 7) error->all(FLERR,"Illegal compute slice command");
 
   MPI_Comm_rank(world,&me);
 
@@ -42,7 +42,7 @@ ComputeSlice::ComputeSlice(LAMMPS *lmp, int narg, char **arg) :
   nskip = atoi(arg[5]);
 
   if (nstart < 1 || nstop < nstart || nskip < 1)
-    error->all("Illegal compute slice command");
+    error->all(FLERR,"Illegal compute slice command");
 
   // parse remaining values until one isn't recognized
 
@@ -65,7 +65,7 @@ ComputeSlice::ComputeSlice(LAMMPS *lmp, int narg, char **arg) :
       char *ptr = strchr(suffix,'[');
       if (ptr) {
 	if (suffix[strlen(suffix)-1] != ']')
-	  error->all("Illegal compute slice command");
+	  error->all(FLERR,"Illegal compute slice command");
 	argindex[nvalues] = atoi(ptr+1);
 	*ptr = '\0';
       } else argindex[nvalues] = 0;
@@ -76,7 +76,7 @@ ComputeSlice::ComputeSlice(LAMMPS *lmp, int narg, char **arg) :
       nvalues++;
       delete [] suffix;
 
-    } else error->all("Illegal compute slice command");
+    } else error->all(FLERR,"Illegal compute slice command");
   }
 
   // setup and error check
@@ -85,38 +85,38 @@ ComputeSlice::ComputeSlice(LAMMPS *lmp, int narg, char **arg) :
     if (which[i] == COMPUTE) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all("Compute ID for compute slice does not exist");
+	error->all(FLERR,"Compute ID for compute slice does not exist");
       if (modify->compute[icompute]->vector_flag) {
 	if (argindex[i])
-	  error->all("Compute slice compute does not calculate a global array");
+	  error->all(FLERR,"Compute slice compute does not calculate a global array");
 	if (nstop > modify->compute[icompute]->size_vector)
-	  error->all("Compute slice compute vector is accessed out-of-range");
+	  error->all(FLERR,"Compute slice compute vector is accessed out-of-range");
       } else if (modify->compute[icompute]->array_flag) {
 	if (argindex[i] == 0)
-	  error->all("Compute slice compute does not calculate a global vector");
+	  error->all(FLERR,"Compute slice compute does not calculate a global vector");
 	if (argindex[i] > modify->compute[icompute]->size_array_cols)
-	  error->all("Compute slice compute array is accessed out-of-range");
+	  error->all(FLERR,"Compute slice compute array is accessed out-of-range");
 	if (nstop > modify->compute[icompute]->size_array_rows)
-	  error->all("Compute slice compute array is accessed out-of-range");
-      } else error->all("Compute slice compute does not calculate "
+	  error->all(FLERR,"Compute slice compute array is accessed out-of-range");
+      } else error->all(FLERR,"Compute slice compute does not calculate "
 			"global vector or array");
     } else if (which[i] == FIX) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0)
-	error->all("Fix ID for compute slice does not exist");
+	error->all(FLERR,"Fix ID for compute slice does not exist");
       if (modify->fix[ifix]->vector_flag) {
 	if (argindex[i])
-	  error->all("Compute slice fix does not calculate a global array");
+	  error->all(FLERR,"Compute slice fix does not calculate a global array");
 	if (nstop > modify->fix[ifix]->size_vector)
-	  error->all("Compute slice fix vector is accessed out-of-range");
+	  error->all(FLERR,"Compute slice fix vector is accessed out-of-range");
       } else if (modify->fix[ifix]->array_flag) {
 	if (argindex[i] == 0) 
-	  error->all("Compute slice fix does not calculate a global vector");
+	  error->all(FLERR,"Compute slice fix does not calculate a global vector");
 	if (argindex[i] > modify->fix[ifix]->size_array_cols)
-	  error->all("Compute slice fix array is accessed out-of-range");
+	  error->all(FLERR,"Compute slice fix array is accessed out-of-range");
 	if (nstop > modify->fix[ifix]->size_array_rows)
-	  error->all("Compute slice fix array is accessed out-of-range");
-      } else error->all("Compute slice fix does not calculate "
+	  error->all(FLERR,"Compute slice fix array is accessed out-of-range");
+      } else error->all(FLERR,"Compute slice fix does not calculate "
 			"global vector or array");
     }
   }
@@ -217,12 +217,12 @@ void ComputeSlice::init()
     if (which[m] == COMPUTE) {
       int icompute = modify->find_compute(ids[m]);
       if (icompute < 0)
-	error->all("Compute ID for compute slice does not exist");
+	error->all(FLERR,"Compute ID for compute slice does not exist");
       value2index[m] = icompute;
     } else if (which[m] == FIX) {
       int ifix = modify->find_fix(ids[m]);
       if (ifix < 0) 
-	error->all("Fix ID for compute slice does not exist");
+	error->all(FLERR,"Fix ID for compute slice does not exist");
       value2index[m] = ifix;
     }
   }
@@ -291,7 +291,7 @@ void ComputeSlice::extract_one(int m, double *vec, int stride)
     
   } else if (which[m] == FIX) {
     if (update->ntimestep % modify->fix[value2index[m]]->global_freq)
-      error->all("Fix used in compute slice not computed at compatible time");
+      error->all(FLERR,"Fix used in compute slice not computed at compatible time");
     Fix *fix = modify->fix[value2index[m]];
 
     if (argindex[m] == 0) {
diff --git a/src/compute_stress_atom.cpp b/src/compute_stress_atom.cpp
index b17d4fc6a223a967395faa3bf208bb6396ca9178..55602212251ff7fe37ce3e5c7a849e63bc4452d7 100644
--- a/src/compute_stress_atom.cpp
+++ b/src/compute_stress_atom.cpp
@@ -35,7 +35,7 @@ using namespace LAMMPS_NS;
 ComputeStressAtom::ComputeStressAtom(LAMMPS *lmp, int narg, char **arg) : 
   Compute(lmp, narg, arg)
 {
-  if (narg < 3) error->all("Illegal compute stress/atom command");
+  if (narg < 3) error->all(FLERR,"Illegal compute stress/atom command");
 
   peratom_flag = 1;
   size_peratom_cols = 6;
@@ -66,7 +66,7 @@ ComputeStressAtom::ComputeStressAtom(LAMMPS *lmp, int narg, char **arg) :
 	pairflag = 1;
 	bondflag = angleflag = dihedralflag = improperflag = 1;
 	fixflag = 1;
-      } else error->all("Illegal compute stress/atom command");
+      } else error->all(FLERR,"Illegal compute stress/atom command");
       iarg++;
     }
   }
@@ -91,7 +91,7 @@ void ComputeStressAtom::compute_peratom()
 
   invoked_peratom = update->ntimestep;
   if (update->vflag_atom != invoked_peratom)
-    error->all("Per-atom virial was not tallied on needed timestep");
+    error->all(FLERR,"Per-atom virial was not tallied on needed timestep");
 
   // grow local stress array if necessary
   // needs to be atom->nmax in length
diff --git a/src/compute_temp.cpp b/src/compute_temp.cpp
index 5ba16633f470a69b489004e8fb274df3509ec9c1..ab63a8c9f644fe399494e1705ecfd532c3e916b4 100644
--- a/src/compute_temp.cpp
+++ b/src/compute_temp.cpp
@@ -30,7 +30,7 @@ using namespace LAMMPS_NS;
 ComputeTemp::ComputeTemp(LAMMPS *lmp, int narg, char **arg) : 
   Compute(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Illegal compute temp command");
+  if (narg != 3) error->all(FLERR,"Illegal compute temp command");
 
   scalar_flag = vector_flag = 1;
   size_vector = 6;
diff --git a/src/compute_temp_com.cpp b/src/compute_temp_com.cpp
index 22cfab76108bb521447ea3f09232f356c7ac26af..d344d3d2148ef9164d66f78ef897f51c9a02ac6a 100644
--- a/src/compute_temp_com.cpp
+++ b/src/compute_temp_com.cpp
@@ -27,15 +27,12 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 ComputeTempCOM::ComputeTempCOM(LAMMPS *lmp, int narg, char **arg) : 
   Compute(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Illegal compute temp command");
+  if (narg != 3) error->all(FLERR,"Illegal compute temp command");
 
   scalar_flag = vector_flag = 1;
   size_vector = 6;
diff --git a/src/compute_temp_deform.cpp b/src/compute_temp_deform.cpp
index 665f904fdb1ec024245fe8afb7248db1da5f1bdf..87fcb02eae469a5e729e74b36b42e8e52a8feccd 100644
--- a/src/compute_temp_deform.cpp
+++ b/src/compute_temp_deform.cpp
@@ -39,7 +39,7 @@ enum{NO_REMAP,X_REMAP,V_REMAP};                   // same as fix_deform.cpp
 ComputeTempDeform::ComputeTempDeform(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Illegal compute temp/deform command");
+  if (narg != 3) error->all(FLERR,"Illegal compute temp/deform command");
 
   scalar_flag = vector_flag = 1;
   size_vector = 6;
@@ -78,12 +78,12 @@ void ComputeTempDeform::init()
     if (strcmp(modify->fix[i]->style,"deform") == 0) {
       if (((FixDeform *) modify->fix[i])->remapflag == X_REMAP && 
 	  comm->me == 0)
-	error->warning("Using compute temp/deform with inconsistent "
+	error->warning(FLERR,"Using compute temp/deform with inconsistent "
 		       "fix deform remap option");
       break;
     }
   if (i == modify->nfix && comm->me == 0)
-    error->warning("Using compute temp/deform with no fix deform defined");
+    error->warning(FLERR,"Using compute temp/deform with no fix deform defined");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/compute_temp_partial.cpp b/src/compute_temp_partial.cpp
index 96fd04037c24b6fff3d1fb610e8970f8600b9eb9..bfb2088e5608b3c4b4aa32b005a6b3abf79a2914 100644
--- a/src/compute_temp_partial.cpp
+++ b/src/compute_temp_partial.cpp
@@ -31,7 +31,7 @@ using namespace LAMMPS_NS;
 ComputeTempPartial::ComputeTempPartial(LAMMPS *lmp, int narg, char **arg) : 
   Compute(lmp, narg, arg)
 {
-  if (narg != 6) error->all("Illegal compute temp/partial command");
+  if (narg != 6) error->all(FLERR,"Illegal compute temp/partial command");
 
   scalar_flag = vector_flag = 1;
   size_vector = 6;
@@ -44,7 +44,7 @@ ComputeTempPartial::ComputeTempPartial(LAMMPS *lmp, int narg, char **arg) :
   yflag = atoi(arg[4]);
   zflag = atoi(arg[5]);
   if (zflag && domain->dimension == 2)
-    error->all("Compute temp/partial cannot use vz for 2d systemx");
+    error->all(FLERR,"Compute temp/partial cannot use vz for 2d systemx");
 
   maxbias = 0;
   vbiasall = NULL;
diff --git a/src/compute_temp_profile.cpp b/src/compute_temp_profile.cpp
index 399b897df8ec70b52ed0cea2b5638fe361467983..a242aba339e1626bcefd9fac7c29f04983a32749 100644
--- a/src/compute_temp_profile.cpp
+++ b/src/compute_temp_profile.cpp
@@ -27,15 +27,12 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 ComputeTempProfile::ComputeTempProfile(LAMMPS *lmp, int narg, char **arg) : 
   Compute(lmp, narg, arg)
 {
-  if (narg < 7) error->all("Illegal compute temp/profile command");
+  if (narg < 7) error->all(FLERR,"Illegal compute temp/profile command");
 
   scalar_flag = vector_flag = 1;
   size_vector = 6;
@@ -48,7 +45,7 @@ ComputeTempProfile::ComputeTempProfile(LAMMPS *lmp, int narg, char **arg) :
   yflag = atoi(arg[4]);
   zflag = atoi(arg[5]);
   if (zflag && domain->dimension == 2)
-    error->all("Compute temp/profile cannot use vz for 2d systemx");
+    error->all(FLERR,"Compute temp/profile cannot use vz for 2d systemx");
 
   ncount = 0;
   ivx = ivy = ivz = 0;
@@ -59,43 +56,43 @@ ComputeTempProfile::ComputeTempProfile(LAMMPS *lmp, int narg, char **arg) :
   nbinx = nbiny = nbinz = 1;
 
   if (strcmp(arg[6],"x") == 0) {
-    if (narg != 8) error->all("Illegal compute temp/profile command");
+    if (narg != 8) error->all(FLERR,"Illegal compute temp/profile command");
     nbinx = atoi(arg[7]);
   } else if (strcmp(arg[6],"y") == 0) {
-    if (narg != 8) error->all("Illegal compute temp/profile command");
+    if (narg != 8) error->all(FLERR,"Illegal compute temp/profile command");
     nbiny = atoi(arg[7]);
   } else if (strcmp(arg[6],"z") == 0) {
-    if (narg != 8) error->all("Illegal compute temp/profile command");
+    if (narg != 8) error->all(FLERR,"Illegal compute temp/profile command");
     if (domain->dimension == 2)
-      error->all("Compute temp/profile cannot bin z for 2d systems");
+      error->all(FLERR,"Compute temp/profile cannot bin z for 2d systems");
     nbinz = atoi(arg[7]);
   } else if (strcmp(arg[6],"xy") == 0) {
-    if (narg != 9) error->all("Illegal compute temp/profile command");
+    if (narg != 9) error->all(FLERR,"Illegal compute temp/profile command");
     nbinx = atoi(arg[7]);
     nbiny = atoi(arg[8]);
   } else if (strcmp(arg[6],"yz") == 0) {
-    if (narg != 9) error->all("Illegal compute temp/profile command");
+    if (narg != 9) error->all(FLERR,"Illegal compute temp/profile command");
     if (domain->dimension == 2)
-      error->all("Compute temp/profile cannot bin z for 2d systems");
+      error->all(FLERR,"Compute temp/profile cannot bin z for 2d systems");
     nbiny = atoi(arg[7]);
     nbinz = atoi(arg[8]);
   } else if (strcmp(arg[6],"xz") == 0) {
-    if (narg != 9) error->all("Illegal compute temp/profile command");
+    if (narg != 9) error->all(FLERR,"Illegal compute temp/profile command");
     if (domain->dimension == 2)
-      error->all("Compute temp/profile cannot bin z for 2d systems");
+      error->all(FLERR,"Compute temp/profile cannot bin z for 2d systems");
     nbinx = atoi(arg[7]);
     nbinz = atoi(arg[8]);
   } else if (strcmp(arg[6],"xyz") == 0) {
-    if (narg != 10) error->all("Illegal compute temp/profile command");
+    if (narg != 10) error->all(FLERR,"Illegal compute temp/profile command");
     if (domain->dimension == 2)
-      error->all("Compute temp/profile cannot bin z for 2d systems");
+      error->all(FLERR,"Compute temp/profile cannot bin z for 2d systems");
     nbinx = atoi(arg[7]);
     nbiny = atoi(arg[8]);
     nbinz = atoi(arg[9]);
-  } else error->all("Illegal compute temp/profile command");
+  } else error->all(FLERR,"Illegal compute temp/profile command");
 
   nbins = nbinx*nbiny*nbinz;
-  if (nbins <= 0) error->all("Illegal compute temp/profile command");
+  if (nbins <= 0) error->all(FLERR,"Illegal compute temp/profile command");
 
   memory->create(vbin,nbins,ncount+1,"temp/profile:vbin");
   memory->create(binave,nbins,ncount+1,"temp/profile:binave");
diff --git a/src/compute_temp_ramp.cpp b/src/compute_temp_ramp.cpp
index 1690e1224c2bf32060866f9a9e42a903e266c6cc..135a3eea6db834e78ae4457621c8e7919e0e861f 100644
--- a/src/compute_temp_ramp.cpp
+++ b/src/compute_temp_ramp.cpp
@@ -28,15 +28,12 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 ComputeTempRamp::ComputeTempRamp(LAMMPS *lmp, int narg, char **arg) : 
   Compute(lmp, narg, arg)
 {
-  if (narg < 9) error->all("Illegal compute temp command");
+  if (narg < 9) error->all(FLERR,"Illegal compute temp command");
 
   scalar_flag = vector_flag = 1;
   size_vector = 6;
@@ -52,18 +49,18 @@ ComputeTempRamp::ComputeTempRamp(LAMMPS *lmp, int narg, char **arg) :
   int iarg = 9;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"units") == 0) {
-      if (iarg+2 > narg) error->all("Illegal compute temp/ramp command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal compute temp/ramp command");
       if (strcmp(arg[iarg+1],"box") == 0) scaleflag = 0;
       else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1;
-      else error->all("Illegal compute temp/ramp command");
+      else error->all(FLERR,"Illegal compute temp/ramp command");
       iarg += 2;
-    } else error->all("Illegal compute temp/ramp command");
+    } else error->all(FLERR,"Illegal compute temp/ramp command");
   }
 
   // setup scaling
 
   if (scaleflag && domain->lattice == NULL)
-    error->all("Use of compute temp/ramp with undefined lattice");
+    error->all(FLERR,"Use of compute temp/ramp with undefined lattice");
 
   if (scaleflag) {
     xscale = domain->lattice->xlattice;
@@ -77,7 +74,7 @@ ComputeTempRamp::ComputeTempRamp(LAMMPS *lmp, int narg, char **arg) :
   if (strcmp(arg[3],"vx") == 0) v_dim = 0;
   else if (strcmp(arg[3],"vy") == 0) v_dim = 1;
   else if (strcmp(arg[3],"vz") == 0) v_dim = 2;
-  else error->all("Illegal compute temp/ramp command");
+  else error->all(FLERR,"Illegal compute temp/ramp command");
 
   if (v_dim == 0) {
     v_lo = xscale*atof(arg[4]);
@@ -93,7 +90,7 @@ ComputeTempRamp::ComputeTempRamp(LAMMPS *lmp, int narg, char **arg) :
   if (strcmp(arg[6],"x") == 0) coord_dim = 0;
   else if (strcmp(arg[6],"y") == 0) coord_dim = 1;
   else if (strcmp(arg[6],"z") == 0) coord_dim = 2;
-  else error->all("Illegal compute temp/ramp command");
+  else error->all(FLERR,"Illegal compute temp/ramp command");
 
   if (coord_dim == 0) {
     coord_lo = xscale*atof(arg[7]);
diff --git a/src/compute_temp_region.cpp b/src/compute_temp_region.cpp
index b43af45de348fb8402e93ace6febf9ebe1fcb60e..964f162d9fc66d3ce5efa13ea03d3888ac4d0e15 100644
--- a/src/compute_temp_region.cpp
+++ b/src/compute_temp_region.cpp
@@ -30,11 +30,11 @@ using namespace LAMMPS_NS;
 ComputeTempRegion::ComputeTempRegion(LAMMPS *lmp, int narg, char **arg) : 
   Compute(lmp, narg, arg)
 {
-  if (narg != 4) error->all("Illegal compute temp/region command");
+  if (narg != 4) error->all(FLERR,"Illegal compute temp/region command");
 
   iregion = domain->find_region(arg[3]);
   if (iregion == -1) 
-    error->all("Region ID for compute temp/region does not exist");
+    error->all(FLERR,"Region ID for compute temp/region does not exist");
   int n = strlen(arg[3]) + 1;
   idregion = new char[n];
   strcpy(idregion,arg[3]);
@@ -68,7 +68,7 @@ void ComputeTempRegion::init()
 
   iregion = domain->find_region(idregion);
   if (iregion == -1)
-    error->all("Region ID for compute temp/region does not exist");
+    error->all(FLERR,"Region ID for compute temp/region does not exist");
 
   dof = 0.0;
 }
diff --git a/src/compute_temp_sphere.cpp b/src/compute_temp_sphere.cpp
index 246d58bae4d8bb712f29b0fef8adad25a51993b8..ed4a25008514679497648095e6c5a02037954539 100644
--- a/src/compute_temp_sphere.cpp
+++ b/src/compute_temp_sphere.cpp
@@ -35,7 +35,7 @@ enum{ROTATE,ALL};
 ComputeTempSphere::ComputeTempSphere(LAMMPS *lmp, int narg, char **arg) : 
   Compute(lmp, narg, arg)
 {
-  if (narg < 3) error->all("Illegal compute temp/sphere command");
+  if (narg < 3) error->all(FLERR,"Illegal compute temp/sphere command");
 
   scalar_flag = vector_flag = 1;
   size_vector = 6;
@@ -50,19 +50,19 @@ ComputeTempSphere::ComputeTempSphere(LAMMPS *lmp, int narg, char **arg) :
   int iarg = 3;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"bias") == 0) {
-      if (iarg+2 > narg) error->all("Illegal compute temp/sphere command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal compute temp/sphere command");
       tempbias = 1;
       int n = strlen(arg[iarg+1]) + 1;
       id_bias = new char[n];
       strcpy(id_bias,arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"dof") == 0) {
-      if (iarg+2 > narg) error->all("Illegal compute temp/sphere command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal compute temp/sphere command");
       if (strcmp(arg[iarg+1],"rotate") == 0) mode = ROTATE;
       else if (strcmp(arg[iarg+1],"all") == 0) mode = ALL;
-      else error->all("Illegal compute temp/sphere command");
+      else error->all(FLERR,"Illegal compute temp/sphere command");
       iarg += 2;
-    } else error->all("Illegal compute temp/sphere command");
+    } else error->all(FLERR,"Illegal compute temp/sphere command");
   }
 
   vector = new double[6];
@@ -70,7 +70,7 @@ ComputeTempSphere::ComputeTempSphere(LAMMPS *lmp, int narg, char **arg) :
   // error checks
 
   if (!atom->sphere_flag) 
-    error->all("Compute temp/sphere requires atom style sphere");
+    error->all(FLERR,"Compute temp/sphere requires atom style sphere");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -87,14 +87,14 @@ void ComputeTempSphere::init()
 {
   if (tempbias) {
     int i = modify->find_compute(id_bias);
-    if (i < 0) error->all("Could not find compute ID for temperature bias");
+    if (i < 0) error->all(FLERR,"Could not find compute ID for temperature bias");
     tbias = modify->compute[i];
     if (tbias->tempflag == 0)
-      error->all("Bias compute does not calculate temperature");
+      error->all(FLERR,"Bias compute does not calculate temperature");
     if (tbias->tempbias == 0)
-      error->all("Bias compute does not calculate a velocity bias");
+      error->all(FLERR,"Bias compute does not calculate a velocity bias");
     if (tbias->igroup != igroup)
-      error->all("Bias compute group does not match compute group");
+      error->all(FLERR,"Bias compute group does not match compute group");
     tbias->init();
     if (strcmp(tbias->style,"temp/region") == 0) tempbias = 2;
     else tempbias = 1;
diff --git a/src/compute_ti.cpp b/src/compute_ti.cpp
index fd2a83ae0e02163126b8a74913c2852f616b7413..035fb35767d47d80a098aaac877f0a85bb54294d 100644
--- a/src/compute_ti.cpp
+++ b/src/compute_ti.cpp
@@ -37,7 +37,7 @@ enum{PAIR,TAIL,KSPACE};
 ComputeTI::ComputeTI(LAMMPS *lmp, int narg, char **arg) : 
   Compute(lmp, narg, arg) 
 { 
-  if (narg < 4) error->all("Illegal compute ti command");
+  if (narg < 4) error->all(FLERR,"Illegal compute ti command");
 
   peflag = 1;
   scalar_flag = 1;
@@ -47,7 +47,7 @@ ComputeTI::ComputeTI(LAMMPS *lmp, int narg, char **arg) :
   // terms come in triplets
 
   nterms = (narg-3) / 3;
-  if (narg != 3*nterms + 3) error->all("Illegal compute ti command");
+  if (narg != 3*nterms + 3) error->all(FLERR,"Illegal compute ti command");
 
   which = new int[nterms];
   ivar1 = new int[nterms];
@@ -65,7 +65,7 @@ ComputeTI::ComputeTI(LAMMPS *lmp, int narg, char **arg) :
 
   int iarg = 3;
   while (iarg < narg) {
-    if (iarg+3 > narg) error->all("Illegal compute ti command");
+    if (iarg+3 > narg) error->all(FLERR,"Illegal compute ti command");
     if (strcmp(arg[iarg],"kspace") == 0) which[nterms] = KSPACE;
     else if (strcmp(arg[iarg],"tail") == 0) which[nterms] = TAIL;
     else {
@@ -79,12 +79,12 @@ ComputeTI::ComputeTI(LAMMPS *lmp, int narg, char **arg) :
       int n = strlen(&arg[iarg+1][2]) + 1;
       var1[nterms] = new char[n];
       strcpy(var1[nterms],&arg[iarg+1][2]);
-    } else error->all("Illegal compute ti command");
+    } else error->all(FLERR,"Illegal compute ti command");
     if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
       int n = strlen(&arg[iarg+2][2]) + 1;
       var2[nterms] = new char[n];
       strcpy(var2[nterms],&arg[iarg+2][2]);
-    } else error->all("Illegal compute ti command");
+    } else error->all(FLERR,"Illegal compute ti command");
 
     nterms++;
     iarg += 3;
@@ -119,23 +119,23 @@ void ComputeTI::init()
     ivar1[m] = input->variable->find(var1[m]);
     ivar2[m] = input->variable->find(var2[m]);
     if (ivar1[m] < 0 || ivar2 < 0)
-      error->all("Variable name for compute ti does not exist");
+      error->all(FLERR,"Variable name for compute ti does not exist");
     if (!input->variable->equalstyle(ivar1[m]) ||
 	!input->variable->equalstyle(ivar2[m]))
-      error->all("Variable for compute ti is invalid style");
+      error->all(FLERR,"Variable for compute ti is invalid style");
 
     if (which[m] == PAIR) {
       pptr[m] = force->pair_match(pstyle[m],1);
-      if (pptr[m] == NULL) error->all("Compute ti pair style does not exist");
+      if (pptr[m] == NULL) error->all(FLERR,"Compute ti pair style does not exist");
 
     } else if (which[m] == TAIL) {
       if (force->pair == NULL || force->pair->tail_flag == 0) 
-	error->all("Compute ti tail when pair style does not "
+	error->all(FLERR,"Compute ti tail when pair style does not "
 		   "compute tail corrections");
 
     } else if (which[m] == KSPACE) {
       if (force->kspace == NULL) 
-	error->all("Compute ti kspace style does not exist");
+	error->all(FLERR,"Compute ti kspace style does not exist");
     }
   }
 }
@@ -148,7 +148,7 @@ double ComputeTI::compute_scalar()
 
   invoked_scalar = update->ntimestep;
   if (update->eflag_global != invoked_scalar)
-    error->all("Energy was not tallied on needed timestep");
+    error->all(FLERR,"Energy was not tallied on needed timestep");
 
   double dUdl = 0.0;
 
diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp
index 1f7d3ef655bbe485fea7c40482e228613aca7a76..c1cdc6d83d5958af16afc1ca6ed5f11a0c2da8c1 100644
--- a/src/create_atoms.cpp
+++ b/src/create_atoms.cpp
@@ -34,9 +34,6 @@ using namespace LAMMPS_NS;
 
 enum{BOX,REGION,SINGLE,RANDOM};
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 CreateAtoms::CreateAtoms(LAMMPS *lmp) : Pointers(lmp) {}
@@ -46,17 +43,17 @@ CreateAtoms::CreateAtoms(LAMMPS *lmp) : Pointers(lmp) {}
 void CreateAtoms::command(int narg, char **arg)
 {
   if (domain->box_exist == 0) 
-    error->all("Create_atoms command before simulation box is defined");
+    error->all(FLERR,"Create_atoms command before simulation box is defined");
   if (modify->nfix_restart_peratom) 
-    error->all("Cannot create_atoms after "
+    error->all(FLERR,"Cannot create_atoms after "
 	       "reading restart file with per-atom info");
 
   // parse arguments
 
-  if (narg < 2) error->all("Illegal create_atoms command");
+  if (narg < 2) error->all(FLERR,"Illegal create_atoms command");
   itype = atoi(arg[0]);
   if (itype <= 0 || itype > atom->ntypes) 
-    error->all("Invalid atom type in create_atoms command");
+    error->all(FLERR,"Invalid atom type in create_atoms command");
 
   int iarg;
   if (strcmp(arg[1],"box") == 0) {
@@ -64,29 +61,29 @@ void CreateAtoms::command(int narg, char **arg)
     iarg = 2;
   } else if (strcmp(arg[1],"region") == 0) {
     style = REGION;
-    if (narg < 3) error->all("Illegal create_atoms command");
+    if (narg < 3) error->all(FLERR,"Illegal create_atoms command");
     nregion = domain->find_region(arg[2]);
-    if (nregion == -1) error->all("Create_atoms region ID does not exist");
+    if (nregion == -1) error->all(FLERR,"Create_atoms region ID does not exist");
     iarg = 3;;
   } else if (strcmp(arg[1],"single") == 0) {
     style = SINGLE;
-    if (narg < 5) error->all("Illegal create_atoms command");
+    if (narg < 5) error->all(FLERR,"Illegal create_atoms command");
     xone[0] = atof(arg[2]);
     xone[1] = atof(arg[3]);
     xone[2] = atof(arg[4]);
     iarg = 5;
   } else if (strcmp(arg[1],"random") == 0) {
     style = RANDOM;
-    if (narg < 5) error->all("Illegal create_atoms command");
+    if (narg < 5) error->all(FLERR,"Illegal create_atoms command");
     nrandom = atoi(arg[2]);
     seed = atoi(arg[3]);
     if (strcmp(arg[4],"NULL") == 0) nregion = -1;
     else {
       nregion = domain->find_region(arg[4]);
-      if (nregion == -1) error->all("Create_atoms region ID does not exist");
+      if (nregion == -1) error->all(FLERR,"Create_atoms region ID does not exist");
     }
     iarg = 5;
-  } else error->all("Illegal create_atoms command");
+  } else error->all(FLERR,"Illegal create_atoms command");
 
   // process optional keywords
 
@@ -100,30 +97,30 @@ void CreateAtoms::command(int narg, char **arg)
 
   while (iarg < narg) {
     if (strcmp(arg[iarg],"basis") == 0) {
-      if (iarg+3 > narg) error->all("Illegal create_atoms command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal create_atoms command");
       if (domain->lattice == NULL)
-	error->all("Cannot create atoms with undefined lattice");
+	error->all(FLERR,"Cannot create atoms with undefined lattice");
       int ibasis = atoi(arg[iarg+1]);
       itype = atoi(arg[iarg+2]);
       if (ibasis <= 0 || ibasis > nbasis || 
 	  itype <= 0 || itype > atom->ntypes) 
-	error->all("Illegal create_atoms command");
+	error->all(FLERR,"Illegal create_atoms command");
       basistype[ibasis-1] = itype;
       iarg += 3;
     } else if (strcmp(arg[iarg],"units") == 0) {
-      if (iarg+2 > narg) error->all("Illegal create_atoms command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal create_atoms command");
       if (strcmp(arg[iarg+1],"box") == 0) scaleflag = 0;
       else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1;
-      else error->all("Illegal create_atoms command");
+      else error->all(FLERR,"Illegal create_atoms command");
       iarg += 2;
-    } else error->all("Illegal create_atoms command");
+    } else error->all(FLERR,"Illegal create_atoms command");
   }
 
   // error checks
 
   if (style == RANDOM) {
-    if (nrandom < 0) error->all("Illegal create_atoms command");
-    if (seed <= 0) error->all("Illegal create_atoms command");
+    if (nrandom < 0) error->all(FLERR,"Illegal create_atoms command");
+    if (seed <= 0) error->all(FLERR,"Illegal create_atoms command");
   }
 
   // demand lattice be defined
@@ -134,10 +131,10 @@ void CreateAtoms::command(int narg, char **arg)
 
   if (style == BOX || style == REGION) {
     if (domain->lattice == NULL)
-      error->all("Cannot create atoms with undefined lattice");
+      error->all(FLERR,"Cannot create atoms with undefined lattice");
   } else if (scaleflag == 1) {
     if (domain->lattice == NULL)
-      error->all("Cannot create atoms with undefined lattice");
+      error->all(FLERR,"Cannot create atoms with undefined lattice");
     xone[0] *= domain->lattice->xlattice;
     xone[1] *= domain->lattice->ylattice;
     xone[2] *= domain->lattice->zlattice;
@@ -171,7 +168,7 @@ void CreateAtoms::command(int narg, char **arg)
   bigint nblocal = atom->nlocal;
   MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
   if (atom->natoms < 0 || atom->natoms > MAXBIGINT)
-    error->all("Too many total atoms");
+    error->all(FLERR,"Too many total atoms");
 
   // print status
 
diff --git a/src/create_box.cpp b/src/create_box.cpp
index cc9ad9513e4ecdabbc1ed4d64e4140c71ba2b5e0..7cdb03365775c76eb16661362b6d2166f038e340 100644
--- a/src/create_box.cpp
+++ b/src/create_box.cpp
@@ -33,21 +33,21 @@ CreateBox::CreateBox(LAMMPS *lmp) : Pointers(lmp) {}
 
 void CreateBox::command(int narg, char **arg)
 {
-  if (narg != 2) error->all("Illegal create_box command");
+  if (narg != 2) error->all(FLERR,"Illegal create_box command");
 
   if (domain->box_exist) 
-    error->all("Cannot create_box after simulation box is defined");
+    error->all(FLERR,"Cannot create_box after simulation box is defined");
   if (domain->dimension == 2 && domain->zperiodic == 0)
-    error->all("Cannot run 2d simulation with nonperiodic Z dimension");
+    error->all(FLERR,"Cannot run 2d simulation with nonperiodic Z dimension");
 
   domain->box_exist = 1;
 
   // region check
 
   int iregion = domain->find_region(arg[1]);
-  if (iregion == -1) error->all("Create_box region ID does not exist");
+  if (iregion == -1) error->all(FLERR,"Create_box region ID does not exist");
   if (domain->regions[iregion]->bboxflag == 0)
-    error->all("Create_box region does not support a bounding box");
+    error->all(FLERR,"Create_box region does not support a bounding box");
 
   // if region not prism:
   //   setup orthogonal domain
diff --git a/src/delete_atoms.cpp b/src/delete_atoms.cpp
index 3de098fdabb2356a10414ea1461ba759a7c08d10..9ed147e068f6e4f87e53c8e01082efcb077e80af 100644
--- a/src/delete_atoms.cpp
+++ b/src/delete_atoms.cpp
@@ -31,9 +31,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 DeleteAtoms::DeleteAtoms(LAMMPS *lmp) : Pointers(lmp) {}
@@ -43,10 +40,10 @@ DeleteAtoms::DeleteAtoms(LAMMPS *lmp) : Pointers(lmp) {}
 void DeleteAtoms::command(int narg, char **arg)
 {
   if (domain->box_exist == 0) 
-    error->all("Delete_atoms command before simulation box is defined");
-  if (narg < 1) error->all("Illegal delete_atoms command");
+    error->all(FLERR,"Delete_atoms command before simulation box is defined");
+  if (narg < 1) error->all(FLERR,"Illegal delete_atoms command");
   if (atom->tag_enable == 0)
-    error->all("Cannot use delete_atoms unless atoms have IDs");
+    error->all(FLERR,"Cannot use delete_atoms unless atoms have IDs");
 
   // store state before delete
 
@@ -58,7 +55,7 @@ void DeleteAtoms::command(int narg, char **arg)
   else if (strcmp(arg[0],"region") == 0) delete_region(narg,arg);
   else if (strcmp(arg[0],"overlap") == 0) delete_overlap(narg,arg);
   else if (strcmp(arg[0],"porosity") == 0) delete_porosity(narg,arg);
-  else error->all("Illegal delete_atoms command");
+  else error->all(FLERR,"Illegal delete_atoms command");
 
   // delete local atoms flagged in dlist
   // reset nlocal
@@ -121,10 +118,10 @@ void DeleteAtoms::command(int narg, char **arg)
 
 void DeleteAtoms::delete_group(int narg, char **arg)
 {
-  if (narg < 2) error->all("Illegal delete_atoms command");
+  if (narg < 2) error->all(FLERR,"Illegal delete_atoms command");
 
   int igroup = group->find(arg[1]);
-  if (igroup == -1) error->all("Could not find delete_atoms group ID");
+  if (igroup == -1) error->all(FLERR,"Could not find delete_atoms group ID");
   options(narg-2,&arg[2]);
 
   // allocate and initialize deletion list
@@ -146,10 +143,10 @@ void DeleteAtoms::delete_group(int narg, char **arg)
 
 void DeleteAtoms::delete_region(int narg, char **arg)
 {
-  if (narg < 2) error->all("Illegal delete_atoms command");
+  if (narg < 2) error->all(FLERR,"Illegal delete_atoms command");
   
   int iregion = domain->find_region(arg[1]);
-  if (iregion == -1) error->all("Could not find delete_atoms region ID");
+  if (iregion == -1) error->all(FLERR,"Could not find delete_atoms region ID");
   options(narg-2,&arg[2]);
 
   // allocate and initialize deletion list
@@ -173,7 +170,7 @@ void DeleteAtoms::delete_region(int narg, char **arg)
 
 void DeleteAtoms::delete_overlap(int narg, char **arg)
 {
-  if (narg < 4) error->all("Illegal delete_atoms command");
+  if (narg < 4) error->all(FLERR,"Illegal delete_atoms command");
     
   // read args
 
@@ -183,7 +180,7 @@ void DeleteAtoms::delete_overlap(int narg, char **arg)
   int igroup1 = group->find(arg[2]);
   int igroup2 = group->find(arg[3]);
   if (igroup1 < 0 || igroup2 < 0)
-    error->all("Could not find delete_atoms group ID");
+    error->all(FLERR,"Could not find delete_atoms group ID");
   options(narg-4,&arg[4]);
 
   int group1bit = group->bitmask[igroup1];
@@ -210,9 +207,9 @@ void DeleteAtoms::delete_overlap(int narg, char **arg)
   // if no pair style, neighbor list will be empty
 
   if (force->pair == NULL)
-    error->all("Delete_atoms requires a pair style be defined");
+    error->all(FLERR,"Delete_atoms requires a pair style be defined");
   if (cut > neighbor->cutneighmax) 
-    error->all("Delete_atoms cutoff > neighbor cutoff");
+    error->all(FLERR,"Delete_atoms cutoff > neighbor cutoff");
 
   // setup domain, communication and neighboring
   // acquire ghosts
@@ -319,10 +316,10 @@ void DeleteAtoms::delete_overlap(int narg, char **arg)
 
 void DeleteAtoms::delete_porosity(int narg, char **arg)
 {
-  if (narg < 4) error->all("Illegal delete_atoms command");
+  if (narg < 4) error->all(FLERR,"Illegal delete_atoms command");
 
   int iregion = domain->find_region(arg[1]);
-  if (iregion == -1) error->all("Could not find delete_atoms region ID");
+  if (iregion == -1) error->all(FLERR,"Could not find delete_atoms region ID");
 
   double porosity_fraction = atof(arg[2]);
   int seed = atoi(arg[3]);
@@ -354,11 +351,11 @@ void DeleteAtoms::options(int narg, char **arg)
   int iarg = 0;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"compress") == 0) {
-      if (iarg+2 > narg) error->all("Illegal delete_bonds command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal delete_bonds command");
       if (strcmp(arg[iarg+1],"yes") == 0) compress_flag = 1;
       else if (strcmp(arg[iarg+1],"no") == 0) compress_flag = 0;
-      else error->all("Illegal delete_bonds command");
+      else error->all(FLERR,"Illegal delete_bonds command");
       iarg += 2;
-    } else error->all("Illegal delete_bonds command");
+    } else error->all(FLERR,"Illegal delete_bonds command");
   }
 }
diff --git a/src/delete_bonds.cpp b/src/delete_bonds.cpp
index 5bf219d975312b09c8e684ad3a5f6bd41618ef54..01e1e3d14e5cd4ca7fb527f585a602fd62349c93 100644
--- a/src/delete_bonds.cpp
+++ b/src/delete_bonds.cpp
@@ -38,12 +38,12 @@ DeleteBonds::DeleteBonds(LAMMPS *lmp) : Pointers(lmp) {}
 void DeleteBonds::command(int narg, char **arg)
 {
   if (domain->box_exist == 0) 
-    error->all("Delete_bonds command before simulation box is defined");
+    error->all(FLERR,"Delete_bonds command before simulation box is defined");
   if (atom->natoms == 0)
-    error->all("Delete_bonds command with no atoms existing");
+    error->all(FLERR,"Delete_bonds command with no atoms existing");
   if (atom->molecular == 0)
-    error->all("Cannot use delete_bonds with non-molecular system");
-  if (narg < 2) error->all("Illegal delete_bonds command");
+    error->all(FLERR,"Cannot use delete_bonds with non-molecular system");
+  if (narg < 2) error->all(FLERR,"Illegal delete_bonds command");
 
   // init entire system since comm->borders is done
   // comm::init needs neighbor::init needs pair::init needs kspace::init, etc
@@ -57,7 +57,7 @@ void DeleteBonds::command(int narg, char **arg)
   // identify group
 
   int igroup = group->find(arg[0]);
-  if (igroup == -1) error->all("Cannot find delete_bonds group ID");
+  if (igroup == -1) error->all(FLERR,"Cannot find delete_bonds group ID");
   int groupbit = group->bitmask[igroup];
   
   // set style and which = type value
@@ -70,12 +70,12 @@ void DeleteBonds::command(int narg, char **arg)
   else if (strcmp(arg[1],"dihedral") == 0) style = DIHEDRAL;
   else if (strcmp(arg[1],"improper") == 0) style = IMPROPER;
   else if (strcmp(arg[1],"stats") == 0) style = STATS;
-  else error->all("Illegal delete_bonds command");
+  else error->all(FLERR,"Illegal delete_bonds command");
 
   int iarg = 2;
   int which;
   if (style != MULTI && style != STATS) {
-    if (narg < 3) error->all("Illegal delete_bonds command");
+    if (narg < 3) error->all(FLERR,"Illegal delete_bonds command");
     which = atoi(arg[2]);
     iarg++;
   }
@@ -90,7 +90,7 @@ void DeleteBonds::command(int narg, char **arg)
     if (strcmp(arg[iarg],"undo") == 0) undo_flag = 1;
     else if (strcmp(arg[iarg],"remove") == 0) remove_flag = 1;
     else if (strcmp(arg[iarg],"special") == 0) special_flag = 1;
-    else error->all("Illegal delete_bonds command");
+    else error->all(FLERR,"Illegal delete_bonds command");
     iarg++;
   }
 
@@ -130,7 +130,7 @@ void DeleteBonds::command(int narg, char **arg)
     for (i = 0; i < nlocal; i++) {
       for (m = 0; m < num_bond[i]; m++) {
 	atom1 = atom->map(atom->bond_atom[i][m]);
-	if (atom1 == -1) error->one("Bond atom missing in delete_bonds");
+	if (atom1 == -1) error->one(FLERR,"Bond atom missing in delete_bonds");
 	if (mask[i] & groupbit && mask[atom1] & groupbit) {
 	  flag = 0;
 	  if (style == MULTI) flag = 1;
@@ -158,7 +158,7 @@ void DeleteBonds::command(int narg, char **arg)
 	atom2 = atom->map(atom->angle_atom2[i][m]);
 	atom3 = atom->map(atom->angle_atom3[i][m]);
 	if (atom1 == -1 || atom2 == -1 || atom3 == -1)
-	  error->one("Angle atom missing in delete_bonds");
+	  error->one(FLERR,"Angle atom missing in delete_bonds");
 	if (mask[atom1] & groupbit && mask[atom2] & groupbit &&
 	    mask[atom3] & groupbit) {
 	  flag = 0;
@@ -189,7 +189,7 @@ void DeleteBonds::command(int narg, char **arg)
 	atom3 = atom->map(atom->dihedral_atom3[i][m]);
 	atom4 = atom->map(atom->dihedral_atom4[i][m]);
 	if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1)
-	  error->one("Dihedral atom missing in delete_bonds");
+	  error->one(FLERR,"Dihedral atom missing in delete_bonds");
 	if (mask[atom1] & groupbit && mask[atom2] & groupbit &&
 	    mask[atom3] & groupbit && mask[atom4] & groupbit) {
 	  flag = 0;
@@ -220,7 +220,7 @@ void DeleteBonds::command(int narg, char **arg)
 	atom3 = atom->map(atom->improper_atom3[i][m]);
 	atom4 = atom->map(atom->improper_atom4[i][m]);
 	if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1)
-	  error->one("Improper atom missing in delete_bonds");
+	  error->one(FLERR,"Improper atom missing in delete_bonds");
 	if (mask[atom1] & groupbit && mask[atom2] & groupbit &&
 	    mask[atom3] & groupbit && mask[atom4] & groupbit) {
 	  flag = 0;
diff --git a/src/dihedral.cpp b/src/dihedral.cpp
index 1a3f6f5a45d83fab3cf05dec8e4207617a639040..a3edadc0c0ecd86e8999b21735c172a06b389e30 100644
--- a/src/dihedral.cpp
+++ b/src/dihedral.cpp
@@ -53,9 +53,9 @@ Dihedral::~Dihedral()
 
 void Dihedral::init()
 {
-  if (!allocated) error->all("Dihedral coeffs are not set");
+  if (!allocated) error->all(FLERR,"Dihedral coeffs are not set");
   for (int i = 1; i <= atom->ndihedraltypes; i++)
-    if (setflag[i] == 0) error->all("All dihedral coeffs are not set");
+    if (setflag[i] == 0) error->all(FLERR,"All dihedral coeffs are not set");
   init_style();
 }
 
diff --git a/src/displace_atoms.cpp b/src/displace_atoms.cpp
index f433541d9ef90c5568f9d0dbb4d31a62089e45a3..1793a5e195441f3f659713c4274e64228424277a 100644
--- a/src/displace_atoms.cpp
+++ b/src/displace_atoms.cpp
@@ -30,9 +30,6 @@ using namespace LAMMPS_NS;
 
 enum{MOVE,RAMP,RANDOM};
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 DisplaceAtoms::DisplaceAtoms(LAMMPS *lmp) : Pointers(lmp) {}
@@ -44,10 +41,10 @@ void DisplaceAtoms::command(int narg, char **arg)
   int i;
 
   if (domain->box_exist == 0) 
-    error->all("Displace_atoms command before simulation box is defined");
-  if (narg < 2) error->all("Illegal displace_atoms command");
+    error->all(FLERR,"Displace_atoms command before simulation box is defined");
+  if (narg < 2) error->all(FLERR,"Illegal displace_atoms command");
   if (modify->nfix_restart_peratom) 
-    error->all("Cannot displace_atoms after "
+    error->all(FLERR,"Cannot displace_atoms after "
 	       "reading restart file with per-atom info");
 
   if (comm->me == 0 && screen) fprintf(screen,"Displacing atoms ...\n");
@@ -55,14 +52,14 @@ void DisplaceAtoms::command(int narg, char **arg)
   // group and style
 
   int igroup = group->find(arg[0]);
-  if (igroup == -1) error->all("Could not find displace_atoms group ID");
+  if (igroup == -1) error->all(FLERR,"Could not find displace_atoms group ID");
   int groupbit = group->bitmask[igroup];
 
   int style;
   if (strcmp(arg[1],"move") == 0) style = MOVE;
   else if (strcmp(arg[1],"ramp") == 0) style = RAMP;
   else if (strcmp(arg[1],"random") == 0) style = RANDOM;
-  else error->all("Illegal displace_atoms command");
+  else error->all(FLERR,"Illegal displace_atoms command");
 
   // set option defaults
 
@@ -77,7 +74,7 @@ void DisplaceAtoms::command(int narg, char **arg)
   // setup scaling
 
   if (scaleflag && domain->lattice == NULL)
-    error->all("Use of displace_atoms with undefined lattice");
+    error->all(FLERR,"Use of displace_atoms with undefined lattice");
 
   double xscale,yscale,zscale;
   if (scaleflag) {
@@ -116,7 +113,7 @@ void DisplaceAtoms::command(int narg, char **arg)
     if (strcmp(arg[2],"x") == 0) d_dim = 0;
     else if (strcmp(arg[2],"y") == 0) d_dim = 1;
     else if (strcmp(arg[2],"z") == 0) d_dim = 2;
-    else error->all("Illegal displace_atoms ramp command");
+    else error->all(FLERR,"Illegal displace_atoms ramp command");
 
     double d_lo,d_hi;
     if (d_dim == 0) {
@@ -134,7 +131,7 @@ void DisplaceAtoms::command(int narg, char **arg)
     if (strcmp(arg[5],"x") == 0) coord_dim = 0;
     else if (strcmp(arg[5],"y") == 0) coord_dim = 1;
     else if (strcmp(arg[5],"z") == 0) coord_dim = 2;
-    else error->all("Illegal displace_atoms ramp command");
+    else error->all(FLERR,"Illegal displace_atoms ramp command");
 
     double coord_lo,coord_hi;
     if (coord_dim == 0) {
@@ -175,7 +172,7 @@ void DisplaceAtoms::command(int narg, char **arg)
     double dy = yscale*atof(arg[3]);
     double dz = zscale*atof(arg[4]);
     int seed = atoi(arg[5]);
-    if (seed <= 0) error->all("Illegal displace_atoms random command");
+    if (seed <= 0) error->all(FLERR,"Illegal displace_atoms random command");
 
     double **x = atom->x;
     int *mask = atom->mask;
@@ -218,7 +215,7 @@ void DisplaceAtoms::command(int narg, char **arg)
     char str[128];
     sprintf(str,"Lost atoms via displace_atoms: original " BIGINT_FORMAT 
 	    " current " BIGINT_FORMAT,atom->natoms,natoms);
-    error->all(str);
+    error->all(FLERR,str);
   }
 }
 
@@ -228,16 +225,16 @@ void DisplaceAtoms::command(int narg, char **arg)
 
 void DisplaceAtoms::options(int narg, char **arg)
 {
-  if (narg < 0) error->all("Illegal displace_atoms command");
+  if (narg < 0) error->all(FLERR,"Illegal displace_atoms command");
 
   int iarg = 0;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"units") == 0) {
-      if (iarg+2 > narg) error->all("Illegal displace_atoms command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal displace_atoms command");
       if (strcmp(arg[iarg+1],"box") == 0) scaleflag = 0;
       else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1;
-      else error->all("Illegal displace_atoms command");
+      else error->all(FLERR,"Illegal displace_atoms command");
       iarg += 2;
-    } else error->all("Illegal displace_atoms command");
+    } else error->all(FLERR,"Illegal displace_atoms command");
   }
 }
diff --git a/src/displace_box.cpp b/src/displace_box.cpp
index f2e3363a6d2454f480a49e349cff71912a2ad740..79f8865788d7ea8c855094e6e574d584b28ec254 100644
--- a/src/displace_box.cpp
+++ b/src/displace_box.cpp
@@ -43,10 +43,10 @@ void DisplaceBox::command(int narg, char **arg)
   int i;
 
   if (domain->box_exist == 0) 
-    error->all("Displace_box command before simulation box is defined");
-  if (narg < 2) error->all("Illegal displace_box command");
+    error->all(FLERR,"Displace_box command before simulation box is defined");
+  if (narg < 2) error->all(FLERR,"Illegal displace_box command");
   if (modify->nfix_restart_peratom) 
-    error->all("Cannot displace_box after "
+    error->all(FLERR,"Cannot displace_box after "
 	       "reading restart file with per-atom info");
 
   if (comm->me == 0 && screen) fprintf(screen,"Displacing box ...\n");
@@ -54,7 +54,7 @@ void DisplaceBox::command(int narg, char **arg)
   // group
 
   int igroup = group->find(arg[0]);
-  if (igroup == -1) error->all("Could not find displace_box group ID");
+  if (igroup == -1) error->all(FLERR,"Could not find displace_box group ID");
   int groupbit = group->bitmask[igroup];
 
   // set defaults
@@ -76,48 +76,48 @@ void DisplaceBox::command(int narg, char **arg)
       else if (strcmp(arg[iarg],"y") == 0) index = 1;
       else if (strcmp(arg[iarg],"z") == 0) index = 2;
 
-      if (iarg+2 > narg) error->all("Illegal displace_box command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal displace_box command");
       if (strcmp(arg[iarg+1],"final") == 0) {
-	if (iarg+4 > narg) error->all("Illegal displace_box command");
+	if (iarg+4 > narg) error->all(FLERR,"Illegal displace_box command");
 	set[index].style = FINAL;
 	set[index].flo = atof(arg[iarg+2]);
 	set[index].fhi = atof(arg[iarg+3]);
 	iarg += 4;
       } else if (strcmp(arg[iarg+1],"delta") == 0) {
-	if (iarg+4 > narg) error->all("Illegal displace_box command");
+	if (iarg+4 > narg) error->all(FLERR,"Illegal displace_box command");
 	set[index].style = DELTA;
 	set[index].dlo = atof(arg[iarg+2]);
 	set[index].dhi = atof(arg[iarg+3]);
 	iarg += 4;
       } else if (strcmp(arg[iarg+1],"scale") == 0) {
-	if (iarg+3 > narg) error->all("Illegal displace_box command");
+	if (iarg+3 > narg) error->all(FLERR,"Illegal displace_box command");
 	set[index].style = SCALE;
 	set[index].scale = atof(arg[iarg+2]);
 	iarg += 3;
       } else if (strcmp(arg[iarg+1],"volume") == 0) {
 	set[index].style = VOLUME;
 	iarg += 2;
-      } else error->all("Illegal displace_box command");
+      } else error->all(FLERR,"Illegal displace_box command");
 
     } else if (strcmp(arg[iarg],"xy") == 0 || strcmp(arg[iarg],"xz") == 0 ||
 	strcmp(arg[iarg],"yz") == 0) {
       if (triclinic == 0)
-	error->all("Displace_box tilt factors require triclinic box");
+	error->all(FLERR,"Displace_box tilt factors require triclinic box");
       if (strcmp(arg[iarg],"xy") == 0) index = 5;
       else if (strcmp(arg[iarg],"xz") == 0) index = 4;
       else if (strcmp(arg[iarg],"yz") == 0) index = 3;
-      if (iarg+2 > narg) error->all("Illegal displace_box command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal displace_box command");
       if (strcmp(arg[iarg+1],"final") == 0) {
-	if (iarg+3 > narg) error->all("Illegal displace_box command");
+	if (iarg+3 > narg) error->all(FLERR,"Illegal displace_box command");
 	set[index].style = FINAL;
 	set[index].ftilt = atof(arg[iarg+2]);
 	iarg += 3;
       } else if (strcmp(arg[iarg+1],"delta") == 0) {
-	if (iarg+3 > narg) error->all("Illegal displace_box command");
+	if (iarg+3 > narg) error->all(FLERR,"Illegal displace_box command");
 	set[index].style = DELTA;
 	set[index].dtilt = atof(arg[iarg+2]);
 	iarg += 3;
-      } else error->all("Illegal displace_box command");
+      } else error->all(FLERR,"Illegal displace_box command");
 
     } else break;
   }
@@ -131,14 +131,14 @@ void DisplaceBox::command(int narg, char **arg)
   if ((set[0].style && domain->xperiodic == 0) ||
       (set[1].style && domain->yperiodic == 0) ||
       (set[2].style && domain->zperiodic == 0))
-    error->all("Cannot displace_box on a non-periodic boundary");
+    error->all(FLERR,"Cannot displace_box on a non-periodic boundary");
 
   if (set[3].style && (domain->yperiodic == 0 || domain->zperiodic == 0))
-    error->all("Cannot displace_box on a non-periodic boundary");
+    error->all(FLERR,"Cannot displace_box on a non-periodic boundary");
   if (set[4].style && (domain->xperiodic == 0 || domain->zperiodic == 0))
-    error->all("Cannot displace_box on a non-periodic boundary");
+    error->all(FLERR,"Cannot displace_box on a non-periodic boundary");
   if (set[5].style && (domain->xperiodic == 0 || domain->yperiodic == 0))
-    error->all("Cannot displace_box on a non-periodic boundary");
+    error->all(FLERR,"Cannot displace_box on a non-periodic boundary");
 
   // apply scaling to FINAL,DELTA since they have distance units
 
@@ -147,7 +147,7 @@ void DisplaceBox::command(int narg, char **arg)
     if (set[i].style == FINAL || set[i].style == DELTA) flag = 1;
 
   if (flag && scaleflag && domain->lattice == NULL)
-    error->all("Use of displace_box with undefined lattice");
+    error->all(FLERR,"Use of displace_box with undefined lattice");
 
   double xscale,yscale,zscale;
   if (flag && scaleflag) {
@@ -224,25 +224,25 @@ void DisplaceBox::command(int narg, char **arg)
 
     if (set[other1].style == NONE) {
       if (set[other2].style == NONE || set[other2].style == VOLUME)
-	error->all("Fix deform volume setting is invalid");
+	error->all(FLERR,"Fix deform volume setting is invalid");
       set[i].substyle = ONE_FROM_ONE;
       set[i].fixed = other1;
       set[i].dynamic1 = other2;
     } else if (set[other2].style == NONE) {
       if (set[other1].style == NONE || set[other1].style == VOLUME)
-	error->all("Fix deform volume setting is invalid");
+	error->all(FLERR,"Fix deform volume setting is invalid");
       set[i].substyle = ONE_FROM_ONE;
       set[i].fixed = other2;
       set[i].dynamic1 = other1;
     } else if (set[other1].style == VOLUME) {
       if (set[other2].style == NONE || set[other2].style == VOLUME)
-	error->all("Fix deform volume setting is invalid");
+	error->all(FLERR,"Fix deform volume setting is invalid");
       set[i].substyle = TWO_FROM_ONE;
       set[i].fixed = other1;
       set[i].dynamic1 = other2;
     } else if (set[other2].style == VOLUME) {
       if (set[other1].style == NONE || set[other1].style == VOLUME)
-	error->all("Fix deform volume setting is invalid");
+	error->all(FLERR,"Fix deform volume setting is invalid");
       set[i].substyle = TWO_FROM_ONE;
       set[i].fixed = other2;
       set[i].dynamic1 = other1;
@@ -310,7 +310,7 @@ void DisplaceBox::command(int narg, char **arg)
   if (set[3].tilt_stop < -0.5*yprd_stop || set[3].tilt_stop > 0.5*yprd_stop ||
       set[4].tilt_stop < -0.5*xprd_stop || set[4].tilt_stop > 0.5*xprd_stop ||
       set[5].tilt_stop < -0.5*xprd_stop || set[5].tilt_stop > 0.5*xprd_stop)
-    error->all("Induced tilt by displace_box is too large");
+    error->all(FLERR,"Induced tilt by displace_box is too large");
 
   // convert atoms to lamda coords
 
@@ -384,7 +384,7 @@ void DisplaceBox::command(int narg, char **arg)
     char str[128];
     sprintf(str,"Lost atoms via displace_box: original " BIGINT_FORMAT 
 	    " current " BIGINT_FORMAT,atom->natoms,natoms);
-    error->all(str);
+    error->all(FLERR,str);
   }
 }
 
@@ -394,7 +394,7 @@ void DisplaceBox::command(int narg, char **arg)
 
 void DisplaceBox::options(int narg, char **arg)
 {
-  if (narg < 0) error->all("Illegal displace_box command");
+  if (narg < 0) error->all(FLERR,"Illegal displace_box command");
 
   remapflag = X_REMAP;
   scaleflag = 1;
@@ -402,17 +402,17 @@ void DisplaceBox::options(int narg, char **arg)
   int iarg = 0;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"remap") == 0) {
-      if (iarg+2 > narg) error->all("Illegal displace_box command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal displace_box command");
       if (strcmp(arg[iarg+1],"x") == 0) remapflag = X_REMAP;
       else if (strcmp(arg[iarg+1],"none") == 0) remapflag = NO_REMAP;
-      else error->all("Illegal displace_box command");
+      else error->all(FLERR,"Illegal displace_box command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"units") == 0) {
-      if (iarg+2 > narg) error->all("Illegal displace_box command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal displace_box command");
       if (strcmp(arg[iarg+1],"box") == 0) scaleflag = 0;
       else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1;
-      else error->all("Illegal displace_box command");
+      else error->all(FLERR,"Illegal displace_box command");
       iarg += 2;
-    } else error->all("Illegal displace_box command");
+    } else error->all(FLERR,"Illegal displace_box command");
   }
 }
diff --git a/src/domain.cpp b/src/domain.cpp
index 4688a733f156bb31ac2a872b7acc25bca1778e40..a1a0045fa94c274bd0b9b855d9a718ea382a5d74 100644
--- a/src/domain.cpp
+++ b/src/domain.cpp
@@ -39,8 +39,6 @@ using namespace LAMMPS_NS;
 #define BIG   1.0e20
 #define SMALL 1.0e-4
 #define DELTA 1
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
 
 enum{NO_REMAP,X_REMAP,V_REMAP};                   // same as fix_deform.cpp
 
@@ -132,24 +130,24 @@ void Domain::set_initial_box()
   // error checks for orthogonal and triclinic domains
 
   if (boxlo[0] >= boxhi[0] || boxlo[1] >= boxhi[1] || boxlo[2] >= boxhi[2])
-    error->one("Box bounds are invalid");
+    error->one(FLERR,"Box bounds are invalid");
 
   if (triclinic) {
     if (domain->dimension == 2 && (xz != 0.0 || yz != 0.0))
-      error->all("Cannot skew triclinic box in z for 2d simulation");
+      error->all(FLERR,"Cannot skew triclinic box in z for 2d simulation");
     if (xy != 0.0 && (!xperiodic || !yperiodic))
-      error->all("Triclinic box must be periodic in skewed dimensions");
+      error->all(FLERR,"Triclinic box must be periodic in skewed dimensions");
     if (xz != 0.0 && (!xperiodic || !zperiodic))
-      error->all("Triclinic box must be periodic in skewed dimensions");
+      error->all(FLERR,"Triclinic box must be periodic in skewed dimensions");
     if (yz != 0.0 && (!yperiodic || !zperiodic))
-      error->all("Triclinic box must be periodic in skewed dimensions");
+      error->all(FLERR,"Triclinic box must be periodic in skewed dimensions");
 
     if (fabs(xy/(boxhi[0]-boxlo[0])) > 0.5)
-      error->all("Triclinic box skew is too large");
+      error->all(FLERR,"Triclinic box skew is too large");
     if (fabs(xz/(boxhi[0]-boxlo[0])) > 0.5)
-      error->all("Triclinic box skew is too large");
+      error->all(FLERR,"Triclinic box skew is too large");
     if (fabs(yz/(boxhi[1]-boxlo[1])) > 0.5)
-      error->all("Triclinic box skew is too large");
+      error->all(FLERR,"Triclinic box skew is too large");
   }
 
   // adjust box lo/hi for shrink-wrapped dims
@@ -319,21 +317,21 @@ void Domain::reset_box()
       else if (boundary[0][0] == 3) boxlo[0] = MIN(-all[0][0]-SMALL,minxlo);
       if (boundary[0][1] == 2) boxhi[0] = all[0][1] + SMALL;
       else if (boundary[0][1] == 3) boxhi[0] = MAX(all[0][1]+SMALL,minxhi);
-      if (boxlo[0] > boxhi[0]) error->all("Illegal simulation box");
+      if (boxlo[0] > boxhi[0]) error->all(FLERR,"Illegal simulation box");
     }
     if (yperiodic == 0) {
       if (boundary[1][0] == 2) boxlo[1] = -all[1][0] - SMALL;
       else if (boundary[1][0] == 3) boxlo[1] = MIN(-all[1][0]-SMALL,minylo);
       if (boundary[1][1] == 2) boxhi[1] = all[1][1] + SMALL;
       else if (boundary[1][1] == 3) boxhi[1] = MAX(all[1][1]+SMALL,minyhi);
-      if (boxlo[1] > boxhi[1]) error->all("Illegal simulation box");
+      if (boxlo[1] > boxhi[1]) error->all(FLERR,"Illegal simulation box");
     }
     if (zperiodic == 0) {
       if (boundary[2][0] == 2) boxlo[2] = -all[2][0] - SMALL;
       else if (boundary[2][0] == 3) boxlo[2] = MIN(-all[2][0]-SMALL,minzlo);
       if (boundary[2][1] == 2) boxhi[2] = all[2][1] + SMALL;
       else if (boundary[2][1] == 3) boxhi[2] = MAX(all[2][1]+SMALL,minzhi);
-      if (boxlo[2] > boxhi[2]) error->all("Illegal simulation box");
+      if (boxlo[2] > boxhi[2]) error->all(FLERR,"Illegal simulation box");
     }
   }
 
@@ -992,14 +990,14 @@ void Domain::set_lattice(int narg, char **arg)
 
 void Domain::add_region(int narg, char **arg)
 {
-  if (narg < 2) error->all("Illegal region command");
+  if (narg < 2) error->all(FLERR,"Illegal region command");
 
   if (strcmp(arg[1],"delete") == 0) {
     delete_region(narg,arg);
     return;
   }
 
-  if (find_region(arg[0]) >= 0) error->all("Reuse of region ID");
+  if (find_region(arg[0]) >= 0) error->all(FLERR,"Reuse of region ID");
 
   // extend Region list if necessary
 
@@ -1011,7 +1009,7 @@ void Domain::add_region(int narg, char **arg)
 
   // create the Region
 
-  if (strcmp(arg[1],"none") == 0) error->all("Invalid region style");
+  if (strcmp(arg[1],"none") == 0) error->all(FLERR,"Invalid region style");
 
 #define REGION_CLASS
 #define RegionStyle(key,Class) \
@@ -1020,7 +1018,7 @@ void Domain::add_region(int narg, char **arg)
 #include "style_region.h"
 #undef REGION_CLASS
 
-  else error->all("Invalid region style");
+  else error->all(FLERR,"Invalid region style");
 
   nregion++;
 }
@@ -1031,10 +1029,10 @@ void Domain::add_region(int narg, char **arg)
 
 void Domain::delete_region(int narg, char **arg)
 {
-  if (narg != 2) error->all("Illegal region command");
+  if (narg != 2) error->all(FLERR,"Illegal region command");
 
   int iregion = find_region(arg[0]);
-  if (iregion == -1) error->all("Delete region ID does not exist");
+  if (iregion == -1) error->all(FLERR,"Delete region ID does not exist");
 
   delete regions[iregion];
   regions[iregion] = regions[nregion-1];
@@ -1059,7 +1057,7 @@ int Domain::find_region(char *name)
 
 void Domain::set_boundary(int narg, char **arg)
 {
-  if (narg != 3) error->all("Illegal boundary command");
+  if (narg != 3) error->all(FLERR,"Illegal boundary command");
 
   char c;
   for (int idim = 0; idim < 3; idim++)
@@ -1072,13 +1070,13 @@ void Domain::set_boundary(int narg, char **arg)
       else if (c == 'f') boundary[idim][iside] = 1;
       else if (c == 's') boundary[idim][iside] = 2;
       else if (c == 'm') boundary[idim][iside] = 3;
-      else error->all("Illegal boundary command");
+      else error->all(FLERR,"Illegal boundary command");
     }
 
   for (int idim = 0; idim < 3; idim++)
     if ((boundary[idim][0] == 0 && boundary[idim][1]) ||
 	(boundary[idim][0] && boundary[idim][1] == 0))
-      error->all("Both sides of boundary must be periodic");
+      error->all(FLERR,"Both sides of boundary must be periodic");
 
   if (boundary[0][0] == 0) xperiodic = 1;
   else xperiodic = 0;
diff --git a/src/dump.cpp b/src/dump.cpp
index 2dd5106bf5550edd85cf864e1091abf12b8cb326..feda8ea1560f1bd981a137c91dccbf070a4b6a44 100644
--- a/src/dump.cpp
+++ b/src/dump.cpp
@@ -36,9 +36,6 @@ Dump *Dump::dumpptr;
 #define IBIG 2147483647
 #define EPSILON 1.0e-6
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 enum{ASCEND,DESCEND};
 
 /* ---------------------------------------------------------------------- */
@@ -170,14 +167,14 @@ void Dump::init()
 
   if (sort_flag) {
     if (sortcol == 0 && atom->tag_enable == 0)
-      error->all("Cannot dump sort on atom IDs with no atom IDs defined");
+      error->all(FLERR,"Cannot dump sort on atom IDs with no atom IDs defined");
     if (sortcol && sortcol > size_one)
-      error->all("Dump sort column is invalid");
+      error->all(FLERR,"Dump sort column is invalid");
     if (nprocs > 1 && irregular == NULL)
       irregular = new Irregular(lmp);
 
     bigint size = group->count(igroup);
-    if (size > MAXSMALLINT) error->all("Too many atoms to dump sort");
+    if (size > MAXSMALLINT) error->all(FLERR,"Too many atoms to dump sort");
 
     // set reorderflag = 1 if can simply reorder local atoms rather than sort
     // criteria: sorting by ID, atom IDs are consecutive from 1 to Natoms
@@ -281,7 +278,7 @@ void Dump::write()
 
   if (nmax > maxbuf) {
     if ((bigint) nmax * size_one > MAXSMALLINT)
-      error->all("Too much per-proc info for dump");
+      error->all(FLERR,"Too much per-proc info for dump");
     maxbuf = nmax;
     memory->destroy(buf);
     memory->create(buf,maxbuf*size_one,"dump:buf");
@@ -382,7 +379,7 @@ void Dump::openfile()
       sprintf(gzip,"gzip -6 > %s",filecurrent);
       fp = popen(gzip,"w");
 #else
-      error->one("Cannot open gzipped file");
+      error->one(FLERR,"Cannot open gzipped file");
 #endif
     } else if (binary) {
       fp = fopen(filecurrent,"wb");
@@ -392,7 +389,7 @@ void Dump::openfile()
       fp = fopen(filecurrent,"w");
     }
 
-    if (fp == NULL) error->one("Cannot open dump file");
+    if (fp == NULL) error->one(FLERR,"Cannot open dump file");
   } else fp = NULL;
 
   // delete string with timestep replaced
@@ -622,18 +619,18 @@ int Dump::bufcompare_reverse(const void *pi, const void *pj)
 
 void Dump::modify_params(int narg, char **arg)
 {
-  if (narg == 0) error->all("Illegal dump_modify command");
+  if (narg == 0) error->all(FLERR,"Illegal dump_modify command");
 
   int iarg = 0;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"append") == 0) {
-      if (iarg+2 > narg) error->all("Illegal dump_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command");
       if (strcmp(arg[iarg+1],"yes") == 0) append_flag = 1;
       else if (strcmp(arg[iarg+1],"no") == 0) append_flag = 0;
-      else error->all("Illegal dump_modify command");
+      else error->all(FLERR,"Illegal dump_modify command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"every") == 0) {
-      if (iarg+2 > narg) error->all("Illegal dump_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command");
       int idump;
       for (idump = 0; idump < output->ndump; idump++)
 	if (strcmp(id,output->dump[idump]->id) == 0) break;
@@ -646,24 +643,24 @@ void Dump::modify_params(int narg, char **arg)
 	n = 0;
       } else {
 	n = atoi(arg[iarg+1]);
-	if (n <= 0) error->all("Illegal dump_modify command");
+	if (n <= 0) error->all(FLERR,"Illegal dump_modify command");
       }
       output->every_dump[idump] = n;
       iarg += 2;
     } else if (strcmp(arg[iarg],"first") == 0) {
-      if (iarg+2 > narg) error->all("Illegal dump_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command");
       if (strcmp(arg[iarg+1],"yes") == 0) first_flag = 1;
       else if (strcmp(arg[iarg+1],"no") == 0) first_flag = 0;
-      else error->all("Illegal dump_modify command");
+      else error->all(FLERR,"Illegal dump_modify command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"flush") == 0) {
-      if (iarg+2 > narg) error->all("Illegal dump_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command");
       if (strcmp(arg[iarg+1],"yes") == 0) flush_flag = 1;
       else if (strcmp(arg[iarg+1],"no") == 0) flush_flag = 0;
-      else error->all("Illegal dump_modify command");
+      else error->all(FLERR,"Illegal dump_modify command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"format") == 0) {
-      if (iarg+2 > narg) error->all("Illegal dump_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command");
       delete [] format_user;
       format_user = NULL;
       if (strcmp(arg[iarg+1],"none")) {
@@ -673,12 +670,12 @@ void Dump::modify_params(int narg, char **arg)
       }
       iarg += 2;
     } else if (strcmp(arg[iarg],"pad") == 0) {
-      if (iarg+2 > narg) error->all("Illegal dump_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command");
       padflag = atoi(arg[iarg+1]);
-      if (padflag < 0) error->all("Illegal dump_modify command");
+      if (padflag < 0) error->all(FLERR,"Illegal dump_modify command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"sort") == 0) {
-      if (iarg+2 > narg) error->all("Illegal dump_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command");
       if (strcmp(arg[iarg+1],"off") == 0) sort_flag = 0;
       else if (strcmp(arg[iarg+1],"id") == 0) {
 	sort_flag = 1;
@@ -688,7 +685,7 @@ void Dump::modify_params(int narg, char **arg)
 	sort_flag = 1;
 	sortcol = atoi(arg[iarg+1]);
 	sortorder = ASCEND;
-	if (sortcol == 0) error->all("Illegal dump_modify command");
+	if (sortcol == 0) error->all(FLERR,"Illegal dump_modify command");
 	if (sortcol < 0) {
 	  sortorder = DESCEND;
 	  sortcol = -sortcol;
@@ -698,7 +695,7 @@ void Dump::modify_params(int narg, char **arg)
       iarg += 2;
     } else {
       int n = modify_param(narg-iarg,&arg[iarg]);
-      if (n == 0) error->all("Illegal dump_modify command");
+      if (n == 0) error->all(FLERR,"Illegal dump_modify command");
       iarg += n;
     }
   }
diff --git a/src/dump_atom.cpp b/src/dump_atom.cpp
index 513e6baef5c7d4b1ba034668e26a365bd9f69678..2365fb3e2e858c392d93149b1d74ab883b4ac5a9 100644
--- a/src/dump_atom.cpp
+++ b/src/dump_atom.cpp
@@ -25,7 +25,7 @@ using namespace LAMMPS_NS;
 
 DumpAtom::DumpAtom(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg)
 {
-  if (narg != 5) error->all("Illegal dump atom command");
+  if (narg != 5) error->all(FLERR,"Illegal dump atom command");
 
   scale_flag = 1;
   image_flag = 0;
@@ -120,16 +120,16 @@ void DumpAtom::init_style()
 int DumpAtom::modify_param(int narg, char **arg)
 {
   if (strcmp(arg[0],"scale") == 0) {
-    if (narg < 2) error->all("Illegal dump_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
     if (strcmp(arg[1],"yes") == 0) scale_flag = 1;
     else if (strcmp(arg[1],"no") == 0) scale_flag = 0;
-    else error->all("Illegal dump_modify command");
+    else error->all(FLERR,"Illegal dump_modify command");
     return 2;
   } else if (strcmp(arg[0],"image") == 0) {
-    if (narg < 2) error->all("Illegal dump_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
     if (strcmp(arg[1],"yes") == 0) image_flag = 1;
     else if (strcmp(arg[1],"no") == 0) image_flag = 0;
-    else error->all("Illegal dump_modify command");
+    else error->all(FLERR,"Illegal dump_modify command");
     return 2;
   }
   return 0;
diff --git a/src/dump_cfg.cpp b/src/dump_cfg.cpp
index eb1732e93fdbd67b7b67339729fb3063c3288939..940e34549fe118ea28d99f8bda426450f9b36c21 100755
--- a/src/dump_cfg.cpp
+++ b/src/dump_cfg.cpp
@@ -46,15 +46,15 @@ DumpCFG::DumpCFG(LAMMPS *lmp, int narg, char **arg) :
       (strcmp(arg[7],"xs") != 0 && strcmp(arg[7],"xsu") != 0) || 
       (strcmp(arg[8],"ys") != 0 && strcmp(arg[8],"ysu") != 0) ||
       (strcmp(arg[9],"zs") != 0 && strcmp(arg[9],"zsu") != 0))
-    error->all("Dump cfg arguments must start with "
+    error->all(FLERR,"Dump cfg arguments must start with "
 	       "'id type xs ys zs' or 'id type xsu ysu zsu'");
 
   if (strcmp(arg[7],"xs") == 0)
     if (strcmp(arg[8],"ysu") == 0 || strcmp(arg[9],"zsu") == 0)
-      error->all("Dump cfg arguments can not mix xs|ys|zs with xsu|ysu|zsu");
+      error->all(FLERR,"Dump cfg arguments can not mix xs|ys|zs with xsu|ysu|zsu");
     else unwrapflag = 0;
   else if (strcmp(arg[8],"ys") == 0 || strcmp(arg[9],"zs") == 0)
-    error->all("Dump cfg arguments can not mix xs|ys|zs with xsu|ysu|zsu");
+    error->all(FLERR,"Dump cfg arguments can not mix xs|ys|zs with xsu|ysu|zsu");
   else unwrapflag = 1;
     
   // arrays for data rearrangement
@@ -80,7 +80,7 @@ DumpCFG::DumpCFG(LAMMPS *lmp, int narg, char **arg) :
       char *ptr = strchr(suffix,'[');
       if (ptr) {
 	if (suffix[strlen(suffix)-1] != ']')
-	  error->all("Invalid keyword in dump cfg command");
+	  error->all(FLERR,"Invalid keyword in dump cfg command");
 	*ptr = '\0';
 	*(ptr+2) = '\0';
 	auxname[i] = new char[strlen(suffix) + 3];
@@ -117,7 +117,7 @@ DumpCFG::~DumpCFG()
 
 void DumpCFG::init_style()
 {
-  if (multifile == 0) error->all("Dump cfg requires one snapshot per file");
+  if (multifile == 0) error->all(FLERR,"Dump cfg requires one snapshot per file");
 
   DumpCustom::init_style();
 }
diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp
index 5a3a46b96710b540f04fd80691c2e81a8e485ba6..7382ec084cff9e7cffdeadfe229f316977ce9645 100644
--- a/src/dump_custom.cpp
+++ b/src/dump_custom.cpp
@@ -53,7 +53,7 @@ enum{INT,DOUBLE,STRING};
 DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) :
   Dump(lmp, narg, arg)
 {
-  if (narg == 5) error->all("No dump custom arguments specified");
+  if (narg == 5) error->all(FLERR,"No dump custom arguments specified");
 
   clearstep = 1;
 
@@ -97,7 +97,7 @@ DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) :
   ioptional = parse_fields(narg,arg);
 
   if (ioptional < narg && strcmp(style,"image") != 0)
-    error->all("Invalid attribute in dump custom command");
+    error->all(FLERR,"Invalid attribute in dump custom command");
   size_one = nfield = ioptional - 5;
 
   // atom selection arrays
@@ -250,23 +250,23 @@ void DumpCustom::init_style()
   int icompute;
   for (int i = 0; i < ncompute; i++) {
     icompute = modify->find_compute(id_compute[i]);
-    if (icompute < 0) error->all("Could not find dump custom compute ID");
+    if (icompute < 0) error->all(FLERR,"Could not find dump custom compute ID");
     compute[i] = modify->compute[icompute];
   }
 
   int ifix;
   for (int i = 0; i < nfix; i++) {
     ifix = modify->find_fix(id_fix[i]);
-    if (ifix < 0) error->all("Could not find dump custom fix ID");
+    if (ifix < 0) error->all(FLERR,"Could not find dump custom fix ID");
     fix[i] = modify->fix[ifix];
     if (nevery % modify->fix[ifix]->peratom_freq)
-      error->all("Dump custom and fix not computed at compatible times");
+      error->all(FLERR,"Dump custom and fix not computed at compatible times");
   }
 
   int ivariable;
   for (int i = 0; i < nvariable; i++) {
     ivariable = input->variable->find(id_variable[i]);
-    if (ivariable < 0) error->all("Could not find dump custom variable name");
+    if (ivariable < 0) error->all(FLERR,"Could not find dump custom variable name");
     variable[i] = ivariable;
   }
 
@@ -274,7 +274,7 @@ void DumpCustom::init_style()
 
   if (iregion >= 0) {
     iregion = domain->find_region(idregion);
-    if (iregion == -1) error->all("Region ID for dump custom does not exist");
+    if (iregion == -1) error->all(FLERR,"Region ID for dump custom does not exist");
   }
 
   // open single file, one time only
@@ -448,7 +448,7 @@ int DumpCustom::count()
 	nstride = 1;
       } else if (thresh_array[ithresh] == MOL) {
 	if (!atom->molecule_flag)
-	  error->all("Threshhold for an atom property that isn't allocated");
+	  error->all(FLERR,"Threshhold for an atom property that isn't allocated");
 	int *molecule = atom->molecule;
 	for (i = 0; i < nlocal; i++) dchoose[i] = molecule[i];
 	ptr = dchoose;
@@ -704,108 +704,108 @@ int DumpCustom::count()
 
       } else if (thresh_array[ithresh] == Q) {
 	if (!atom->q_flag)
-	  error->all("Threshhold for an atom property that isn't allocated");
+	  error->all(FLERR,"Threshhold for an atom property that isn't allocated");
 	ptr = atom->q;
 	nstride = 1;
       } else if (thresh_array[ithresh] == MUX) {
 	if (!atom->mu_flag)
-	  error->all("Threshhold for an atom property that isn't allocated");
+	  error->all(FLERR,"Threshhold for an atom property that isn't allocated");
 	ptr = &atom->mu[0][0];
 	nstride = 4;
       } else if (thresh_array[ithresh] == MUY) {
 	if (!atom->mu_flag)
-	  error->all("Threshhold for an atom property that isn't allocated");
+	  error->all(FLERR,"Threshhold for an atom property that isn't allocated");
 	ptr = &atom->mu[0][1];
 	nstride = 4;
       } else if (thresh_array[ithresh] == MUZ) {
 	if (!atom->mu_flag)
-	  error->all("Threshhold for an atom property that isn't allocated");
+	  error->all(FLERR,"Threshhold for an atom property that isn't allocated");
 	ptr = &atom->mu[0][2];
 	nstride = 4;
       } else if (thresh_array[ithresh] == MU) {
 	if (!atom->mu_flag)
-	  error->all("Threshhold for an atom property that isn't allocated");
+	  error->all(FLERR,"Threshhold for an atom property that isn't allocated");
 	ptr = &atom->mu[0][3];
 	nstride = 4;
 
       } else if (thresh_array[ithresh] == RADIUS) {
 	if (!atom->radius_flag)
-	  error->all("Threshhold for an atom property that isn't allocated");
+	  error->all(FLERR,"Threshhold for an atom property that isn't allocated");
 	ptr = atom->radius;
 	nstride = 1;
       } else if (thresh_array[ithresh] == DIAMETER) {
 	if (!atom->radius_flag)
-	  error->all("Threshhold for an atom property that isn't allocated");
+	  error->all(FLERR,"Threshhold for an atom property that isn't allocated");
 	double *radius = atom->radius;
 	for (i = 0; i < nlocal; i++) dchoose[i] = 2.0*radius[i];
 	ptr = dchoose;
 	nstride = 1;
       } else if (thresh_array[ithresh] == OMEGAX) {
 	if (!atom->omega_flag)
-	  error->all("Threshhold for an atom property that isn't allocated");
+	  error->all(FLERR,"Threshhold for an atom property that isn't allocated");
 	ptr = &atom->omega[0][0];
 	nstride = 3;
       } else if (thresh_array[ithresh] == OMEGAY) {
 	if (!atom->omega_flag)
-	  error->all("Threshhold for an atom property that isn't allocated");
+	  error->all(FLERR,"Threshhold for an atom property that isn't allocated");
 	ptr = &atom->omega[0][1];
 	nstride = 3;
       } else if (thresh_array[ithresh] == OMEGAZ) {
 	if (!atom->omega_flag)
-	  error->all("Threshhold for an atom property that isn't allocated");
+	  error->all(FLERR,"Threshhold for an atom property that isn't allocated");
 	ptr = &atom->omega[0][2];
 	nstride = 3;
       } else if (thresh_array[ithresh] == ANGMOMX) {
 	if (!atom->angmom_flag)
-	  error->all("Threshhold for an atom property that isn't allocated");
+	  error->all(FLERR,"Threshhold for an atom property that isn't allocated");
 	ptr = &atom->angmom[0][0];
 	nstride = 3;
       } else if (thresh_array[ithresh] == ANGMOMY) {
 	if (!atom->angmom_flag)
-	  error->all("Threshhold for an atom property that isn't allocated");
+	  error->all(FLERR,"Threshhold for an atom property that isn't allocated");
 	ptr = &atom->angmom[0][1];
 	nstride = 3;
       } else if (thresh_array[ithresh] == ANGMOMZ) {
 	if (!atom->angmom_flag)
-	  error->all("Threshhold for an atom property that isn't allocated");
+	  error->all(FLERR,"Threshhold for an atom property that isn't allocated");
 	ptr = &atom->angmom[0][2];
 	nstride = 3;
       } else if (thresh_array[ithresh] == TQX) {
 	if (!atom->torque_flag)
-	  error->all("Threshhold for an atom property that isn't allocated");
+	  error->all(FLERR,"Threshhold for an atom property that isn't allocated");
 	ptr = &atom->torque[0][0];
 	nstride = 3;
       } else if (thresh_array[ithresh] == TQY) {
 	if (!atom->torque_flag)
-	  error->all("Threshhold for an atom property that isn't allocated");
+	  error->all(FLERR,"Threshhold for an atom property that isn't allocated");
 	ptr = &atom->torque[0][1];
 	nstride = 3;
       } else if (thresh_array[ithresh] == TQZ) {
 	if (!atom->torque_flag)
-	  error->all("Threshhold for an atom property that isn't allocated");
+	  error->all(FLERR,"Threshhold for an atom property that isn't allocated");
 	ptr = &atom->torque[0][2];
 	nstride = 3;
 
       } else if (thresh_array[ithresh] == SPIN) {
 	if (!atom->spin_flag)
-	  error->all("Threshhold for an atom property that isn't allocated");
+	  error->all(FLERR,"Threshhold for an atom property that isn't allocated");
         int *spin = atom->spin;
         for (i = 0; i < nlocal; i++) dchoose[i] = spin[i];
         ptr = dchoose;
         nstride = 1;
       } else if (thresh_array[ithresh] == ERADIUS) {
 	if (!atom->eradius_flag)
-	  error->all("Threshhold for an atom property that isn't allocated");
+	  error->all(FLERR,"Threshhold for an atom property that isn't allocated");
         ptr = atom->eradius;
         nstride = 1;
       } else if (thresh_array[ithresh] == ERVEL) {
 	if (!atom->ervel_flag)
-	  error->all("Threshhold for an atom property that isn't allocated");
+	  error->all(FLERR,"Threshhold for an atom property that isn't allocated");
         ptr = atom->ervel;
         nstride = 1;
       } else if (thresh_array[ithresh] == ERFORCE) {
 	if (!atom->erforce_flag)
-	  error->all("Threshhold for an atom property that isn't allocated");
+	  error->all(FLERR,"Threshhold for an atom property that isn't allocated");
         ptr = atom->erforce;
         nstride = 1;				
 
@@ -934,7 +934,7 @@ int DumpCustom::parse_fields(int narg, char **arg)
       vtype[i] = INT;
     } else if (strcmp(arg[iarg],"mol") == 0) {
       if (!atom->molecule_flag)
-	error->all("Dumping an atom property that isn't allocated");
+	error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_molecule;
       vtype[i] = INT;
     } else if (strcmp(arg[iarg],"type") == 0) {
@@ -1023,104 +1023,104 @@ int DumpCustom::parse_fields(int narg, char **arg)
 
     } else if (strcmp(arg[iarg],"q") == 0) {
       if (!atom->q_flag)
-	error->all("Dumping an atom property that isn't allocated");
+	error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_q;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"mux") == 0) {
       if (!atom->mu_flag)
-	error->all("Dumping an atom property that isn't allocated");
+	error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_mux;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"muy") == 0) {
       if (!atom->mu_flag)
-	error->all("Dumping an atom property that isn't allocated");
+	error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_muy;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"muz") == 0) {
       if (!atom->mu_flag)
-	error->all("Dumping an atom property that isn't allocated");
+	error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_muz;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"mu") == 0) {
       if (!atom->mu_flag)
-	error->all("Dumping an atom property that isn't allocated");
+	error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_mu;
       vtype[i] = DOUBLE;
 
     } else if (strcmp(arg[iarg],"radius") == 0) {
       if (!atom->radius_flag)
-	error->all("Dumping an atom property that isn't allocated");
+	error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_radius;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"diameter") == 0) {
       if (!atom->radius_flag)
-	error->all("Dumping an atom property that isn't allocated");
+	error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_diameter;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"omegax") == 0) {
       if (!atom->omega_flag)
-	error->all("Dumping an atom property that isn't allocated");
+	error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_omegax;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"omegay") == 0) {
       if (!atom->omega_flag)
-	error->all("Dumping an atom property that isn't allocated");
+	error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_omegay;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"omegaz") == 0) {
       if (!atom->omega_flag)
-	error->all("Dumping an atom property that isn't allocated");
+	error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_omegaz;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"angmomx") == 0) {
       if (!atom->angmom_flag)
-	error->all("Dumping an atom property that isn't allocated");
+	error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_angmomx;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"angmomy") == 0) {
       if (!atom->angmom_flag)
-	error->all("Dumping an atom property that isn't allocated");
+	error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_angmomy;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"angmomz") == 0) {
       if (!atom->angmom_flag)
-	error->all("Dumping an atom property that isn't allocated");
+	error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_angmomz;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"tqx") == 0) {
       if (!atom->torque_flag)
-	error->all("Dumping an atom property that isn't allocated");
+	error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_tqx;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"tqy") == 0) {
       if (!atom->torque_flag)
-	error->all("Dumping an atom property that isn't allocated");
+	error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_tqy;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"tqz") == 0) {
       if (!atom->torque_flag)
-	error->all("Dumping an atom property that isn't allocated");
+	error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_tqz;
       vtype[i] = DOUBLE;
 
     } else if (strcmp(arg[iarg],"spin") == 0) {
       if (!atom->spin_flag)
-        error->all("Dumping an atom quantity that isn't allocated");
+        error->all(FLERR,"Dumping an atom quantity that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_spin;
       vtype[i] = INT;
     } else if (strcmp(arg[iarg],"eradius") == 0) {
       if (!atom->eradius_flag)
-        error->all("Dumping an atom quantity that isn't allocated");
+        error->all(FLERR,"Dumping an atom quantity that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_eradius;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"ervel") == 0) {
       if (!atom->ervel_flag)
-        error->all("Dumping an atom quantity that isn't allocated");
+        error->all(FLERR,"Dumping an atom quantity that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_ervel;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"erforce") == 0) {
       if (!atom->erforce_flag)
-        error->all("Dumping an atom quantity that isn't allocated");
+        error->all(FLERR,"Dumping an atom quantity that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_erforce;
       vtype[i] = DOUBLE;
 
@@ -1138,22 +1138,22 @@ int DumpCustom::parse_fields(int narg, char **arg)
       char *ptr = strchr(suffix,'[');
       if (ptr) {
 	if (suffix[strlen(suffix)-1] != ']')
-	  error->all("Invalid attribute in dump custom command");
+	  error->all(FLERR,"Invalid attribute in dump custom command");
 	argindex[i] = atoi(ptr+1);
 	*ptr = '\0';
       } else argindex[i] = 0;
 
       n = modify->find_compute(suffix);
-      if (n < 0) error->all("Could not find dump custom compute ID");
+      if (n < 0) error->all(FLERR,"Could not find dump custom compute ID");
       if (modify->compute[n]->peratom_flag == 0)
-	error->all("Dump custom compute does not compute per-atom info");
+	error->all(FLERR,"Dump custom compute does not compute per-atom info");
       if (argindex[i] == 0 && modify->compute[n]->size_peratom_cols > 0)
-	error->all("Dump custom compute does not calculate per-atom vector");
+	error->all(FLERR,"Dump custom compute does not calculate per-atom vector");
       if (argindex[i] > 0 && modify->compute[n]->size_peratom_cols == 0)
-	error->all("Dump custom compute does not calculate per-atom array");
+	error->all(FLERR,"Dump custom compute does not calculate per-atom array");
       if (argindex[i] > 0 && 
 	  argindex[i] > modify->compute[n]->size_peratom_cols)
-	error->all("Dump custom compute vector is accessed out-of-range");
+	error->all(FLERR,"Dump custom compute vector is accessed out-of-range");
 
       field2index[i] = add_compute(suffix);
       delete [] suffix;
@@ -1172,22 +1172,22 @@ int DumpCustom::parse_fields(int narg, char **arg)
       char *ptr = strchr(suffix,'[');
       if (ptr) {
 	if (suffix[strlen(suffix)-1] != ']')
-	  error->all("Invalid attribute in dump custom command");
+	  error->all(FLERR,"Invalid attribute in dump custom command");
 	argindex[i] = atoi(ptr+1);
 	*ptr = '\0';
       } else argindex[i] = 0;
 
       n = modify->find_fix(suffix);
-      if (n < 0) error->all("Could not find dump custom fix ID");
+      if (n < 0) error->all(FLERR,"Could not find dump custom fix ID");
       if (modify->fix[n]->peratom_flag == 0)
-	error->all("Dump custom fix does not compute per-atom info");
+	error->all(FLERR,"Dump custom fix does not compute per-atom info");
       if (argindex[i] == 0 && modify->fix[n]->size_peratom_cols > 0)
-	error->all("Dump custom fix does not compute per-atom vector");
+	error->all(FLERR,"Dump custom fix does not compute per-atom vector");
       if (argindex[i] > 0 && modify->fix[n]->size_peratom_cols == 0)
-	error->all("Dump custom fix does not compute per-atom array");
+	error->all(FLERR,"Dump custom fix does not compute per-atom array");
       if (argindex[i] > 0 && 
 	  argindex[i] > modify->fix[n]->size_peratom_cols)
-	error->all("Dump custom fix vector is accessed out-of-range");
+	error->all(FLERR,"Dump custom fix vector is accessed out-of-range");
 
       field2index[i] = add_fix(suffix);
       delete [] suffix;
@@ -1205,9 +1205,9 @@ int DumpCustom::parse_fields(int narg, char **arg)
       argindex[i] = 0;
 
       n = input->variable->find(suffix);
-      if (n < 0) error->all("Could not find dump custom variable name");
+      if (n < 0) error->all(FLERR,"Could not find dump custom variable name");
       if (input->variable->atomstyle(n) == 0)
-	error->all("Dump custom variable is not atom-style variable");
+	error->all(FLERR,"Dump custom variable is not atom-style variable");
 
       field2index[i] = add_variable(suffix);
       delete [] suffix;
@@ -1302,11 +1302,11 @@ int DumpCustom::add_variable(char *id)
 int DumpCustom::modify_param(int narg, char **arg)
 {
   if (strcmp(arg[0],"region") == 0) {
-    if (narg < 2) error->all("Illegal dump_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
     if (strcmp(arg[1],"none") == 0) iregion = -1;
     else {
       iregion = domain->find_region(arg[1]);
-      if (iregion == -1) error->all("Dump_modify region ID does not exist");
+      if (iregion == -1) error->all(FLERR,"Dump_modify region ID does not exist");
       int n = strlen(arg[1]) + 1;
       idregion = new char[n];
       strcpy(idregion,arg[1]);
@@ -1315,7 +1315,7 @@ int DumpCustom::modify_param(int narg, char **arg)
     
   } else if (strcmp(arg[0],"element") == 0) {
     if (narg < ntypes+1)
-      error->all("Dump modify element names do not match atom types");
+      error->all(FLERR,"Dump modify element names do not match atom types");
 
     if (typenames) {
       for (int i = 1; i <= ntypes; i++) delete [] typenames[i];
@@ -1332,7 +1332,7 @@ int DumpCustom::modify_param(int narg, char **arg)
     return ntypes+1;
 
   } else if (strcmp(arg[0],"thresh") == 0) {
-    if (narg < 2) error->all("Illegal dump_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
     if (strcmp(arg[1],"none") == 0) {
       if (nthresh) {
 	memory->destroy(thresh_array);
@@ -1346,7 +1346,7 @@ int DumpCustom::modify_param(int narg, char **arg)
       return 2;
     }
     
-    if (narg < 4) error->all("Illegal dump_modify command");
+    if (narg < 4) error->all(FLERR,"Illegal dump_modify command");
     
     // grow threshhold arrays
     
@@ -1453,25 +1453,25 @@ int DumpCustom::modify_param(int narg, char **arg)
       char *ptr = strchr(suffix,'[');
       if (ptr) {
 	if (suffix[strlen(suffix)-1] != ']')
-	  error->all("Invalid attribute in dump modify command");
+	  error->all(FLERR,"Invalid attribute in dump modify command");
 	argindex[nfield+nthresh] = atoi(ptr+1);
 	*ptr = '\0';
       } else argindex[nfield+nthresh] = 0;
       
       n = modify->find_compute(suffix);
-      if (n < 0) error->all("Could not find dump modify compute ID");
+      if (n < 0) error->all(FLERR,"Could not find dump modify compute ID");
 
       if (modify->compute[n]->peratom_flag == 0)
-	error->all("Dump modify compute ID does not compute per-atom info");
+	error->all(FLERR,"Dump modify compute ID does not compute per-atom info");
       if (argindex[nfield+nthresh] == 0 && 
 	  modify->compute[n]->size_peratom_cols > 0)
-	error->all("Dump modify compute ID does not compute per-atom vector");
+	error->all(FLERR,"Dump modify compute ID does not compute per-atom vector");
       if (argindex[nfield+nthresh] > 0 && 
 	  modify->compute[n]->size_peratom_cols == 0)
-	error->all("Dump modify compute ID does not compute per-atom array");
+	error->all(FLERR,"Dump modify compute ID does not compute per-atom array");
       if (argindex[nfield+nthresh] > 0 && 
 	  argindex[nfield+nthresh] > modify->compute[n]->size_peratom_cols)
-	error->all("Dump modify compute ID vector is not large enough");
+	error->all(FLERR,"Dump modify compute ID vector is not large enough");
 
       field2index[nfield+nthresh] = add_compute(suffix);
       delete [] suffix;
@@ -1491,25 +1491,25 @@ int DumpCustom::modify_param(int narg, char **arg)
       char *ptr = strchr(suffix,'[');
       if (ptr) {
 	if (suffix[strlen(suffix)-1] != ']')
-	  error->all("Invalid attribute in dump modify command");
+	  error->all(FLERR,"Invalid attribute in dump modify command");
 	argindex[nfield+nthresh] = atoi(ptr+1);
 	*ptr = '\0';
       } else argindex[nfield+nthresh] = 0;
       
       n = modify->find_fix(suffix);
-      if (n < 0) error->all("Could not find dump modify fix ID");
+      if (n < 0) error->all(FLERR,"Could not find dump modify fix ID");
 
       if (modify->fix[n]->peratom_flag == 0)
-	error->all("Dump modify fix ID does not compute per-atom info");
+	error->all(FLERR,"Dump modify fix ID does not compute per-atom info");
       if (argindex[nfield+nthresh] == 0 && 
 	  modify->fix[n]->size_peratom_cols > 0)
-	error->all("Dump modify fix ID does not compute per-atom vector");
+	error->all(FLERR,"Dump modify fix ID does not compute per-atom vector");
       if (argindex[nfield+nthresh] > 0 && 
 	  modify->fix[n]->size_peratom_cols == 0)
-	error->all("Dump modify fix ID does not compute per-atom array");
+	error->all(FLERR,"Dump modify fix ID does not compute per-atom array");
       if (argindex[nfield+nthresh] > 0 && 
 	  argindex[nfield+nthresh] > modify->fix[n]->size_peratom_cols)
-	error->all("Dump modify fix ID vector is not large enough");
+	error->all(FLERR,"Dump modify fix ID vector is not large enough");
 
       field2index[nfield+nthresh] = add_fix(suffix);
       delete [] suffix;
@@ -1528,14 +1528,14 @@ int DumpCustom::modify_param(int narg, char **arg)
       argindex[nfield+nthresh] = 0;
       
       n = input->variable->find(suffix);
-      if (n < 0) error->all("Could not find dump modify variable name");
+      if (n < 0) error->all(FLERR,"Could not find dump modify variable name");
       if (input->variable->atomstyle(n) == 0)
-	error->all("Dump modify variable is not atom-style variable");
+	error->all(FLERR,"Dump modify variable is not atom-style variable");
 
       field2index[nfield+nthresh] = add_variable(suffix);
       delete [] suffix;
 
-    } else error->all("Invalid dump_modify threshhold operator");
+    } else error->all(FLERR,"Invalid dump_modify threshhold operator");
 
     // set operation type of threshhold
 
@@ -1545,7 +1545,7 @@ int DumpCustom::modify_param(int narg, char **arg)
     else if (strcmp(arg[2],">=") == 0) thresh_op[nthresh] = GE;
     else if (strcmp(arg[2],"==") == 0) thresh_op[nthresh] = EQ;
     else if (strcmp(arg[2],"!=") == 0) thresh_op[nthresh] = NEQ;
-    else error->all("Invalid dump_modify threshhold operator");
+    else error->all(FLERR,"Invalid dump_modify threshhold operator");
 
     // set threshhold value
 
diff --git a/src/dump_dcd.cpp b/src/dump_dcd.cpp
index d00c1cc5bbf4e680c83b1d0e7404493353cee4cb..a9d048f8df54298eb372b8ef44475a91f4573234 100644
--- a/src/dump_dcd.cpp
+++ b/src/dump_dcd.cpp
@@ -55,9 +55,9 @@ static inline void fwrite_int32(FILE* fd, uint32_t i)
 
 DumpDCD::DumpDCD(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg)
 {
-  if (narg != 5) error->all("Illegal dump dcd command");
+  if (narg != 5) error->all(FLERR,"Illegal dump dcd command");
   if (binary || compressed || multifile || multiproc)
-    error->all("Invalid dump dcd filename");
+    error->all(FLERR,"Invalid dump dcd filename");
 
   size_one = 3;
   sort_flag = 1;
@@ -69,7 +69,7 @@ DumpDCD::DumpDCD(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg)
   // allocate global array for atom coords
 
   bigint n = group->count(igroup);
-  if (n > MAXSMALLINT/sizeof(float)) error->all("Too many atoms for dump dcd");
+  if (n > MAXSMALLINT/sizeof(float)) error->all(FLERR,"Too many atoms for dump dcd");
   natoms = static_cast<int> (n);
 
   memory->create(coords,3*natoms,"dump:coords");
@@ -95,7 +95,7 @@ DumpDCD::~DumpDCD()
 void DumpDCD::init_style()
 {
   if (sort_flag == 0 || sortcol != 0)
-    error->all("Dump dcd requires sorting by atom ID");
+    error->all(FLERR,"Dump dcd requires sorting by atom ID");
 
   // check that dump frequency has not changed and is not a variable
 
@@ -103,11 +103,11 @@ void DumpDCD::init_style()
   for (idump = 0; idump < output->ndump; idump++)
     if (strcmp(id,output->dump[idump]->id) == 0) break;
   if (output->every_dump[idump] == 0)
-    error->all("Cannot use variable every setting for dump dcd");
+    error->all(FLERR,"Cannot use variable every setting for dump dcd");
 
   if (nevery_save == 0) nevery_save = output->every_dump[idump];
   else if (nevery_save != output->every_dump[idump])
-    error->all("Cannot change dump_modify every for dump dcd");
+    error->all(FLERR,"Cannot change dump_modify every for dump dcd");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -116,7 +116,7 @@ void DumpDCD::openfile()
 {
   if (me == 0) {
     fp = fopen(filename,"wb");
-    if (fp == NULL) error->one("Cannot open dump file");
+    if (fp == NULL) error->one(FLERR,"Cannot open dump file");
   }
 }
 
@@ -124,9 +124,9 @@ void DumpDCD::openfile()
 
 void DumpDCD::write_header(bigint n)
 {
-  if (n != natoms) error->all("Dump dcd of non-matching # of atoms");
+  if (n != natoms) error->all(FLERR,"Dump dcd of non-matching # of atoms");
   if (update->ntimestep > MAXSMALLINT)
-    error->all("Too big a timestep for dump dcd");
+    error->all(FLERR,"Too big a timestep for dump dcd");
 
   // first time, write header for entire file
 
@@ -266,10 +266,10 @@ void DumpDCD::write_data(int n, double *mybuf)
 int DumpDCD::modify_param(int narg, char **arg)
 {
   if (strcmp(arg[0],"unwrap") == 0) {
-    if (narg < 2) error->all("Illegal dump_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
     if (strcmp(arg[1],"yes") == 0) unwrap_flag = 1;
     else if (strcmp(arg[1],"no") == 0) unwrap_flag = 0;
-    else error->all("Illegal dump_modify command");
+    else error->all(FLERR,"Illegal dump_modify command");
     return 2;
   }
   return 0;
diff --git a/src/dump_image.cpp b/src/dump_image.cpp
index 717fb0a7f4a9d3b22c916323de9b1ae2783a6360..f01326c815511994120f54e465c992af5207a695 100644
--- a/src/dump_image.cpp
+++ b/src/dump_image.cpp
@@ -50,15 +50,12 @@ enum{CONTINUOUS,DISCRETE,SEQUENTIAL};
 enum{ABSOLUTE,FRACTIONAL};
 enum{NO,YES};
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : 
   DumpCustom(lmp, narg, arg)
 {
-  if (binary || multiproc) error->all("Invalid dump image filename");
+  if (binary || multiproc) error->all(FLERR,"Invalid dump image filename");
 
   PI = 4.0*atan(1.0);
 
@@ -72,12 +69,12 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
   else filetype = PPM;
 
 #ifndef LAMMPS_JPEG
-  if (filetype == JPG) error->all("Cannot dump JPG file");
+  if (filetype == JPG) error->all(FLERR,"Cannot dump JPG file");
 #endif
 
   // atom color,diameter settings
 
-  if (nfield != 2) error->all("Illegal dump image command");
+  if (nfield != 2) error->all(FLERR,"Illegal dump image command");
 
   acolor = ATTRIBUTE;
   if (strcmp(arg[5],"type") == 0) acolor = TYPE;
@@ -125,47 +122,47 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
   int iarg = ioptional;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"adiam") == 0) {
-      if (iarg+2 > narg) error->all("Illegal dump image command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
       adiam = NUMERIC;
       adiamvalue = atof(arg[iarg+1]);
-      if (adiamvalue <= 0.0) error->all("Illegal dump image command");
+      if (adiamvalue <= 0.0) error->all(FLERR,"Illegal dump image command");
       iarg += 2;
 
     } else if (strcmp(arg[iarg],"atom") == 0) {
-      if (iarg+2 > narg) error->all("Illegal dump image command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
       if (strcmp(arg[iarg+1],"yes") == 0) atomflag = YES;
       else if (strcmp(arg[iarg+1],"no") == 0) atomflag = NO;
-      else error->all("Illegal dump image command");
+      else error->all(FLERR,"Illegal dump image command");
       iarg += 2;
 
     } else if (strcmp(arg[iarg],"bond") == 0) {
-      if (iarg+3 > narg) error->all("Illegal dump image command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
       if (atom->nbondtypes == 0)
-	error->all("Dump image bond not allowed with no bond types");
+	error->all(FLERR,"Dump image bond not allowed with no bond types");
       bondflag = YES;
       if (strcmp(arg[iarg+1],"none") == 0) bondflag = NO;
       else if (strcmp(arg[iarg+1],"atom") == 0) bcolor = ATOM;
       else if (strcmp(arg[iarg+1],"type") == 0) bcolor = TYPE;
-      else error->all("Illegal dump image command");
+      else error->all(FLERR,"Illegal dump image command");
       if (!islower(arg[iarg+2][0])) {
 	  bdiam = NUMERIC;
 	  bdiamvalue = atof(arg[iarg+2]);
-	  if (bdiamvalue <= 0.0) error->all("Illegal dump image command");
+	  if (bdiamvalue <= 0.0) error->all(FLERR,"Illegal dump image command");
       } else if (strcmp(arg[iarg+2],"atom") == 0) bdiam = ATOM;
       else if (strcmp(arg[iarg+2],"type") == 0) bdiam = TYPE;
       else if (strcmp(arg[iarg+2],"none") == 0) bondflag = NO;
-      else error->all("Illegal dump image command");
+      else error->all(FLERR,"Illegal dump image command");
       iarg += 3;
 
     } else if (strcmp(arg[iarg],"size") == 0) {
-      if (iarg+3 > narg) error->all("Illegal dump image command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
       width = atoi(arg[iarg+1]);
       height = atoi(arg[iarg+2]);
-      if (width <= 0 || height <= 0) error->all("Illegal dump image command");
+      if (width <= 0 || height <= 0) error->all(FLERR,"Illegal dump image command");
       iarg += 3;
 
     } else if (strcmp(arg[iarg],"view") == 0) {
-      if (iarg+3 > narg) error->all("Illegal dump image command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
       if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
 	int n = strlen(&arg[iarg+1][2]) + 1;
 	thetastr = new char[n];
@@ -173,7 +170,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
       } else {
 	theta = atof(arg[iarg+1]);
 	if (theta < 0.0 || theta > 180.0)
-	  error->all("Invalid dump image theta value");
+	  error->all(FLERR,"Invalid dump image theta value");
 	theta *= PI/180.0;
       }
       if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
@@ -187,10 +184,10 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
       iarg += 3;
 
     } else if (strcmp(arg[iarg],"center") == 0) {
-      if (iarg+5 > narg) error->all("Illegal dump image command");
+      if (iarg+5 > narg) error->all(FLERR,"Illegal dump image command");
       if (strcmp(arg[iarg+1],"s") == 0) cflag = STATIC;
       else if (strcmp(arg[iarg+1],"d") == 0) cflag = DYNAMIC;
-      else error->all("Illegal dump image command");
+      else error->all(FLERR,"Illegal dump image command");
       if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
 	int n = strlen(&arg[iarg+2][2]) + 1;
 	cxstr = new char[n];
@@ -212,7 +209,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
       iarg += 5;
 
     } else if (strcmp(arg[iarg],"up") == 0) {
-      if (iarg+4 > narg) error->all("Illegal dump image command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal dump image command");
       if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
 	int n = strlen(&arg[iarg+1][2]) + 1;
 	upxstr = new char[n];
@@ -231,70 +228,70 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
       iarg += 4;
 
     } else if (strcmp(arg[iarg],"zoom") == 0) {
-      if (iarg+2 > narg) error->all("Illegal dump image command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
       if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
 	int n = strlen(&arg[iarg+1][2]) + 1;
 	zoomstr = new char[n];
 	strcpy(zoomstr,&arg[iarg+1][2]);
       } else {
 	zoom = atof(arg[iarg+1]);
-	if (zoom <= 0.0) error->all("Illegal dump image command");
+	if (zoom <= 0.0) error->all(FLERR,"Illegal dump image command");
       }
       iarg += 2;
 
     } else if (strcmp(arg[iarg],"persp") == 0) {
-      error->all("Dump image persp option is not yet supported");
-      if (iarg+2 > narg) error->all("Illegal dump image command");
+      error->all(FLERR,"Dump image persp option is not yet supported");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
       if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
 	int n = strlen(&arg[iarg+1][2]) + 1;
 	perspstr = new char[n];
 	strcpy(perspstr,&arg[iarg+1][2]);
       } else {
 	persp = atof(arg[iarg+1]);
-	if (persp < 0.0) error->all("Illegal dump image command");
+	if (persp < 0.0) error->all(FLERR,"Illegal dump image command");
       }
       iarg += 2;
 
     } else if (strcmp(arg[iarg],"box") == 0) {
-      if (iarg+3 > narg) error->all("Illegal dump image command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
       if (strcmp(arg[iarg+1],"yes") == 0) boxflag = YES;
       else if (strcmp(arg[iarg+1],"no") == 0) boxflag = NO;
-      else error->all("Illegal dump image command");
+      else error->all(FLERR,"Illegal dump image command");
       boxdiam = atof(arg[iarg+2]);
-      if (boxdiam < 0.0) error->all("Illegal dump image command");
+      if (boxdiam < 0.0) error->all(FLERR,"Illegal dump image command");
       iarg += 3;
 
     } else if (strcmp(arg[iarg],"axes") == 0) {
-      if (iarg+3 > narg) error->all("Illegal dump image command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
       if (strcmp(arg[iarg+1],"yes") == 0) axesflag = YES;
       else if (strcmp(arg[iarg+1],"no") == 0) axesflag = NO;
-      else error->all("Illegal dump image command");
+      else error->all(FLERR,"Illegal dump image command");
       axeslen = atof(arg[iarg+2]);
       axesdiam = atof(arg[iarg+3]);
       if (axeslen < 0.0 || axesdiam < 0.0)
-	error->all("Illegal dump image command");
+	error->all(FLERR,"Illegal dump image command");
       iarg += 4;
 
     } else if (strcmp(arg[iarg],"shiny") == 0) {
-      if (iarg+2 > narg) error->all("Illegal dump image command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
       shiny = atof(arg[iarg+1]);
       if (shiny < 0.0 || shiny > 1.0)
-	error->all("Illegal dump image command");
+	error->all(FLERR,"Illegal dump image command");
       iarg += 2;
 
     } else if (strcmp(arg[iarg],"ssao") == 0) {
-      if (iarg+4 > narg) error->all("Illegal dump image command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal dump image command");
       if (strcmp(arg[iarg+1],"yes") == 0) ssao = YES;
       else if (strcmp(arg[iarg+1],"no") == 0) ssao = NO;
-      else error->all("Illegal dump image command");
+      else error->all(FLERR,"Illegal dump image command");
       seed = atoi(arg[iarg+2]);
-      if (seed <= 0) error->all("Illegal dump image command");
+      if (seed <= 0) error->all(FLERR,"Illegal dump image command");
       ssaoint = atof(arg[iarg+3]);
       if (ssaoint < 0.0 || ssaoint > 1.0)
-	error->all("Illegal dump image command");
+	error->all(FLERR,"Illegal dump image command");
       iarg += 4;
 
-    } else error->all("Illegal dump image command");
+    } else error->all(FLERR,"Illegal dump image command");
   }
 
   // params based on args
@@ -449,8 +446,8 @@ DumpImage::~DumpImage()
 
 void DumpImage::init_style()
 {
-  if (multifile == 0) error->all("Dump image requires one snapshot per file");
-  if (sort_flag) error->all("Dump image cannot perform sorting");
+  if (multifile == 0) error->all(FLERR,"Dump image requires one snapshot per file");
+  if (sort_flag) error->all(FLERR,"Dump image cannot perform sorting");
 
   DumpCustom::init_style();
 
@@ -459,72 +456,72 @@ void DumpImage::init_style()
   if (thetastr) {
     thetavar = input->variable->find(thetastr);
     if (thetavar < 0) 
-      error->all("Variable name for dump image theta does not exist");
+      error->all(FLERR,"Variable name for dump image theta does not exist");
     if (!input->variable->equalstyle(thetavar))
-      error->all("Variable for dump image theta is invalid style");
+      error->all(FLERR,"Variable for dump image theta is invalid style");
   }
   if (phistr) {
     phivar = input->variable->find(phistr);
     if (phivar < 0) 
-      error->all("Variable name for dump image phi does not exist");
+      error->all(FLERR,"Variable name for dump image phi does not exist");
     if (!input->variable->equalstyle(phivar))
-      error->all("Variable for dump image phi is invalid style");
+      error->all(FLERR,"Variable for dump image phi is invalid style");
   }
   if (cxstr) {
     cxvar = input->variable->find(cxstr);
     if (cxvar < 0) 
-      error->all("Variable name for dump image center does not exist");
+      error->all(FLERR,"Variable name for dump image center does not exist");
     if (!input->variable->equalstyle(cxvar))
-      error->all("Variable for dump image center is invalid style");
+      error->all(FLERR,"Variable for dump image center is invalid style");
   }
   if (cystr) {
     cyvar = input->variable->find(cystr);
     if (cyvar < 0) 
-      error->all("Variable name for dump image center does not exist");
+      error->all(FLERR,"Variable name for dump image center does not exist");
     if (!input->variable->equalstyle(cyvar))
-      error->all("Variable for dump image center is invalid style");
+      error->all(FLERR,"Variable for dump image center is invalid style");
   }
   if (czstr) {
     czvar = input->variable->find(czstr);
     if (czvar < 0) 
-      error->all("Variable name for dump image center does not exist");
+      error->all(FLERR,"Variable name for dump image center does not exist");
     if (!input->variable->equalstyle(czvar))
-      error->all("Variable for dump image center is invalid style");
+      error->all(FLERR,"Variable for dump image center is invalid style");
   }
   if (upxstr) {
     upxvar = input->variable->find(upxstr);
     if (upxvar < 0) 
-      error->all("Variable name for dump image center does not exist");
+      error->all(FLERR,"Variable name for dump image center does not exist");
     if (!input->variable->equalstyle(upxvar))
-      error->all("Variable for dump image center is invalid style");
+      error->all(FLERR,"Variable for dump image center is invalid style");
   }
   if (upystr) {
     upyvar = input->variable->find(upystr);
     if (upyvar < 0) 
-      error->all("Variable name for dump image center does not exist");
+      error->all(FLERR,"Variable name for dump image center does not exist");
     if (!input->variable->equalstyle(upyvar))
-      error->all("Variable for dump image center is invalid style");
+      error->all(FLERR,"Variable for dump image center is invalid style");
   }
   if (upzstr) {
     upzvar = input->variable->find(upzstr);
     if (upzvar < 0) 
-      error->all("Variable name for dump image center does not exist");
+      error->all(FLERR,"Variable name for dump image center does not exist");
     if (!input->variable->equalstyle(upzvar))
-      error->all("Variable for dump image center is invalid style");
+      error->all(FLERR,"Variable for dump image center is invalid style");
   }
   if (zoomstr) {
     zoomvar = input->variable->find(zoomstr);
     if (zoomvar < 0) 
-      error->all("Variable name for dump image zoom does not exist");
+      error->all(FLERR,"Variable name for dump image zoom does not exist");
     if (!input->variable->equalstyle(zoomvar))
-      error->all("Variable for dump image zoom is invalid style");
+      error->all(FLERR,"Variable for dump image zoom is invalid style");
   }
   if (perspstr) {
     perspvar = input->variable->find(perspstr);
     if (perspvar < 0) 
-      error->all("Variable name for dump image persp does not exist");
+      error->all(FLERR,"Variable name for dump image persp does not exist");
     if (!input->variable->equalstyle(perspvar))
-      error->all("Variable for dump image persp is invalid style");
+      error->all(FLERR,"Variable for dump image persp is invalid style");
   }
 
   // set up type -> element mapping
@@ -533,7 +530,7 @@ void DumpImage::init_style()
     for (int i = 1; i <= ntypes; i++) {
       colorelement[i] = element2color(typenames[i]);
       if (colorelement[i] == NULL)
-	error->all("Invalid dump image element name");
+	error->all(FLERR,"Invalid dump image element name");
     }
   }
 
@@ -541,7 +538,7 @@ void DumpImage::init_style()
     for (int i = 1; i <= ntypes; i++) {
       diamelement[i] = element2diam(typenames[i]);
       if (diamelement[i] == 0.0)
-	error->all("Invalid dump image element name");
+	error->all(FLERR,"Invalid dump image element name");
     }
   }
 }
@@ -678,7 +675,7 @@ void DumpImage::view_params()
   if (thetastr) {
     theta = input->variable->compute_equal(thetavar);
     if (theta < 0.0 || theta > 180.0)
-      error->all("Invalid dump image theta value");
+      error->all(FLERR,"Invalid dump image theta value");
     theta *= PI/180.0;
   }
   if (phistr) {
@@ -702,9 +699,9 @@ void DumpImage::view_params()
   box_bounds();
 
   if (zoomstr) zoom = input->variable->compute_equal(zoomvar);
-  if (zoom <= 0.0) error->all("Invalid dump image zoom value");
+  if (zoom <= 0.0) error->all(FLERR,"Invalid dump image zoom value");
   if (perspstr) persp = input->variable->compute_equal(perspvar);
-  if (persp < 0.0) error->all("Invalid dump image persp value");
+  if (persp < 0.0) error->all(FLERR,"Invalid dump image persp value");
 
   double delx = 2.0*(boxxhi-boxxlo);
   double dely = 2.0*(boxyhi-boxylo);
@@ -735,7 +732,7 @@ void DumpImage::view_params()
   MathExtra::norm3(camRight);
   MathExtra::cross3(camDir,camRight,camUp);
   if (camUp[0] == 0.0 && camUp[1] == 0.0 && camUp[2] == 0.0)
-    error->all("Invalid dump image up vector");
+    error->all(FLERR,"Invalid dump image up vector");
   MathExtra::norm3(camUp);
 
   // light directions in terms of -camDir = z
@@ -832,7 +829,7 @@ void DumpImage::color_minmax()
   else locurrent = mlovalue;
   if (mhi == MAXVALUE) hicurrent = twoall[1];
   else hicurrent = mhivalue;
-  if (locurrent > hicurrent) error->all("Invalid dump image color range");
+  if (locurrent > hicurrent) error->all(FLERR,"Invalid dump image color range");
 
   if (mstyle == CONTINUOUS) {
     if (mrange == ABSOLUTE) mentry[0].svalue = locurrent;
@@ -1574,7 +1571,7 @@ int DumpImage::modify_param(int narg, char **arg)
   if (n) return n;
 
   if (strcmp(arg[0],"acolor") == 0) {
-    if (narg < 3) error->all("Illegal dump_modify command");
+    if (narg < 3) error->all(FLERR,"Illegal dump_modify command");
     int nlo,nhi;
     force->bounds(arg[1],atom->ntypes,nlo,nhi);
 
@@ -1599,47 +1596,47 @@ int DumpImage::modify_param(int narg, char **arg)
     for (int i = nlo; i <= nhi; i++) {
       colortype[i] = color2rgb(ptrs[m%ncount]);
       if (colortype[i] == NULL)
-	error->all("Invalid color in dump_modify command");
+	error->all(FLERR,"Invalid color in dump_modify command");
       m++;
     }
 
     delete [] ptrs;
     return 3;
   } else if (strcmp(arg[0],"adiam") == 0) {
-    if (narg < 3) error->all("Illegal dump_modify command");
+    if (narg < 3) error->all(FLERR,"Illegal dump_modify command");
     int nlo,nhi;
     force->bounds(arg[1],atom->ntypes,nlo,nhi);
     double diam = atof(arg[2]);
-    if (diam <= 0.0) error->all("Illegal dump_modify command");
+    if (diam <= 0.0) error->all(FLERR,"Illegal dump_modify command");
     for (int i = nlo; i <= nhi; i++) diamtype[i] = diam;
     return 3;
 
   } else if (strcmp(arg[0],"amap") == 0) {
-    if (narg < 6) error->all("Illegal dump_modify command");
+    if (narg < 6) error->all(FLERR,"Illegal dump_modify command");
     if (!islower(arg[1][0])) {
       mlo = NUMERIC;
       mlovalue = atof(arg[1]);
     } else if (strcmp(arg[1],"min") == 0) mlo = MINVALUE;
-    else error->all("Illegal dump_modify command");
+    else error->all(FLERR,"Illegal dump_modify command");
     if (!islower(arg[2][0])) {
       mhi = NUMERIC;
       mhivalue = atof(arg[2]);
     } else if (strcmp(arg[2],"max") == 0) mhi = MAXVALUE;
-    else error->all("Illegal dump_modify command");
+    else error->all(FLERR,"Illegal dump_modify command");
     if (mlo == NUMERIC && mhi == NUMERIC && mlovalue >= mhivalue)
-      error->all("Illega dump_modify command");
+      error->all(FLERR,"Illega dump_modify command");
 
-    if (strlen(arg[3]) != 2) error->all("Illegal dump_modify command");
+    if (strlen(arg[3]) != 2) error->all(FLERR,"Illegal dump_modify command");
     if (arg[3][0] == 'c') mstyle = CONTINUOUS;
     else if (arg[3][0] == 'd') mstyle = DISCRETE;
     else if (arg[3][0] == 's') mstyle = SEQUENTIAL;
-    else error->all("Illegal dump_modify command");
+    else error->all(FLERR,"Illegal dump_modify command");
     if (arg[3][1] == 'a') mrange = ABSOLUTE;
     else if (arg[3][1] == 'f') mrange = FRACTIONAL;
-    else error->all("Illegal dump_modify command");
+    else error->all(FLERR,"Illegal dump_modify command");
     if (mstyle == SEQUENTIAL) {
       mbinsize = atof(arg[4]);
-      if (mbinsize <= 0.0) error->all("Illegal dump_modify command");
+      if (mbinsize <= 0.0) error->all(FLERR,"Illegal dump_modify command");
     }
     mbinsizeinv = 1.0/mbinsize;
 
@@ -1648,61 +1645,61 @@ int DumpImage::modify_param(int narg, char **arg)
     int n = 6;
     for (int i = 0; i < nentry; i++) {
       if (mstyle == CONTINUOUS) {
-	if (n+2 > narg) error->all("Illegal dump_modify command");
+	if (n+2 > narg) error->all(FLERR,"Illegal dump_modify command");
 	if (!islower(arg[n][0])) {
 	  mentry[i].single = NUMERIC;
 	  mentry[i].svalue = atof(arg[n]);
 	} else if (strcmp(arg[n],"min") == 0) mentry[i].single = MINVALUE;
 	else if (strcmp(arg[n],"max") == 0) mentry[i].single = MAXVALUE;
-	else error->all("Illegal dump_modify command");
+	else error->all(FLERR,"Illegal dump_modify command");
 	mentry[i].color = color2rgb(arg[n+1]);
 	n += 2;
       } else if (mstyle == DISCRETE) {
-	if (n+3 > narg) error->all("Illegal dump_modify command");
+	if (n+3 > narg) error->all(FLERR,"Illegal dump_modify command");
 	if (!islower(arg[n][0])) {
 	  mentry[i].lo = NUMERIC;
 	  mentry[i].lvalue = atof(arg[n]);
 	} else if (strcmp(arg[n],"min") == 0) mentry[i].single = MINVALUE;
 	else if (strcmp(arg[n],"max") == 0) mentry[i].single = MAXVALUE;
-	else error->all("Illegal dump_modify command");
+	else error->all(FLERR,"Illegal dump_modify command");
 	if (!islower(arg[n+1][0])) {
 	  mentry[i].hi = NUMERIC;
 	  mentry[i].hvalue = atof(arg[n+1]);
 	} else if (strcmp(arg[n+1],"min") == 0) mentry[i].single = MINVALUE;
 	else if (strcmp(arg[n+1],"max") == 0) mentry[i].single = MAXVALUE;
-	else error->all("Illegal dump_modify command");
+	else error->all(FLERR,"Illegal dump_modify command");
 	mentry[i].color = color2rgb(arg[n+2]);
 	n += 3;
       } else if (mstyle == SEQUENTIAL) {
-	if (n+1 > narg) error->all("Illegal dump_modify command");
+	if (n+1 > narg) error->all(FLERR,"Illegal dump_modify command");
 	mentry[i].color = color2rgb(arg[n]);
 	n += 1;
       }
       if (mentry[i].color == NULL)
-	error->all("Invalid color in dump_modify command");
+	error->all(FLERR,"Invalid color in dump_modify command");
     }
     
     if (mstyle == CONTINUOUS) {
-      if (nentry < 2) error->all("Invalid color map in dump_modify command");
+      if (nentry < 2) error->all(FLERR,"Invalid color map in dump_modify command");
       if (mentry[0].single != MINVALUE || mentry[nentry-1].single != MAXVALUE)
-	error->all("Invalid color map in dump_modify command");
+	error->all(FLERR,"Invalid color map in dump_modify command");
       for (int i = 2; i < nentry-1; i++)
 	if (mentry[i].svalue <= mentry[i-1].svalue)
-	  error->all("Invalid color map in dump_modify command");
+	  error->all(FLERR,"Invalid color map in dump_modify command");
     } else if (mstyle == DISCRETE) {
-      if (nentry < 1) error->all("Invalid color map in dump_modify command");
+      if (nentry < 1) error->all(FLERR,"Invalid color map in dump_modify command");
       if (mentry[nentry-1].lo != MINVALUE || mentry[nentry-1].hi != MAXVALUE)
-	error->all("Invalid color map in dump_modify command");
+	error->all(FLERR,"Invalid color map in dump_modify command");
     } else if (mstyle == SEQUENTIAL) {
-      if (nentry < 1) error->all("Invalid color map in dump_modify command");
+      if (nentry < 1) error->all(FLERR,"Invalid color map in dump_modify command");
     }
 
     return n;
 
   } else if (strcmp(arg[0],"bcolor") == 0) {
-    if (narg < 3) error->all("Illegal dump_modify command");
+    if (narg < 3) error->all(FLERR,"Illegal dump_modify command");
     if (atom->nbondtypes == 0)
-      error->all("Dump modify bcolor not allowed with no bond types");
+      error->all(FLERR,"Dump modify bcolor not allowed with no bond types");
     int nlo,nhi;
     force->bounds(arg[1],atom->nbondtypes,nlo,nhi);
 
@@ -1727,7 +1724,7 @@ int DumpImage::modify_param(int narg, char **arg)
     for (int i = nlo; i <= nhi; i++) {
       bcolortype[i] = color2rgb(ptrs[m%ncount]);
       if (bcolortype[i] == NULL)
-	error->all("Invalid color in dump_modify command");
+	error->all(FLERR,"Invalid color in dump_modify command");
       m++;
     }
     
@@ -1735,33 +1732,33 @@ int DumpImage::modify_param(int narg, char **arg)
     return 3;
     
   } else if (strcmp(arg[0],"bdiam") == 0) {
-    if (narg < 3) error->all("Illegal dump_modify command");
+    if (narg < 3) error->all(FLERR,"Illegal dump_modify command");
     if (atom->nbondtypes == 0)
-      error->all("Dump modify bdiam not allowed with no bond types");
+      error->all(FLERR,"Dump modify bdiam not allowed with no bond types");
     int nlo,nhi;
     force->bounds(arg[1],atom->ntypes,nlo,nhi);
     double diam = atof(arg[2]);
-    if (diam <= 0.0) error->all("Illegal dump_modify command");
+    if (diam <= 0.0) error->all(FLERR,"Illegal dump_modify command");
     for (int i = nlo; i <= nhi; i++) bdiamtype[i] = diam;
     return 3;
 
   } else if (strcmp(arg[0],"backcolor") == 0) {
-    if (narg < 2) error->all("Illegal dump_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
     double *color = color2rgb(arg[1]);
-    if (color == NULL) error->all("Invalid color in dump_modify command");
+    if (color == NULL) error->all(FLERR,"Invalid color in dump_modify command");
     background[0] = static_cast<int> (color[0]*255.0);
     background[1] = static_cast<int> (color[1]*255.0);
     background[2] = static_cast<int> (color[2]*255.0);
     return 2;
 
   } else if (strcmp(arg[0],"boxcolor") == 0) {
-    if (narg < 2) error->all("Illegal dump_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
     boxcolor = color2rgb(arg[1]);
-    if (boxcolor == NULL) error->all("Invalid color in dump_modify command");
+    if (boxcolor == NULL) error->all(FLERR,"Invalid color in dump_modify command");
     return 2;
 
   } else if (strcmp(arg[0],"color") == 0) {
-    if (narg < 5) error->all("Illegal dump_modify command");
+    if (narg < 5) error->all(FLERR,"Illegal dump_modify command");
     username = (char **) 
       memory->srealloc(username,(ncolors+1)*sizeof(char *),"dump:username");
     memory->grow(userrgb,ncolors+1,3,"dump:userrgb");
@@ -1774,7 +1771,7 @@ int DumpImage::modify_param(int narg, char **arg)
     if (userrgb[ncolors][0] < 0.0 || userrgb[ncolors][0] > 1.0 || 
 	userrgb[ncolors][1] < 0.0 || userrgb[ncolors][1] > 1.0 || 
 	userrgb[ncolors][2] < 0.0 || userrgb[ncolors][2] > 1.0)
-      error->all("Illegal dump_modify command");
+      error->all(FLERR,"Illegal dump_modify command");
     ncolors++;
     return 5;
   }
diff --git a/src/dump_local.cpp b/src/dump_local.cpp
index aa1bad31c6a7b77b51d6ec0ba37df6e21763b936..c95f77e7c0f83eeb43c48f2c7c3d4b24957532b2 100644
--- a/src/dump_local.cpp
+++ b/src/dump_local.cpp
@@ -35,7 +35,7 @@ enum{INT,DOUBLE};
 DumpLocal::DumpLocal(LAMMPS *lmp, int narg, char **arg) : 
   Dump(lmp, narg, arg)
 {
-  if (narg == 5) error->all("No dump local arguments specified");
+  if (narg == 5) error->all(FLERR,"No dump local arguments specified");
 
   clearstep = 1;
 
@@ -123,7 +123,7 @@ DumpLocal::~DumpLocal()
 void DumpLocal::init_style()
 {
   if (sort_flag && sortcol == 0)
-    error->all("Dump local cannot sort by atom ID");
+    error->all(FLERR,"Dump local cannot sort by atom ID");
 
   delete [] format;
   char *str;
@@ -152,17 +152,17 @@ void DumpLocal::init_style()
   int icompute;
   for (int i = 0; i < ncompute; i++) {
     icompute = modify->find_compute(id_compute[i]);
-    if (icompute < 0) error->all("Could not find dump local compute ID");
+    if (icompute < 0) error->all(FLERR,"Could not find dump local compute ID");
     compute[i] = modify->compute[icompute];
   }
 
   int ifix;
   for (int i = 0; i < nfix; i++) {
     ifix = modify->find_fix(id_fix[i]);
-    if (ifix < 0) error->all("Could not find dump local fix ID");
+    if (ifix < 0) error->all(FLERR,"Could not find dump local fix ID");
     fix[i] = modify->fix[ifix];
     if (nevery % modify->fix[ifix]->local_freq)
-      error->all("Dump local and fix not computed at compatible times");
+      error->all(FLERR,"Dump local and fix not computed at compatible times");
   }
 
   // open single file, one time only
@@ -175,7 +175,7 @@ void DumpLocal::init_style()
 int DumpLocal::modify_param(int narg, char **arg)
 {
   if (strcmp(arg[0],"label") == 0) {
-    if (narg < 2) error->all("Illegal dump_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
     delete [] label;
     int n = strlen(arg[1]) + 1;
     label = new char[n];
@@ -223,13 +223,13 @@ int DumpLocal::count()
   for (int i = 0; i < ncompute; i++) {
     if (nmine < 0) nmine = compute[i]->size_local_rows;
     else if (nmine != compute[i]->size_local_rows)
-      error->one("Dump local count is not consistent across input fields");
+      error->one(FLERR,"Dump local count is not consistent across input fields");
   }
 
   for (int i = 0; i < nfix; i++) {
     if (nmine < 0) nmine = fix[i]->size_local_rows;
     else if (nmine != fix[i]->size_local_rows)
-      error->one("Dump local count is not consistent across input fields");
+      error->one(FLERR,"Dump local count is not consistent across input fields");
   }
 
   return nmine;
@@ -290,22 +290,22 @@ void DumpLocal::parse_fields(int narg, char **arg)
       char *ptr = strchr(suffix,'[');
       if (ptr) {
 	if (suffix[strlen(suffix)-1] != ']')
-	  error->all("Invalid attribute in dump local command");
+	  error->all(FLERR,"Invalid attribute in dump local command");
 	argindex[i] = atoi(ptr+1);
 	*ptr = '\0';
       } else argindex[i] = 0;
 
       n = modify->find_compute(suffix);
-      if (n < 0) error->all("Could not find dump local compute ID");
+      if (n < 0) error->all(FLERR,"Could not find dump local compute ID");
       if (modify->compute[n]->local_flag == 0)
-	error->all("Dump local compute does not compute local info");
+	error->all(FLERR,"Dump local compute does not compute local info");
       if (argindex[i] == 0 && modify->compute[n]->size_local_cols > 0)
-	error->all("Dump local compute does not calculate local vector");
+	error->all(FLERR,"Dump local compute does not calculate local vector");
       if (argindex[i] > 0 && modify->compute[n]->size_local_cols == 0)
-	error->all("Dump local compute does not calculate local array");
+	error->all(FLERR,"Dump local compute does not calculate local array");
       if (argindex[i] > 0 && 
 	  argindex[i] > modify->compute[n]->size_local_cols)
-	error->all("Dump local compute vector is accessed out-of-range");
+	error->all(FLERR,"Dump local compute vector is accessed out-of-range");
 
       field2index[i] = add_compute(suffix);
       delete [] suffix;
@@ -325,31 +325,31 @@ void DumpLocal::parse_fields(int narg, char **arg)
       char *ptr = strchr(suffix,'[');
       if (ptr) {
 	if (suffix[strlen(suffix)-1] != ']')
-	  error->all("Invalid attribute in dump local command");
+	  error->all(FLERR,"Invalid attribute in dump local command");
 	argindex[i] = atoi(ptr+1);
 	*ptr = '\0';
       } else argindex[i] = 0;
 
       n = modify->find_fix(suffix);
-      if (n < 0) error->all("Could not find dump local fix ID");
+      if (n < 0) error->all(FLERR,"Could not find dump local fix ID");
       if (modify->fix[n]->local_flag == 0)
-	error->all("Dump local fix does not compute local info");
+	error->all(FLERR,"Dump local fix does not compute local info");
       if (argindex[i] == 0 && modify->fix[n]->size_local_cols > 0)
-	error->all("Dump local fix does not compute local vector");
+	error->all(FLERR,"Dump local fix does not compute local vector");
       if (argindex[i] > 0 && modify->fix[n]->size_local_cols == 0)
-	error->all("Dump local fix does not compute local array");
+	error->all(FLERR,"Dump local fix does not compute local array");
       if (argindex[i] > 0 && 
 	  argindex[i] > modify->fix[n]->size_local_cols)
-	error->all("Dump local fix vector is accessed out-of-range");
+	error->all(FLERR,"Dump local fix vector is accessed out-of-range");
 
       field2index[i] = add_fix(suffix);
       delete [] suffix;
 
-    } else error->all("Invalid attribute in dump local command");
+    } else error->all(FLERR,"Invalid attribute in dump local command");
   }
 
   if (computefixflag == 0)
-    error->all("Dump local attributes contain no compute or fix");
+    error->all(FLERR,"Dump local attributes contain no compute or fix");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/dump_xyz.cpp b/src/dump_xyz.cpp
index d9814cdf7a104a8bd6bda3ff3ff2e7571ce07eda..817e376fbf7d440b9afc08a03c21e256688a91c0 100644
--- a/src/dump_xyz.cpp
+++ b/src/dump_xyz.cpp
@@ -24,8 +24,8 @@ using namespace LAMMPS_NS;
 
 DumpXYZ::DumpXYZ(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg)
 {
-  if (narg != 5) error->all("Illegal dump xyz command");
-  if (binary || multiproc) error->all("Invalid dump xyz filename");
+  if (narg != 5) error->all(FLERR,"Illegal dump xyz command");
+  if (binary || multiproc) error->all(FLERR,"Invalid dump xyz filename");
 
   size_one = 5;
   sort_flag = 1;
diff --git a/src/error.cpp b/src/error.cpp
index 81f40a5498fef9a7372b9d5ea4bbdbfec98c61b6..283d872baf075f42d2b89174afacea763395131d 100644
--- a/src/error.cpp
+++ b/src/error.cpp
@@ -29,13 +29,15 @@ Error::Error(LAMMPS *lmp) : Pointers(lmp) {}
    close all output, screen, and log files in world and universe
 ------------------------------------------------------------------------- */
 
-void Error::universe_all(const char *str)
+void Error::universe_all(const char *file, int line, const char *str)
 {
   MPI_Barrier(universe->uworld);
 
   if (universe->me == 0) {
-    if (universe->uscreen) fprintf(universe->uscreen,"ERROR: %s\n",str);
-    if (universe->ulogfile) fprintf(universe->ulogfile,"ERROR: %s\n",str);
+    if (universe->uscreen) fprintf(universe->uscreen,
+				   "ERROR: %s (%s:%d)\n",str,file,line);
+    if (universe->ulogfile) fprintf(universe->ulogfile,
+				    "ERROR: %s (%s:%d)\n",str,file,line);
   }
 
   if (output) delete output;
@@ -53,10 +55,11 @@ void Error::universe_all(const char *str)
    called by one proc in universe
 ------------------------------------------------------------------------- */
 
-void Error::universe_one(const char *str)
+void Error::universe_one(const char *file, int line, const char *str)
 {
   if (universe->uscreen)
-    fprintf(universe->uscreen,"ERROR on proc %d: %s\n",universe->me,str);
+    fprintf(universe->uscreen,"ERROR on proc %d: %s (%s:%d)\n",
+	    universe->me,str,file,line);
   MPI_Abort(universe->uworld,1);
 }
 
@@ -65,7 +68,7 @@ void Error::universe_one(const char *str)
    close all output, screen, and log files in world
 ------------------------------------------------------------------------- */
 
-void Error::all(const char *str)
+void Error::all(const char *file, int line, const char *str)
 {
   MPI_Barrier(world);
 
@@ -73,8 +76,8 @@ void Error::all(const char *str)
   MPI_Comm_rank(world,&me);
 
   if (me == 0) {
-    if (screen) fprintf(screen,"ERROR: %s\n",str);
-    if (logfile) fprintf(logfile,"ERROR: %s\n",str);
+    if (screen) fprintf(screen,"ERROR: %s (%s:%d)\n",str,file,line);
+    if (logfile) fprintf(logfile,"ERROR: %s (%s:%d)\n",str,file,line);
   }
 
   if (output) delete output;
@@ -91,13 +94,14 @@ void Error::all(const char *str)
    always write to universe screen 
 ------------------------------------------------------------------------- */
 
-void Error::one(const char *str)
+void Error::one(const char *file, int line, const char *str)
 {
   int me;
   MPI_Comm_rank(world,&me);
-  if (screen) fprintf(screen,"ERROR on proc %d: %s\n",me,str);
+  if (screen) fprintf(screen,"ERROR on proc %d: %s (%s:%d)\n",me,str,file,line);
   if (universe->nworlds > 1)
-    fprintf(universe->uscreen,"ERROR on proc %d: %s\n",universe->me,str);
+    fprintf(universe->uscreen,"ERROR on proc %d: %s (%s:%d)\n",
+	    universe->me,str,file,line);
   MPI_Abort(world,1);
 }
 
@@ -106,10 +110,11 @@ void Error::one(const char *str)
    only write to screen if non-NULL on this proc since could be file 
 ------------------------------------------------------------------------- */
 
-void Error::warning(const char *str, int logflag)
+void Error::warning(const char *file, int line, const char *str, int logflag)
 {
-  if (screen) fprintf(screen,"WARNING: %s\n",str);
-  if (logflag && logfile) fprintf(logfile,"WARNING: %s\n",str);
+  if (screen) fprintf(screen,"WARNING: %s (%s:%d)\n",str,file,line);
+  if (logflag && logfile) fprintf(logfile,"WARNING: %s (%s:%d)\n",
+				  str,file,line);
 }
 
 /* ----------------------------------------------------------------------
@@ -117,10 +122,10 @@ void Error::warning(const char *str, int logflag)
    write message to screen and logfile (if logflag is set)
 ------------------------------------------------------------------------- */
 
-void Error::message(char *str, int logflag)
+void Error::message(const char *file, int line, char *str, int logflag)
 {
-  if (screen) fprintf(screen,"%s\n",str);
-  if (logflag && logfile) fprintf(logfile,"%s\n",str);
+  if (screen) fprintf(screen,"%s (%s:%d)\n",str,file,line);
+  if (logflag && logfile) fprintf(logfile,"%s (%s:%d)\n",str,file,line);
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/error.h b/src/error.h
index 8c55a046c9b8cd1c481c44b61649495814bf0f57..395581dee315c2f8b20d0a429f9f9a886e4b775b 100644
--- a/src/error.h
+++ b/src/error.h
@@ -22,13 +22,13 @@ class Error : protected Pointers {
  public:
   Error(class LAMMPS *);
 
-  void universe_all(const char *);
-  void universe_one(const char *);
+  void universe_all(const char *, int, const char *);
+  void universe_one(const char *, int, const char *);
 
-  void all(const char *);
-  void one(const char *);
-  void warning(const char *, int = 1);
-  void message(char *, int = 1);
+  void all(const char *, int, const char *);
+  void one(const char *, int, const char *);
+  void warning(const char *, int, const char *, int = 1);
+  void message(const char *, int, char *, int = 1);
   void done();
 };
 
diff --git a/src/finish.cpp b/src/finish.cpp
index 52fc2f312c8605ba91c8478c086d1eec1f86ff73..fb43f1c7ba45c67f81b00db77b86221799face8b 100644
--- a/src/finish.cpp
+++ b/src/finish.cpp
@@ -31,9 +31,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 Finish::Finish(LAMMPS *lmp) : Pointers(lmp) {}
diff --git a/src/fix.cpp b/src/fix.cpp
index 2ed2dc748537e72f1008d0ebe8fea952624dfdf2..dc4263b7d178bf6845b204db7ff22db086c2b4b0 100644
--- a/src/fix.cpp
+++ b/src/fix.cpp
@@ -34,10 +34,10 @@ Fix::Fix(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
 
   for (int i = 0; i < n-1; i++)
     if (!isalnum(id[i]) && id[i] != '_')
-      error->all("Fix ID must be alphanumeric or underscore characters");
+      error->all(FLERR,"Fix ID must be alphanumeric or underscore characters");
 
   igroup = group->find(arg[1]);
-  if (igroup == -1) error->all("Could not find fix group ID");
+  if (igroup == -1) error->all(FLERR,"Could not find fix group ID");
   groupbit = group->bitmask[igroup];
 
   n = strlen(arg[2]) + 1;
@@ -107,19 +107,19 @@ Fix::~Fix()
 
 void Fix::modify_params(int narg, char **arg)
 {
-  if (narg == 0) error->all("Illegal fix_modify command");
+  if (narg == 0) error->all(FLERR,"Illegal fix_modify command");
 
   int iarg = 0;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"energy") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix_modify command");
       if (strcmp(arg[iarg+1],"no") == 0) thermo_energy = 0;
       else if (strcmp(arg[iarg+1],"yes") == 0) thermo_energy = 1;
-      else error->all("Illegal fix_modify command");
+      else error->all(FLERR,"Illegal fix_modify command");
       iarg += 2;
     } else {
       int n = modify_param(narg-iarg,&arg[iarg]);
-      if (n == 0) error->all("Illegal fix_modify command");
+      if (n == 0) error->all(FLERR,"Illegal fix_modify command");
       iarg += n;
     }
   }
diff --git a/src/fix_adapt.cpp b/src/fix_adapt.cpp
index d5825b5616bd1949669cc10bbb29112e0eae7830..fd1a256b8af75271ea0f1158dc94332f3445c7d9 100644
--- a/src/fix_adapt.cpp
+++ b/src/fix_adapt.cpp
@@ -32,16 +32,13 @@ using namespace LAMMPS_NS;
 enum{PAIR,KSPACE,ATOM};
 enum{DIAMETER};
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 FixAdapt::FixAdapt(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
 {
-  if (narg < 5) error->all("Illegal fix adapt command");
+  if (narg < 5) error->all(FLERR,"Illegal fix adapt command");
   nevery = atoi(arg[3]);
-  if (nevery < 0) error->all("Illegal fix adapt command");
+  if (nevery < 0) error->all(FLERR,"Illegal fix adapt command");
 
   // count # of adaptations
 
@@ -50,21 +47,21 @@ FixAdapt::FixAdapt(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
   int iarg = 4;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"pair") == 0) {
-      if (iarg+6 > narg) error->all("Illegal fix adapt command");
+      if (iarg+6 > narg) error->all(FLERR,"Illegal fix adapt command");
       nadapt++;
       iarg += 6;
     } else if (strcmp(arg[iarg],"kspace") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix adapt command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix adapt command");
       nadapt++;
       iarg += 2;
     } else if (strcmp(arg[iarg],"atom") == 0) {
-      if (iarg+3 > narg) error->all("Illegal fix adapt command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal fix adapt command");
       nadapt++;
       iarg += 3;
     } else break;
   }
 
-  if (nadapt == 0) error->all("Illegal fix adapt command");
+  if (nadapt == 0) error->all(FLERR,"Illegal fix adapt command");
   adapt = new Adapt[nadapt];
 
   // parse keywords
@@ -75,7 +72,7 @@ FixAdapt::FixAdapt(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
   iarg = 4;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"pair") == 0) {
-      if (iarg+6 > narg) error->all("Illegal fix adapt command");
+      if (iarg+6 > narg) error->all(FLERR,"Illegal fix adapt command");
       adapt[nadapt].which = PAIR;
       int n = strlen(arg[iarg+1]) + 1;
       adapt[nadapt].pstyle = new char[n];
@@ -91,31 +88,31 @@ FixAdapt::FixAdapt(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
 	n = strlen(&arg[iarg+5][2]) + 1;
 	adapt[nadapt].var = new char[n];
 	strcpy(adapt[nadapt].var,&arg[iarg+5][2]);
-      } else error->all("Illegal fix adapt command");
+      } else error->all(FLERR,"Illegal fix adapt command");
       nadapt++;
       iarg += 6;
     } else if (strcmp(arg[iarg],"kspace") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix adapt command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix adapt command");
       adapt[nadapt].which = KSPACE;
       if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
 	int n = strlen(&arg[iarg+1][2]) + 1;
 	adapt[nadapt].var = new char[n];
 	strcpy(adapt[nadapt].var,&arg[iarg+1][2]);
-      } else error->all("Illegal fix adapt command");
+      } else error->all(FLERR,"Illegal fix adapt command");
       nadapt++;
       iarg += 2;
     } else if (strcmp(arg[iarg],"atom") == 0) {
-      if (iarg+3 > narg) error->all("Illegal fix adapt command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal fix adapt command");
       adapt[nadapt].which = ATOM;
       if (strcmp(arg[iarg+1],"diameter") == 0) {
 	adapt[nadapt].aparam = DIAMETER;
 	diamflag = 1;
-      } else error->all("Illegal fix adapt command");
+      } else error->all(FLERR,"Illegal fix adapt command");
       if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
 	int n = strlen(&arg[iarg+2][2]) + 1;
 	adapt[nadapt].var = new char[n];
 	strcpy(adapt[nadapt].var,&arg[iarg+2][2]);
-      } else error->all("Illegal fix adapt command");
+      } else error->all(FLERR,"Illegal fix adapt command");
       nadapt++;
       iarg += 3;
     } else break;
@@ -128,18 +125,18 @@ FixAdapt::FixAdapt(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
 
   while (iarg < narg) {
     if (strcmp(arg[iarg],"reset") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix adapt command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix adapt command");
       if (strcmp(arg[iarg+1],"no") == 0) resetflag = 0;
       else if (strcmp(arg[iarg+1],"yes") == 0) resetflag = 1;
-      else error->all("Illegal fix adapt command");
+      else error->all(FLERR,"Illegal fix adapt command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"scale") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix adapt command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix adapt command");
       if (strcmp(arg[iarg+1],"no") == 0) scaleflag = 0;
       else if (strcmp(arg[iarg+1],"yes") == 0) scaleflag = 1;
-      else error->all("Illegal fix adapt command");
+      else error->all(FLERR,"Illegal fix adapt command");
       iarg += 2;
-    } else error->all("Illegal fix adapt command");
+    } else error->all(FLERR,"Illegal fix adapt command");
   }
 
   // allocate pair style arrays
@@ -190,17 +187,17 @@ void FixAdapt::init()
 
     ad->ivar = input->variable->find(ad->var);
     if (ad->ivar < 0)
-      error->all("Variable name for fix adapt does not exist");
+      error->all(FLERR,"Variable name for fix adapt does not exist");
     if (!input->variable->equalstyle(ad->ivar))
-      error->all("Variable for fix adapt is invalid style");
+      error->all(FLERR,"Variable for fix adapt is invalid style");
 
     if (ad->which == PAIR) {
       anypair = 1;
 
       Pair *pair = force->pair_match(ad->pstyle,1);
-      if (pair == NULL) error->all("Fix adapt pair style does not exist");
+      if (pair == NULL) error->all(FLERR,"Fix adapt pair style does not exist");
       void *ptr = pair->extract(ad->pparam,ad->pdim);
-      if (ptr == NULL) error->all("Fix adapt pair style param not supported");
+      if (ptr == NULL) error->all(FLERR,"Fix adapt pair style param not supported");
 
       ad->pdim = 2;
       if (ad->pdim == 0) ad->scalar = (double *) ptr;
@@ -214,19 +211,19 @@ void FixAdapt::init()
 	for (i = ad->ilo; i <= ad->ihi; i++)
 	  for (j = MAX(ad->jlo,i); j <= ad->jhi; j++)
 	    if (!pair->check_ijtype(i,j,ad->pstyle))
-	      error->all("Fix adapt type pair range is not valid for "
+	      error->all(FLERR,"Fix adapt type pair range is not valid for "
 			 "pair hybrid sub-style");
       }
 
     } else if (ad->which == KSPACE) {
       if (force->kspace == NULL) 
-	error->all("Fix adapt kspace style does not exist");
+	error->all(FLERR,"Fix adapt kspace style does not exist");
       kspace_scale = (double *) force->kspace->extract("scale");
 
     } else if (ad->which == ATOM) {
       if (ad->aparam == DIAMETER) {
 	if (!atom->radius_flag)
-	  error->all("Fix adapt requires atom attribute diameter");
+	  error->all(FLERR,"Fix adapt requires atom attribute diameter");
       }
     }
   }
diff --git a/src/fix_addforce.cpp b/src/fix_addforce.cpp
index fa5c3be606ea5706aa8e66e37845f0dc6709f37b..16a3c1feab6ef1e73503eb9074807fc20746aad2 100644
--- a/src/fix_addforce.cpp
+++ b/src/fix_addforce.cpp
@@ -34,7 +34,7 @@ enum{NONE,CONSTANT,EQUAL,ATOM};
 FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 6) error->all("Illegal fix addforce command");
+  if (narg < 6) error->all(FLERR,"Illegal fix addforce command");
 
   scalar_flag = 1;
   vector_flag = 1;
@@ -79,23 +79,23 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) :
   int iarg = 6;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"region") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix addforce command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix addforce command");
       iregion = domain->find_region(arg[iarg+1]);
       if (iregion == -1)
-	error->all("Region ID for fix addforce does not exist");
+	error->all(FLERR,"Region ID for fix addforce does not exist");
       int n = strlen(arg[iarg+1]) + 1;
       idregion = new char[n];
       strcpy(idregion,arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"energy") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix addforce command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix addforce command");
       if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
 	int n = strlen(&arg[iarg+1][2]) + 1;
 	estr = new char[n];
 	strcpy(estr,&arg[iarg+1][2]);
-      } else error->all("Illegal fix addforce command");
+      } else error->all(FLERR,"Illegal fix addforce command");
       iarg += 2;
-    } else error->all("Illegal fix addforce command");
+    } else error->all(FLERR,"Illegal fix addforce command");
   }
 
   force_flag = 0;
@@ -137,37 +137,37 @@ void FixAddForce::init()
 
   if (xstr) {
     xvar = input->variable->find(xstr);
-    if (xvar < 0) error->all("Variable name for fix addforce does not exist");
+    if (xvar < 0) error->all(FLERR,"Variable name for fix addforce does not exist");
     if (input->variable->equalstyle(xvar)) xstyle = EQUAL;
     else if (input->variable->atomstyle(xvar)) xstyle = ATOM;
-    else error->all("Variable for fix addforce is invalid style");
+    else error->all(FLERR,"Variable for fix addforce is invalid style");
   }
   if (ystr) {
     yvar = input->variable->find(ystr);
-    if (yvar < 0) error->all("Variable name for fix addforce does not exist");
+    if (yvar < 0) error->all(FLERR,"Variable name for fix addforce does not exist");
     if (input->variable->equalstyle(yvar)) ystyle = EQUAL;
     else if (input->variable->atomstyle(yvar)) ystyle = ATOM;
-    else error->all("Variable for fix addforce is invalid style");
+    else error->all(FLERR,"Variable for fix addforce is invalid style");
   }
   if (zstr) {
     zvar = input->variable->find(zstr);
-    if (zvar < 0) error->all("Variable name for fix addforce does not exist");
+    if (zvar < 0) error->all(FLERR,"Variable name for fix addforce does not exist");
     if (input->variable->equalstyle(zvar)) zstyle = EQUAL;
     else if (input->variable->atomstyle(zvar)) zstyle = ATOM;
-    else error->all("Variable for fix addforce is invalid style");
+    else error->all(FLERR,"Variable for fix addforce is invalid style");
   }
   if (estr) {
     evar = input->variable->find(estr);
-    if (evar < 0) error->all("Variable name for fix addforce does not exist");
+    if (evar < 0) error->all(FLERR,"Variable name for fix addforce does not exist");
     if (input->variable->atomstyle(evar)) estyle = ATOM;
-    else error->all("Variable for fix addforce is invalid style");
+    else error->all(FLERR,"Variable for fix addforce is invalid style");
   } else estyle = NONE;
 
   // set index and check validity of region
 
   if (iregion >= 0) {
     iregion = domain->find_region(idregion);
-    if (iregion == -1) error->all("Region ID for fix addforce does not exist");
+    if (iregion == -1) error->all(FLERR,"Region ID for fix addforce does not exist");
   }
 
   if (xstyle == ATOM || ystyle == ATOM || zstyle == ATOM) 
@@ -177,11 +177,11 @@ void FixAddForce::init()
   else varflag = CONSTANT;
 
   if (varflag == CONSTANT && estyle != NONE)
-    error->all("Cannot use variable energy with "
+    error->all(FLERR,"Cannot use variable energy with "
 	       "constant force in fix addforce");
   if ((varflag == EQUAL || varflag == ATOM) && 
       update->whichflag == 2 && estyle == NONE)
-    error->all("Must use variable energy with fix addforce");
+    error->all(FLERR,"Must use variable energy with fix addforce");
 
   if (strstr(update->integrate_style,"respa"))
     nlevels_respa = ((Respa *) update->integrate)->nlevels;
diff --git a/src/fix_ave_atom.cpp b/src/fix_ave_atom.cpp
index b604977f7eba46ca0ec1f6d53f356656507310c4..01f21f95082185443972252171dd1b12646de70f 100644
--- a/src/fix_ave_atom.cpp
+++ b/src/fix_ave_atom.cpp
@@ -36,7 +36,7 @@ enum{X,V,F,COMPUTE,FIX,VARIABLE};
 FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 7) error->all("Illegal fix ave/atom command");
+  if (narg < 7) error->all(FLERR,"Illegal fix ave/atom command");
 
   time_depend = 1;
 
@@ -100,7 +100,7 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) :
       char *ptr = strchr(suffix,'[');
       if (ptr) {
 	if (suffix[strlen(suffix)-1] != ']')
-	  error->all("Illegal fix ave/atom command");
+	  error->all(FLERR,"Illegal fix ave/atom command");
 	argindex[nvalues] = atoi(ptr+1);
 	*ptr = '\0';
       } else argindex[nvalues] = 0;
@@ -111,7 +111,7 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) :
       nvalues++;
       delete [] suffix;
 
-    } else error->all("Illegal fix ave/atom command");
+    } else error->all(FLERR,"Illegal fix ave/atom command");
 
     iarg++;
   }
@@ -120,49 +120,49 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) :
   // for fix inputs, check that fix frequency is acceptable
 
   if (nevery <= 0 || nrepeat <= 0 || peratom_freq <= 0)
-    error->all("Illegal fix ave/atom command");
+    error->all(FLERR,"Illegal fix ave/atom command");
   if (peratom_freq % nevery || (nrepeat-1)*nevery >= peratom_freq)
-    error->all("Illegal fix ave/atom command");
+    error->all(FLERR,"Illegal fix ave/atom command");
 
   for (int i = 0; i < nvalues; i++) {
     if (which[i] == COMPUTE) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all("Compute ID for fix ave/atom does not exist");
+	error->all(FLERR,"Compute ID for fix ave/atom does not exist");
       if (modify->compute[icompute]->peratom_flag == 0)
-	error->all("Fix ave/atom compute does not calculate per-atom values");
+	error->all(FLERR,"Fix ave/atom compute does not calculate per-atom values");
       if (argindex[i] == 0 && 
 	  modify->compute[icompute]->size_peratom_cols != 0)
-	error->all("Fix ave/atom compute does not "
+	error->all(FLERR,"Fix ave/atom compute does not "
 		   "calculate a per-atom vector");
       if (argindex[i] && modify->compute[icompute]->size_peratom_cols == 0)
-	error->all("Fix ave/atom compute does not "
+	error->all(FLERR,"Fix ave/atom compute does not "
 		   "calculate a per-atom array");
       if (argindex[i] && 
 	  argindex[i] > modify->compute[icompute]->size_peratom_cols)
-	error->all("Fix ave/atom compute array is accessed out-of-range");
+	error->all(FLERR,"Fix ave/atom compute array is accessed out-of-range");
 
     } else if (which[i] == FIX) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0)
-	error->all("Fix ID for fix ave/atom does not exist");
+	error->all(FLERR,"Fix ID for fix ave/atom does not exist");
       if (modify->fix[ifix]->peratom_flag == 0)
-	error->all("Fix ave/atom fix does not calculate per-atom values");
+	error->all(FLERR,"Fix ave/atom fix does not calculate per-atom values");
       if (argindex[i] == 0 && modify->fix[ifix]->size_peratom_cols != 0)
-	error->all("Fix ave/atom fix does not calculate a per-atom vector");
+	error->all(FLERR,"Fix ave/atom fix does not calculate a per-atom vector");
       if (argindex[i] && modify->fix[ifix]->size_peratom_cols == 0)
-	error->all("Fix ave/atom fix does not calculate a per-atom array");
+	error->all(FLERR,"Fix ave/atom fix does not calculate a per-atom array");
       if (argindex[i] && argindex[i] > modify->fix[ifix]->size_peratom_cols)
-	error->all("Fix ave/atom fix array is accessed out-of-range");
+	error->all(FLERR,"Fix ave/atom fix array is accessed out-of-range");
       if (nevery % modify->fix[ifix]->peratom_freq)
-	error->all("Fix for fix ave/atom not computed at compatible time");
+	error->all(FLERR,"Fix for fix ave/atom not computed at compatible time");
 
     } else if (which[i] == VARIABLE) {
       int ivariable = input->variable->find(ids[i]);
       if (ivariable < 0)
-	error->all("Variable name for fix ave/atom does not exist");
+	error->all(FLERR,"Variable name for fix ave/atom does not exist");
       if (input->variable->atomstyle(ivariable) == 0)
-	error->all("Fix ave/atom variable is not atom-style variable");
+	error->all(FLERR,"Fix ave/atom variable is not atom-style variable");
     }
   }
 
@@ -233,19 +233,19 @@ void FixAveAtom::init()
     if (which[m] == COMPUTE) {
       int icompute = modify->find_compute(ids[m]);
       if (icompute < 0)
-	error->all("Compute ID for fix ave/atom does not exist");
+	error->all(FLERR,"Compute ID for fix ave/atom does not exist");
       value2index[m] = icompute;
       
     } else if (which[m] == FIX) {
       int ifix = modify->find_fix(ids[m]);
       if (ifix < 0) 
-	error->all("Fix ID for fix ave/atom does not exist");
+	error->all(FLERR,"Fix ID for fix ave/atom does not exist");
       value2index[m] = ifix;
 
     } else if (which[m] == VARIABLE) {
       int ivariable = input->variable->find(ids[m]);
       if (ivariable < 0) 
-	error->all("Variable name for fix ave/atom does not exist");
+	error->all(FLERR,"Variable name for fix ave/atom does not exist");
       value2index[m] = ivariable;
 
     } else value2index[m] = -1;
diff --git a/src/fix_ave_correlate.cpp b/src/fix_ave_correlate.cpp
index 9abf3e46d268c1f978f5df6581fe7869cb163a01..b84fc06b4dcf3b2e0d3470bd738e1a7a57e9675a 100644
--- a/src/fix_ave_correlate.cpp
+++ b/src/fix_ave_correlate.cpp
@@ -44,7 +44,7 @@ enum{AUTO,UPPER,LOWER,AUTOUPPER,AUTOLOWER,FULL};
 FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg):
   Fix (lmp, narg, arg)
 {
-  if (narg < 7) error->all ("Illegal fix ave/correlate command");
+  if (narg < 7) error->all(FLERR,"Illegal fix ave/correlate command");
 
   MPI_Comm_rank(world,&me);
 
@@ -79,7 +79,7 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg):
       char *ptr = strchr(suffix,'[');
       if (ptr) {
 	if (suffix[strlen(suffix)-1] != ']')
-	  error->all("Illegal fix ave/correlate command");
+	  error->all(FLERR,"Illegal fix ave/correlate command");
 	argindex[nvalues] = atoi(ptr+1);
 	*ptr = '\0';
       } else argindex[nvalues] = 0;
@@ -107,107 +107,111 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg):
 
   while (iarg < narg) {
     if (strcmp(arg[iarg],"type") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/correlate command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate command");
       if (strcmp(arg[iarg+1],"auto") == 0) type = AUTO;
       else if (strcmp(arg[iarg+1],"upper") == 0) type = UPPER;
       else if (strcmp(arg[iarg+1],"lower") == 0) type = LOWER;
       else if (strcmp(arg[iarg+1],"auto/upper") == 0) type = AUTOUPPER;
       else if (strcmp(arg[iarg+1],"auto/lower") == 0) type = AUTOLOWER;
       else if (strcmp(arg[iarg+1],"full") == 0) type = FULL;
-      else error->all("Illegal fix ave/correlate command");
+      else error->all(FLERR,"Illegal fix ave/correlate command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"ave") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/correlate command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate command");
       if (strcmp(arg[iarg+1],"one") == 0) ave = ONE;
       else if (strcmp(arg[iarg+1],"running") == 0) ave = RUNNING;
-      else error->all("Illegal fix ave/correlate command");
+      else error->all(FLERR,"Illegal fix ave/correlate command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"start") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/correlate command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate command");
       startstep = atoi(arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"prefactor") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/correlate command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate command");
       prefactor = atof(arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"file") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/correlate command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate command");
       if (me == 0) {
 	fp = fopen(arg[iarg+1],"w");
 	if (fp == NULL) {
 	  char str[128];
 	  sprintf(str,"Cannot open fix ave/correlate file %s",arg[iarg+1]);
-	  error->one(str);
+	  error->one(FLERR,str);
 	}
       }
       iarg += 2;
     } else if (strcmp(arg[iarg],"title1") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/correlate command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate command");
       delete [] title1;
       int n = strlen(arg[iarg+1]) + 1;
       title1 = new char[n];
       strcpy(title1,arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"title2") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/correlate command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate command");
       delete [] title2;
       int n = strlen(arg[iarg+1]) + 1;
       title2 = new char[n];
       strcpy(title2,arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"title3") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/correlate command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate command");
       delete [] title3;
       int n = strlen(arg[iarg+1]) + 1;
       title3 = new char[n];
       strcpy(title3,arg[iarg+1]);
       iarg += 2;
-    } else error->all("Illegal fix ave/correlate command");
+    } else error->all(FLERR,"Illegal fix ave/correlate command");
   }
 
   // setup and error check
   // for fix inputs, check that fix frequency is acceptable
 
   if (nevery <= 0 || nrepeat <= 0 || nfreq <= 0)
-    error->all("Illegal fix ave/correlate command");
+    error->all(FLERR,"Illegal fix ave/correlate command");
   if (nfreq % nevery)
-    error->all("Illegal fix ave/correlate command");
+    error->all(FLERR,"Illegal fix ave/correlate command");
   if (ave == ONE && nfreq < (nrepeat-1)*nevery)
-    error->all("Illegal fix ave/correlate command");
+    error->all(FLERR,"Illegal fix ave/correlate command");
 
   for (int i = 0; i < nvalues; i++) {
     if (which[i] == COMPUTE) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all ("Compute ID for fix ave/correlate does not exist");
+	error->all(FLERR,"Compute ID for fix ave/correlate does not exist");
       if (argindex[i] == 0 && modify->compute[icompute]->scalar_flag == 0)
-	error->all ("Fix ave/correlate compute does not calculate a scalar");
+	error->all(FLERR,
+		   "Fix ave/correlate compute does not calculate a scalar");
       if (argindex[i] && modify->compute[icompute]->vector_flag == 0)
-	error->all ("Fix ave/correlate compute does not calculate a vector");
+	error->all(FLERR,
+		   "Fix ave/correlate compute does not calculate a vector");
       if (argindex[i] && argindex[i] > modify->compute[icompute]->size_vector)
-	error->all ("Fix ave/correlate compute vector "
-		    "is accessed out-of-range");
+	error->all(FLERR,"Fix ave/correlate compute vector "
+		   "is accessed out-of-range");
 
     } else if (which[i] == FIX) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0)
-	error->all ("Fix ID for fix ave/correlate does not exist");
+	error->all(FLERR,"Fix ID for fix ave/correlate does not exist");
       if (argindex[i] == 0 && modify->fix[ifix]->scalar_flag == 0)
-	error->all ("Fix ave/correlate fix does not calculate a scalar");
+	error->all(FLERR,"Fix ave/correlate fix does not calculate a scalar");
       if (argindex[i] && modify->fix[ifix]->vector_flag == 0)
-	error->all ("Fix ave/correlate fix does not calculate a vector");
+	error->all(FLERR,"Fix ave/correlate fix does not calculate a vector");
       if (argindex[i] && argindex[i] > modify->fix[ifix]->size_vector)
-	error->all ("Fix ave/correlate fix vector is accessed out-of-range");
+	error->all(FLERR,
+		   "Fix ave/correlate fix vector is accessed out-of-range");
       if (nevery % modify->fix[ifix]->global_freq)
-	error->all("Fix for fix ave/correlate "
+	error->all(FLERR,"Fix for fix ave/correlate "
 		   "not computed at compatible time");
 
     } else if (which[i] == VARIABLE) {
       int ivariable = input->variable->find(ids[i]);
       if (ivariable < 0)
-	error->all ("Variable name for fix ave/correlate does not exist");
+	error->all(FLERR,"Variable name for fix ave/correlate does not exist");
       if (input->variable->equalstyle(ivariable) == 0)
-	error->all ("Fix ave/correlate variable is not equal-style variable");
+	error->all(FLERR,
+		   "Fix ave/correlate variable is not equal-style variable");
     }
   }
 
@@ -333,19 +337,19 @@ void FixAveCorrelate::init()
     if (which[i] == COMPUTE) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all("Compute ID for fix ave/correlate does not exist");
+	error->all(FLERR,"Compute ID for fix ave/correlate does not exist");
       value2index[i] = icompute;
 
     } else if (which[i] == FIX) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0) 
-	error->all("Fix ID for fix ave/correlate does not exist");
+	error->all(FLERR,"Fix ID for fix ave/correlate does not exist");
       value2index[i] = ifix;
 
     } else if (which[i] == VARIABLE) {
       int ivariable = input->variable->find(ids[i]);
       if (ivariable < 0) 
-	error->all("Variable name for fix ave/correlate does not exist");
+	error->all(FLERR,"Variable name for fix ave/correlate does not exist");
       value2index[i] = ivariable;
     }
   }
diff --git a/src/fix_ave_histo.cpp b/src/fix_ave_histo.cpp
index 6692681f19e719bfdab86480955e5ef8e1401a86..f7909ac25898346fffce0946ba7519fb3ecdee5a 100644
--- a/src/fix_ave_histo.cpp
+++ b/src/fix_ave_histo.cpp
@@ -40,15 +40,12 @@ enum{IGNORE,END,EXTRA};
 #define INVOKED_LOCAL 16
 
 #define BIG 1.0e20
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 10) error->all("Illegal fix ave/histo command");
+  if (narg < 10) error->all(FLERR,"Illegal fix ave/histo command");
 
   MPI_Comm_rank(world,&me);
 
@@ -179,7 +176,7 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) :
       char *ptr = strchr(suffix,'[');
       if (ptr) {
 	if (suffix[strlen(suffix)-1] != ']')
-	  error->all("Illegal fix ave/histo command");
+	  error->all(FLERR,"Illegal fix ave/histo command");
 	argindex[nvalues] = atoi(ptr+1);
 	*ptr = '\0';
       } else argindex[nvalues] = 0;
@@ -193,7 +190,7 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) :
 	  argindex[nvalues] == 0) {
 	int icompute = modify->find_compute(ids[nvalues]);
 	if (icompute < 0)
-	  error->all("Compute ID for fix ave/histo does not exist");
+	  error->all(FLERR,"Compute ID for fix ave/histo does not exist");
 	if (modify->compute[icompute]->array_flag) {
 	  int ncols = modify->compute[icompute]->size_array_cols;
 	  maxvalues += ncols-1;
@@ -213,7 +210,7 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) :
 		 argindex[nvalues] == 0) {
 	int ifix = modify->find_fix(ids[nvalues]);
 	if (ifix < 0)
-	  error->all("Fix ID for fix ave/histo does not exist");
+	  error->all(FLERR,"Fix ID for fix ave/histo does not exist");
 	if (modify->fix[ifix]->array_flag) {
 	  int ncols = modify->fix[ifix]->size_array_cols;
 	  maxvalues += ncols-1;
@@ -240,11 +237,11 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) :
   // for fix inputs, check that fix frequency is acceptable
 
   if (nevery <= 0 || nrepeat <= 0 || nfreq <= 0)
-    error->all("Illegal fix ave/histo command");
+    error->all(FLERR,"Illegal fix ave/histo command");
   if (nfreq % nevery || (nrepeat-1)*nevery >= nfreq)
-    error->all("Illegal fix ave/histo command");
-  if (lo >= hi) error->all("Illegal fix ave/histo command");
-  if (nbins <= 0) error->all("Illegal fix ave/histo command");
+    error->all(FLERR,"Illegal fix ave/histo command");
+  if (lo >= hi) error->all(FLERR,"Illegal fix ave/histo command");
+  if (nbins <= 0) error->all(FLERR,"Illegal fix ave/histo command");
 
   int kindflag;
   for (int i = 0; i < nvalues; i++) {
@@ -255,161 +252,161 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) :
 	kindflag = GLOBAL;
       else if (compute->peratom_flag) kindflag = PERATOM;
       else if (compute->local_flag) kindflag = LOCAL;
-      else error->all("Fix ave/histo input is invalid compute");
+      else error->all(FLERR,"Fix ave/histo input is invalid compute");
     } else if (which[i] == FIX) {
       Fix *fix = modify->fix[modify->find_fix(ids[0])];
       if (fix->scalar_flag || fix->vector_flag || fix->array_flag)
 	kindflag = GLOBAL;
       else if (fix->peratom_flag) kindflag = PERATOM;
       else if (fix->local_flag) kindflag = LOCAL;
-      else error->all("Fix ave/histo input is invalid fix");
+      else error->all(FLERR,"Fix ave/histo input is invalid fix");
     } else if (which[i] == VARIABLE) {
       int ivariable = input->variable->find(ids[i]);
       if (input->variable->equalstyle(ivariable)) kindflag = GLOBAL;
       else if (input->variable->atomstyle(ivariable)) kindflag = PERATOM;
-      else error->all("Fix ave/histo input is invalid variable");
+      else error->all(FLERR,"Fix ave/histo input is invalid variable");
     }
     if (i == 0) kind = kindflag;
     else if (kindflag != kind)
-      error->all("Fix ave/histo inputs are not all global, peratom, or local");
+      error->all(FLERR,"Fix ave/histo inputs are not all global, peratom, or local");
   }
 
   if (kind == PERATOM && mode == SCALAR) 
-    error->all("Fix ave/histo cannot input per-atom values in scalar mode");
+    error->all(FLERR,"Fix ave/histo cannot input per-atom values in scalar mode");
   if (kind == LOCAL && mode == SCALAR)
-    error->all("Fix ave/histo cannot input local values in scalar mode");
+    error->all(FLERR,"Fix ave/histo cannot input local values in scalar mode");
 
   for (int i = 0; i < nvalues; i++) {
     if (which[i] == COMPUTE && kind == GLOBAL && mode == SCALAR) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all("Compute ID for fix ave/histo does not exist");
+	error->all(FLERR,"Compute ID for fix ave/histo does not exist");
       if (argindex[i] == 0 && modify->compute[icompute]->scalar_flag == 0)
-	error->all("Fix ave/histo compute does not calculate a global scalar");
+	error->all(FLERR,"Fix ave/histo compute does not calculate a global scalar");
       if (argindex[i] && modify->compute[icompute]->vector_flag == 0)
-	error->all("Fix ave/histo compute does not calculate a global vector");
+	error->all(FLERR,"Fix ave/histo compute does not calculate a global vector");
       if (argindex[i] && argindex[i] > modify->compute[icompute]->size_vector)
-	error->all("Fix ave/histo compute vector is accessed out-of-range");
+	error->all(FLERR,"Fix ave/histo compute vector is accessed out-of-range");
 
     } else if (which[i] == COMPUTE && kind == GLOBAL && mode == VECTOR) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all("Compute ID for fix ave/histo does not exist");
+	error->all(FLERR,"Compute ID for fix ave/histo does not exist");
       if (argindex[i] == 0 && modify->compute[icompute]->vector_flag == 0)
-	error->all("Fix ave/histo compute does not calculate a global vector");
+	error->all(FLERR,"Fix ave/histo compute does not calculate a global vector");
       if (argindex[i] && modify->compute[icompute]->array_flag == 0)
-	error->all("Fix ave/histo compute does not calculate a global array");
+	error->all(FLERR,"Fix ave/histo compute does not calculate a global array");
       if (argindex[i] && 
 	  argindex[i] > modify->compute[icompute]->size_array_cols)
-	error->all("Fix ave/histo compute array is accessed out-of-range");
+	error->all(FLERR,"Fix ave/histo compute array is accessed out-of-range");
 
     } else if (which[i] == COMPUTE && kind == PERATOM) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all("Compute ID for fix ave/histo does not exist");
+	error->all(FLERR,"Compute ID for fix ave/histo does not exist");
       if (modify->compute[icompute]->peratom_flag == 0)
-	error->all("Fix ave/histo compute does not calculate per-atom values");
+	error->all(FLERR,"Fix ave/histo compute does not calculate per-atom values");
       if (argindex[i] == 0 && 
 	  modify->compute[icompute]->size_peratom_cols != 0)
-	error->all("Fix ave/histo compute does not "
+	error->all(FLERR,"Fix ave/histo compute does not "
 		   "calculate a per-atom vector");
       if (argindex[i] && modify->compute[icompute]->size_peratom_cols == 0)
-	error->all("Fix ave/histo compute does not "
+	error->all(FLERR,"Fix ave/histo compute does not "
 		   "calculate a per-atom array");
       if (argindex[i] && 
 	  argindex[i] > modify->compute[icompute]->size_peratom_cols)
-	error->all("Fix ave/histo compute array is accessed out-of-range");
+	error->all(FLERR,"Fix ave/histo compute array is accessed out-of-range");
 
     } else if (which[i] == COMPUTE && kind == LOCAL) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all("Compute ID for fix ave/histo does not exist");
+	error->all(FLERR,"Compute ID for fix ave/histo does not exist");
       if (modify->compute[icompute]->local_flag == 0)
-	error->all("Fix ave/histo compute does not calculate local values");
+	error->all(FLERR,"Fix ave/histo compute does not calculate local values");
       if (argindex[i] == 0 && 
 	  modify->compute[icompute]->size_local_cols != 0)
-	error->all("Fix ave/histo compute does not "
+	error->all(FLERR,"Fix ave/histo compute does not "
 		   "calculate a local vector");
       if (argindex[i] && modify->compute[icompute]->size_local_cols == 0)
-	error->all("Fix ave/histo compute does not "
+	error->all(FLERR,"Fix ave/histo compute does not "
 		   "calculate a local array");
       if (argindex[i] && 
 	  argindex[i] > modify->compute[icompute]->size_local_cols)
-	error->all("Fix ave/histo compute array is accessed out-of-range");
+	error->all(FLERR,"Fix ave/histo compute array is accessed out-of-range");
 
     } else if (which[i] == FIX && kind == GLOBAL && mode == SCALAR) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0)
-	error->all("Fix ID for fix ave/histo does not exist");
+	error->all(FLERR,"Fix ID for fix ave/histo does not exist");
       if (argindex[i] == 0 && modify->fix[ifix]->scalar_flag == 0)
-	error->all("Fix ave/histo fix does not calculate a global scalar");
+	error->all(FLERR,"Fix ave/histo fix does not calculate a global scalar");
       if (argindex[i] && modify->fix[ifix]->vector_flag == 0)
-	error->all("Fix ave/histo fix does not calculate a global vector");
+	error->all(FLERR,"Fix ave/histo fix does not calculate a global vector");
       if (argindex[i] && argindex[i] > modify->fix[ifix]->size_vector)
-	error->all("Fix ave/histo fix vector is accessed out-of-range");
+	error->all(FLERR,"Fix ave/histo fix vector is accessed out-of-range");
       if (nevery % modify->fix[ifix]->global_freq)
-	error->all("Fix for fix ave/histo not computed at compatible time");
+	error->all(FLERR,"Fix for fix ave/histo not computed at compatible time");
 
     } else if (which[i] == FIX && kind == GLOBAL && mode == VECTOR) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0)
-	error->all("Fix ID for fix ave/histo does not exist");
+	error->all(FLERR,"Fix ID for fix ave/histo does not exist");
       if (argindex[i] == 0 && modify->fix[ifix]->vector_flag == 0)
-	error->all("Fix ave/histo fix does not calculate a global vector");
+	error->all(FLERR,"Fix ave/histo fix does not calculate a global vector");
       if (argindex[i] && modify->fix[ifix]->array_flag == 0)
-	error->all("Fix ave/histo fix does not calculate a global array");
+	error->all(FLERR,"Fix ave/histo fix does not calculate a global array");
       if (argindex[i] && argindex[i] > modify->fix[ifix]->size_array_cols)
-	error->all("Fix ave/histo fix array is accessed out-of-range");
+	error->all(FLERR,"Fix ave/histo fix array is accessed out-of-range");
       if (nevery % modify->fix[ifix]->global_freq)
-	error->all("Fix for fix ave/histo not computed at compatible time");
+	error->all(FLERR,"Fix for fix ave/histo not computed at compatible time");
 
     } else if (which[i] == FIX && kind == PERATOM) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0)
-	error->all("Fix ID for fix ave/histo does not exist");
+	error->all(FLERR,"Fix ID for fix ave/histo does not exist");
       if (modify->fix[ifix]->peratom_flag == 0)
-	error->all("Fix ave/histo fix does not calculate per-atom values");
+	error->all(FLERR,"Fix ave/histo fix does not calculate per-atom values");
       if (argindex[i] == 0 && 
 	  modify->fix[ifix]->size_peratom_cols != 0)
-	error->all("Fix ave/histo fix does not "
+	error->all(FLERR,"Fix ave/histo fix does not "
 		   "calculate a per-atom vector");
       if (argindex[i] && modify->fix[ifix]->size_peratom_cols == 0)
-	error->all("Fix ave/histo fix does not "
+	error->all(FLERR,"Fix ave/histo fix does not "
 		   "calculate a per-atom array");
       if (argindex[i] && 
 	  argindex[i] > modify->fix[ifix]->size_peratom_cols)
-	error->all("Fix ave/histo fix array is accessed out-of-range");
+	error->all(FLERR,"Fix ave/histo fix array is accessed out-of-range");
       if (nevery % modify->fix[ifix]->global_freq)
-	error->all("Fix for fix ave/histo not computed at compatible time");
+	error->all(FLERR,"Fix for fix ave/histo not computed at compatible time");
 
     } else if (which[i] == FIX && kind == LOCAL) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0)
-	error->all("Fix ID for fix ave/histo does not exist");
+	error->all(FLERR,"Fix ID for fix ave/histo does not exist");
       if (modify->fix[ifix]->local_flag == 0)
-	error->all("Fix ave/histo fix does not calculate local values");
+	error->all(FLERR,"Fix ave/histo fix does not calculate local values");
       if (argindex[i] == 0 && 
 	  modify->fix[ifix]->size_local_cols != 0)
-	error->all("Fix ave/histo fix does not "
+	error->all(FLERR,"Fix ave/histo fix does not "
 		   "calculate a local vector");
       if (argindex[i] && modify->fix[ifix]->size_local_cols == 0)
-	error->all("Fix ave/histo fix does not "
+	error->all(FLERR,"Fix ave/histo fix does not "
 		   "calculate a local array");
       if (argindex[i] && 
 	  argindex[i] > modify->fix[ifix]->size_local_cols)
-	error->all("Fix ave/histo fix array is accessed out-of-range");
+	error->all(FLERR,"Fix ave/histo fix array is accessed out-of-range");
       if (nevery % modify->fix[ifix]->global_freq)
-	error->all("Fix for fix ave/histo not computed at compatible time");
+	error->all(FLERR,"Fix for fix ave/histo not computed at compatible time");
 
     } else if (which[i] == VARIABLE && kind == GLOBAL) {
       int ivariable = input->variable->find(ids[i]);
       if (ivariable < 0)
-	error->all("Variable name for fix ave/histo does not exist");
+	error->all(FLERR,"Variable name for fix ave/histo does not exist");
 
     } else if (which[i] == VARIABLE && kind == PERATOM) {
       int ivariable = input->variable->find(ids[i]);
       if (ivariable < 0)
-	error->all("Variable name for fix ave/histo does not exist");
+	error->all(FLERR,"Variable name for fix ave/histo does not exist");
     }
   }
 
@@ -524,19 +521,19 @@ void FixAveHisto::init()
     if (which[i] == COMPUTE) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all("Compute ID for fix ave/histo does not exist");
+	error->all(FLERR,"Compute ID for fix ave/histo does not exist");
       value2index[i] = icompute;
 
     } else if (which[i] == FIX) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0) 
-	error->all("Fix ID for fix ave/histo does not exist");
+	error->all(FLERR,"Fix ID for fix ave/histo does not exist");
       value2index[i] = ifix;
 
     } else if (which[i] == VARIABLE) {
       int ivariable = input->variable->find(ids[i]);
       if (ivariable < 0) 
-	error->all("Variable name for fix ave/histo does not exist");
+	error->all(FLERR,"Variable name for fix ave/histo does not exist");
       value2index[i] = ivariable;
     }
   }
@@ -901,68 +898,68 @@ void FixAveHisto::options(int narg, char **arg)
   int iarg = 9 + nvalues;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"file") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/histo command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/histo command");
       if (me == 0) {
 	fp = fopen(arg[iarg+1],"w");
 	if (fp == NULL) {
 	  char str[128];
 	  sprintf(str,"Cannot open fix ave/histo file %s",arg[iarg+1]);
-	  error->one(str);
+	  error->one(FLERR,str);
 	}
       }
       iarg += 2;
     } else if (strcmp(arg[iarg],"ave") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/histo command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/histo command");
       if (strcmp(arg[iarg+1],"one") == 0) ave = ONE;
       else if (strcmp(arg[iarg+1],"running") == 0) ave = RUNNING;
       else if (strcmp(arg[iarg+1],"window") == 0) ave = WINDOW;
-      else error->all("Illegal fix ave/histo command");
+      else error->all(FLERR,"Illegal fix ave/histo command");
       if (ave == WINDOW) {
-	if (iarg+3 > narg) error->all("Illegal fix ave/histo command");
+	if (iarg+3 > narg) error->all(FLERR,"Illegal fix ave/histo command");
 	nwindow = atoi(arg[iarg+2]);
-	if (nwindow <= 0) error->all("Illegal fix ave/histo command");
+	if (nwindow <= 0) error->all(FLERR,"Illegal fix ave/histo command");
       }
       iarg += 2;
       if (ave == WINDOW) iarg++;
     } else if (strcmp(arg[iarg],"start") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/histo command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/histo command");
       startstep = atoi(arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"mode") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/histo command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/histo command");
       if (strcmp(arg[iarg+1],"scalar") == 0) mode = SCALAR;
       else if (strcmp(arg[iarg+1],"vector") == 0) mode = VECTOR;
-      else error->all("Illegal fix ave/histo command");
+      else error->all(FLERR,"Illegal fix ave/histo command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"beyond") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/histo command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/histo command");
       if (strcmp(arg[iarg+1],"ignore") == 0) beyond = IGNORE;
       else if (strcmp(arg[iarg+1],"end") == 0) beyond = END;
       else if (strcmp(arg[iarg+1],"extra") == 0) beyond = EXTRA;
-      else error->all("Illegal fix ave/histo command");
+      else error->all(FLERR,"Illegal fix ave/histo command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"title1") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/spatial command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/spatial command");
       delete [] title1;
       int n = strlen(arg[iarg+1]) + 1;
       title1 = new char[n];
       strcpy(title1,arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"title2") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/spatial command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/spatial command");
       delete [] title2;
       int n = strlen(arg[iarg+1]) + 1;
       title2 = new char[n];
       strcpy(title2,arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"title3") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/spatial command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/spatial command");
       delete [] title3;
       int n = strlen(arg[iarg+1]) + 1;
       title3 = new char[n];
       strcpy(title3,arg[iarg+1]);
       iarg += 2;
-    } else error->all("Illegal fix ave/histo command");
+    } else error->all(FLERR,"Illegal fix ave/histo command");
   }
 }
 
diff --git a/src/fix_ave_spatial.cpp b/src/fix_ave_spatial.cpp
index e1b47e5015d7187a42e33ec6af429aa164d73b48..0fd4672ecf09c1b8b343c22335d7576a081fc031 100644
--- a/src/fix_ave_spatial.cpp
+++ b/src/fix_ave_spatial.cpp
@@ -43,15 +43,12 @@ enum{ONE,RUNNING,WINDOW};
 #define INVOKED_PERATOM 8
 #define BIG 1000000000
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 FixAveSpatial::FixAveSpatial(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 6) error->all("Illegal fix ave/spatial command");
+  if (narg < 6) error->all(FLERR,"Illegal fix ave/spatial command");
 
   MPI_Comm_rank(world,&me);
 
@@ -73,7 +70,7 @@ FixAveSpatial::FixAveSpatial(LAMMPS *lmp, int narg, char **arg) :
     else break;
 
     if (dim[ndim] == 2 && domain->dimension == 2)
-      error->all("Cannot use fix ave/spatial z for 2 dimensional model");
+      error->all(FLERR,"Cannot use fix ave/spatial z for 2 dimensional model");
 
     if (strcmp(arg[iarg+1],"lower") == 0) originflag[ndim] = LOWER;
     if (strcmp(arg[iarg+1],"center") == 0) originflag[ndim] = CENTER;
@@ -86,11 +83,11 @@ FixAveSpatial::FixAveSpatial(LAMMPS *lmp, int narg, char **arg) :
     iarg += 3;
   }
 
-  if (!ndim) error->all("Illegal fix ave/spatial command");
+  if (!ndim) error->all(FLERR,"Illegal fix ave/spatial command");
   if (ndim == 2 && dim[0] == dim[1])
-    error->all("Same dimension twice in fix ave/spatial");
+    error->all(FLERR,"Same dimension twice in fix ave/spatial");
   if (ndim == 3 && (dim[0] == dim[1] || dim[1] == dim[2] || dim[0] == dim[2])) 
-    error->all("Same dimension twice in fix ave/spatial");
+    error->all(FLERR,"Same dimension twice in fix ave/spatial");
 
   // parse values until one isn't recognized
 
@@ -144,7 +141,7 @@ FixAveSpatial::FixAveSpatial(LAMMPS *lmp, int narg, char **arg) :
       char *ptr = strchr(suffix,'[');
       if (ptr) {
 	if (suffix[strlen(suffix)-1] != ']')
-	  error->all("Illegal fix ave/spatial command");
+	  error->all(FLERR,"Illegal fix ave/spatial command");
 	argindex[nvalues] = atoi(ptr+1);
 	*ptr = '\0';
       } else argindex[nvalues] = 0;
@@ -175,125 +172,125 @@ FixAveSpatial::FixAveSpatial(LAMMPS *lmp, int narg, char **arg) :
 
   while (iarg < narg) {
     if (strcmp(arg[iarg],"norm") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/spatial command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/spatial command");
       if (strcmp(arg[iarg+1],"all") == 0) normflag = ALL;
       else if (strcmp(arg[iarg+1],"sample") == 0) normflag = SAMPLE;
-      else error->all("Illegal fix ave/spatial command");
+      else error->all(FLERR,"Illegal fix ave/spatial command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"units") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/spatial command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/spatial command");
       if (strcmp(arg[iarg+1],"box") == 0) scaleflag = BOX;
       else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = LATTICE;
       else if (strcmp(arg[iarg+1],"reduced") == 0) scaleflag = REDUCED;
-      else error->all("Illegal fix ave/spatial command");
+      else error->all(FLERR,"Illegal fix ave/spatial command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"region") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/spatial command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/spatial command");
       iregion = domain->find_region(arg[iarg+1]);
       if (iregion == -1) 
-	error->all("Region ID for fix ave/spatial does not exist");
+	error->all(FLERR,"Region ID for fix ave/spatial does not exist");
       int n = strlen(arg[iarg+1]) + 1;
       idregion = new char[n];
       strcpy(idregion,arg[iarg+1]);
       regionflag = 1;
       iarg += 2;
     } else if (strcmp(arg[iarg],"file") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/spatial command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/spatial command");
       if (me == 0) {
 	fp = fopen(arg[iarg+1],"w");
 	if (fp == NULL) {
 	  char str[128];
 	  sprintf(str,"Cannot open fix ave/spatial file %s",arg[iarg+1]);
-	  error->one(str);
+	  error->one(FLERR,str);
 	}
       }
       iarg += 2;
     } else if (strcmp(arg[iarg],"ave") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/spatial command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/spatial command");
       if (strcmp(arg[iarg+1],"one") == 0) ave = ONE;
       else if (strcmp(arg[iarg+1],"running") == 0) ave = RUNNING;
       else if (strcmp(arg[iarg+1],"window") == 0) ave = WINDOW;
-      else error->all("Illegal fix ave/spatial command");
+      else error->all(FLERR,"Illegal fix ave/spatial command");
       if (ave == WINDOW) {
-	if (iarg+3 > narg) error->all("Illegal fix ave/spatial command");
+	if (iarg+3 > narg) error->all(FLERR,"Illegal fix ave/spatial command");
 	nwindow = atoi(arg[iarg+2]);
-	if (nwindow <= 0) error->all("Illegal fix ave/spatial command");
+	if (nwindow <= 0) error->all(FLERR,"Illegal fix ave/spatial command");
       }
       iarg += 2;
       if (ave == WINDOW) iarg++;
     } else if (strcmp(arg[iarg],"title1") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/spatial command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/spatial command");
       delete [] title1;
       int n = strlen(arg[iarg+1]) + 1;
       title1 = new char[n];
       strcpy(title1,arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"title2") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/spatial command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/spatial command");
       delete [] title2;
       int n = strlen(arg[iarg+1]) + 1;
       title2 = new char[n];
       strcpy(title2,arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"title3") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/spatial command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/spatial command");
       delete [] title3;
       int n = strlen(arg[iarg+1]) + 1;
       title3 = new char[n];
       strcpy(title3,arg[iarg+1]);
       iarg += 2;
-    } else error->all("Illegal fix ave/spatial command");
+    } else error->all(FLERR,"Illegal fix ave/spatial command");
   }
 
   // setup and error check
 
   if (nevery <= 0 || nrepeat <= 0 || nfreq <= 0)
-    error->all("Illegal fix ave/spatial command");
+    error->all(FLERR,"Illegal fix ave/spatial command");
   if (nfreq % nevery || (nrepeat-1)*nevery >= nfreq)
-    error->all("Illegal fix ave/spatial command");
-  if (delta[0] <= 0.0) error->all("Illegal fix ave/spatial command");
+    error->all(FLERR,"Illegal fix ave/spatial command");
+  if (delta[0] <= 0.0) error->all(FLERR,"Illegal fix ave/spatial command");
   if (ndim >= 2 && delta[1] <= 0.0) 
-    error->all("Illegal fix ave/spatial command");
+    error->all(FLERR,"Illegal fix ave/spatial command");
   if (ndim == 3 && delta[2] <= 0.0) 
-    error->all("Illegal fix ave/spatial command");
+    error->all(FLERR,"Illegal fix ave/spatial command");
 
   for (int i = 0; i < nvalues; i++) {
     if (which[i] == COMPUTE) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all("Compute ID for fix ave/spatial does not exist");
+	error->all(FLERR,"Compute ID for fix ave/spatial does not exist");
       if (modify->compute[icompute]->peratom_flag == 0)
-	error->all("Fix ave/spatial compute does not "
+	error->all(FLERR,"Fix ave/spatial compute does not "
 		   "calculate per-atom values");
       if (argindex[i] == 0 && 
 	  modify->compute[icompute]->size_peratom_cols != 0)
-	error->all("Fix ave/spatial compute does not "
+	error->all(FLERR,"Fix ave/spatial compute does not "
 		   "calculate a per-atom vector");
       if (argindex[i] && modify->compute[icompute]->size_peratom_cols == 0)
-	error->all("Fix ave/spatial compute does not "
+	error->all(FLERR,"Fix ave/spatial compute does not "
 		   "calculate a per-atom array");
       if (argindex[i] && 
 	  argindex[i] > modify->compute[icompute]->size_peratom_cols)
-	error->all("Fix ave/spatial compute vector is accessed out-of-range");
+	error->all(FLERR,"Fix ave/spatial compute vector is accessed out-of-range");
 
     } else if (which[i] == FIX) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0)
-	error->all("Fix ID for fix ave/spatial does not exist");
+	error->all(FLERR,"Fix ID for fix ave/spatial does not exist");
       if (modify->fix[ifix]->peratom_flag == 0)
-	error->all("Fix ave/spatial fix does not calculate per-atom values");
+	error->all(FLERR,"Fix ave/spatial fix does not calculate per-atom values");
       if (argindex[i] && modify->fix[ifix]->size_peratom_cols != 0)
-	error->all("Fix ave/spatial fix does not calculate a per-atom vector");
+	error->all(FLERR,"Fix ave/spatial fix does not calculate a per-atom vector");
       if (argindex[i] && modify->fix[ifix]->size_peratom_cols == 0)
-	error->all("Fix ave/spatial fix does not calculate a per-atom array");
+	error->all(FLERR,"Fix ave/spatial fix does not calculate a per-atom array");
       if (argindex[i] && argindex[i] > modify->fix[ifix]->size_peratom_cols)
-	error->all("Fix ave/spatial fix vector is accessed out-of-range");
+	error->all(FLERR,"Fix ave/spatial fix vector is accessed out-of-range");
     } else if (which[i] == VARIABLE) {
       int ivariable = input->variable->find(ids[i]);
       if (ivariable < 0)
-	error->all("Variable name for fix ave/spatial does not exist");
+	error->all(FLERR,"Variable name for fix ave/spatial does not exist");
       if (input->variable->atomstyle(ivariable) == 0)
-	error->all("Fix ave/spatial variable is not atom-style variable");
+	error->all(FLERR,"Fix ave/spatial variable is not atom-style variable");
     }
   }
 
@@ -330,10 +327,10 @@ FixAveSpatial::FixAveSpatial(LAMMPS *lmp, int narg, char **arg) :
 
   int triclinic = domain->triclinic;
   if (triclinic == 1 && scaleflag != REDUCED)
-    error->all("Fix ave/spatial for triclinic boxes requires units reduced");
+    error->all(FLERR,"Fix ave/spatial for triclinic boxes requires units reduced");
 
   if (scaleflag == LATTICE && domain->lattice == NULL)
-    error->all("Use of fix ave/spatial with undefined lattice");
+    error->all(FLERR,"Use of fix ave/spatial with undefined lattice");
 
   if (scaleflag == LATTICE) {
     xscale = domain->lattice->xlattice;
@@ -429,7 +426,7 @@ void FixAveSpatial::init()
   if (regionflag) {
     iregion = domain->find_region(idregion);
     if (iregion == -1)
-      error->all("Region ID for fix ave/spatial does not exist");
+      error->all(FLERR,"Region ID for fix ave/spatial does not exist");
     region = domain->regions[iregion];
   }
 
@@ -437,7 +434,7 @@ void FixAveSpatial::init()
 
   if (ave == RUNNING || ave == WINDOW) {
     if (scaleflag != REDUCED && domain->box_change)
-      error->all("Fix ave/spatial settings invalid with changing box");
+      error->all(FLERR,"Fix ave/spatial settings invalid with changing box");
   }
 
   // set indices and check validity of all computes,fixes,variables
@@ -447,22 +444,22 @@ void FixAveSpatial::init()
     if (which[m] == COMPUTE) {
       int icompute = modify->find_compute(ids[m]);
       if (icompute < 0)
-	error->all("Compute ID for fix ave/spatial does not exist");
+	error->all(FLERR,"Compute ID for fix ave/spatial does not exist");
       value2index[m] = icompute;
       
     } else if (which[m] == FIX) {
       int ifix = modify->find_fix(ids[m]);
       if (ifix < 0) 
-	error->all("Fix ID for fix ave/spatial does not exist");
+	error->all(FLERR,"Fix ID for fix ave/spatial does not exist");
       value2index[m] = ifix;
 
       if (nevery % modify->fix[ifix]->peratom_freq)
-	error->all("Fix for fix ave/spatial not computed at compatible time");
+	error->all(FLERR,"Fix for fix ave/spatial not computed at compatible time");
 
     } else if (which[m] == VARIABLE) {
       int ivariable = input->variable->find(ids[m]);
       if (ivariable < 0) 
-	error->all("Variable name for fix ave/spatial does not exist");
+	error->all(FLERR,"Variable name for fix ave/spatial does not exist");
       value2index[m] = ivariable;
 
     } else value2index[m] = -1;
diff --git a/src/fix_ave_time.cpp b/src/fix_ave_time.cpp
index 5addde62588e3f49ceb0d404d2748d54c4af7851..6d93da8e602bc55463247c4ea1412c912aad16d4 100644
--- a/src/fix_ave_time.cpp
+++ b/src/fix_ave_time.cpp
@@ -43,7 +43,7 @@ enum{SCALAR,VECTOR};
 FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 7) error->all("Illegal fix ave/time command");
+  if (narg < 7) error->all(FLERR,"Illegal fix ave/time command");
 
   MPI_Comm_rank(world,&me);
 
@@ -98,7 +98,7 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) :
       char *ptr = strchr(suffix,'[');
       if (ptr) {
 	if (suffix[strlen(suffix)-1] != ']')
-	  error->all("Illegal fix ave/time command");
+	  error->all(FLERR,"Illegal fix ave/time command");
 	argindex[nvalues] = atoi(ptr+1);
 	*ptr = '\0';
       } else argindex[nvalues] = 0;
@@ -112,7 +112,7 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) :
 	  argindex[nvalues] == 0) {
 	int icompute = modify->find_compute(ids[nvalues]);
 	if (icompute < 0)
-	  error->all("Compute ID for fix ave/time does not exist");
+	  error->all(FLERR,"Compute ID for fix ave/time does not exist");
 	if (modify->compute[icompute]->array_flag) {
 	  int ncols = modify->compute[icompute]->size_array_cols;
 	  maxvalues += ncols-1;
@@ -132,7 +132,7 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) :
 		 argindex[nvalues] == 0) {
 	int ifix = modify->find_fix(ids[nvalues]);
 	if (ifix < 0)
-	  error->all("Fix ID for fix ave/time does not exist");
+	  error->all(FLERR,"Fix ID for fix ave/time does not exist");
 	if (modify->fix[ifix]->array_flag) {
 	  int ncols = modify->fix[ifix]->size_array_cols;
 	  maxvalues += ncols-1;
@@ -159,7 +159,7 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) :
   for (int i = 0; i < nvalues; i++) offcol[i] = 0;
   for (int i = 0; i < noff; i++) {
     if (offlist[i] < 1 || offlist[i] > nvalues)
-      error->all("Invalid fix ave/time off column");
+      error->all(FLERR,"Invalid fix ave/time off column");
     offcol[offlist[i]-1] = 1;
   }
 
@@ -167,68 +167,68 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) :
   // for fix inputs, check that fix frequency is acceptable
 
   if (nevery <= 0 || nrepeat <= 0 || nfreq <= 0)
-    error->all("Illegal fix ave/time command");
+    error->all(FLERR,"Illegal fix ave/time command");
   if (nfreq % nevery || (nrepeat-1)*nevery >= nfreq)
-    error->all("Illegal fix ave/time command");
+    error->all(FLERR,"Illegal fix ave/time command");
 
   for (int i = 0; i < nvalues; i++) {
     if (which[i] == COMPUTE && mode == SCALAR) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all("Compute ID for fix ave/time does not exist");
+	error->all(FLERR,"Compute ID for fix ave/time does not exist");
       if (argindex[i] == 0 && modify->compute[icompute]->scalar_flag == 0)
-	error->all("Fix ave/time compute does not calculate a scalar");
+	error->all(FLERR,"Fix ave/time compute does not calculate a scalar");
       if (argindex[i] && modify->compute[icompute]->vector_flag == 0)
-	error->all("Fix ave/time compute does not calculate a vector");
+	error->all(FLERR,"Fix ave/time compute does not calculate a vector");
       if (argindex[i] && argindex[i] > modify->compute[icompute]->size_vector)
-	error->all("Fix ave/time compute vector is accessed out-of-range");
+	error->all(FLERR,"Fix ave/time compute vector is accessed out-of-range");
 
     } else if (which[i] == COMPUTE && mode == VECTOR) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all("Compute ID for fix ave/time does not exist");
+	error->all(FLERR,"Compute ID for fix ave/time does not exist");
       if (argindex[i] == 0 && modify->compute[icompute]->vector_flag == 0)
-	error->all("Fix ave/time compute does not calculate a vector");
+	error->all(FLERR,"Fix ave/time compute does not calculate a vector");
       if (argindex[i] && modify->compute[icompute]->array_flag == 0)
-	error->all("Fix ave/time compute does not calculate an array");
+	error->all(FLERR,"Fix ave/time compute does not calculate an array");
       if (argindex[i] && 
 	  argindex[i] > modify->compute[icompute]->size_array_cols)
-	error->all("Fix ave/time compute array is accessed out-of-range");
+	error->all(FLERR,"Fix ave/time compute array is accessed out-of-range");
 
     } else if (which[i] == FIX && mode == SCALAR) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0)
-	error->all("Fix ID for fix ave/time does not exist");
+	error->all(FLERR,"Fix ID for fix ave/time does not exist");
       if (argindex[i] == 0 && modify->fix[ifix]->scalar_flag == 0)
-	error->all("Fix ave/time fix does not calculate a scalar");
+	error->all(FLERR,"Fix ave/time fix does not calculate a scalar");
       if (argindex[i] && modify->fix[ifix]->vector_flag == 0)
-	error->all("Fix ave/time fix does not calculate a vector");
+	error->all(FLERR,"Fix ave/time fix does not calculate a vector");
       if (argindex[i] && argindex[i] > modify->fix[ifix]->size_vector)
-	error->all("Fix ave/time fix vector is accessed out-of-range");
+	error->all(FLERR,"Fix ave/time fix vector is accessed out-of-range");
       if (nevery % modify->fix[ifix]->global_freq)
-	error->all("Fix for fix ave/time not computed at compatible time");
+	error->all(FLERR,"Fix for fix ave/time not computed at compatible time");
 
     } else if (which[i] == FIX && mode == VECTOR) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0)
-	error->all("Fix ID for fix ave/time does not exist");
+	error->all(FLERR,"Fix ID for fix ave/time does not exist");
       if (argindex[i] == 0 && modify->fix[ifix]->vector_flag == 0)
-	error->all("Fix ave/time fix does not calculate a vector");
+	error->all(FLERR,"Fix ave/time fix does not calculate a vector");
       if (argindex[i] && modify->fix[ifix]->array_flag == 0)
-	error->all("Fix ave/time fix does not calculate an array");
+	error->all(FLERR,"Fix ave/time fix does not calculate an array");
       if (argindex[i] && argindex[i] > modify->fix[ifix]->size_array_cols)
-	error->all("Fix ave/time fix array is accessed out-of-range");
+	error->all(FLERR,"Fix ave/time fix array is accessed out-of-range");
       if (nevery % modify->fix[ifix]->global_freq)
-	error->all("Fix for fix ave/time not computed at compatible time");
+	error->all(FLERR,"Fix for fix ave/time not computed at compatible time");
 
     } else if (which[i] == VARIABLE) {
       int ivariable = input->variable->find(ids[i]);
       if (ivariable < 0)
-	error->all("Variable name for fix ave/time does not exist");
+	error->all(FLERR,"Variable name for fix ave/time does not exist");
       if (input->variable->equalstyle(ivariable) == 0)
-	error->all("Fix ave/time variable is not equal-style variable");
+	error->all(FLERR,"Fix ave/time variable is not equal-style variable");
       if (mode == VECTOR)
-	error->all("Fix ave/time cannot use variable with vector mode");
+	error->all(FLERR,"Fix ave/time cannot use variable with vector mode");
     }
   }
 
@@ -250,7 +250,7 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) :
       }
       if (i == 0) nrows = length;
       else if (length != nrows)
-	error->all("Fix ave/time columns are inconsistent lengths");
+	error->all(FLERR,"Fix ave/time columns are inconsistent lengths");
     }
 
     column = new double[nrows];
@@ -389,11 +389,11 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) :
 	  else value = fix->extarray;
 	}
 	if (value == -1) 
-	  error->all("Fix ave/time cannot set output array "
+	  error->all(FLERR,"Fix ave/time cannot set output array "
 		     "intensive/extensive from these inputs");
 	if (i == 0) extarray = value;
 	else if (value != extarray)
-	  error->all("Fix ave/time cannot set output array "
+	  error->all(FLERR,"Fix ave/time cannot set output array "
 		     "intensive/extensive from these inputs");
       }
     }
@@ -463,19 +463,19 @@ void FixAveTime::init()
     if (which[i] == COMPUTE) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all("Compute ID for fix ave/time does not exist");
+	error->all(FLERR,"Compute ID for fix ave/time does not exist");
       value2index[i] = icompute;
 
     } else if (which[i] == FIX) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0) 
-	error->all("Fix ID for fix ave/time does not exist");
+	error->all(FLERR,"Fix ID for fix ave/time does not exist");
       value2index[i] = ifix;
 
     } else if (which[i] == VARIABLE) {
       int ivariable = input->variable->find(ids[i]);
       if (ivariable < 0) 
-	error->all("Variable name for fix ave/time does not exist");
+	error->all(FLERR,"Variable name for fix ave/time does not exist");
       value2index[i] = ivariable;
     }
   }
@@ -833,66 +833,66 @@ void FixAveTime::options(int narg, char **arg)
   int iarg = 6 + nvalues;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"file") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/time command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/time command");
       if (me == 0) {
 	fp = fopen(arg[iarg+1],"w");
 	if (fp == NULL) {
 	  char str[128];
 	  sprintf(str,"Cannot open fix ave/time file %s",arg[iarg+1]);
-	  error->one(str);
+	  error->one(FLERR,str);
 	}
       }
       iarg += 2;
     } else if (strcmp(arg[iarg],"ave") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/time command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/time command");
       if (strcmp(arg[iarg+1],"one") == 0) ave = ONE;
       else if (strcmp(arg[iarg+1],"running") == 0) ave = RUNNING;
       else if (strcmp(arg[iarg+1],"window") == 0) ave = WINDOW;
-      else error->all("Illegal fix ave/time command");
+      else error->all(FLERR,"Illegal fix ave/time command");
       if (ave == WINDOW) {
-	if (iarg+3 > narg) error->all("Illegal fix ave/time command");
+	if (iarg+3 > narg) error->all(FLERR,"Illegal fix ave/time command");
 	nwindow = atoi(arg[iarg+2]);
-	if (nwindow <= 0) error->all("Illegal fix ave/time command");
+	if (nwindow <= 0) error->all(FLERR,"Illegal fix ave/time command");
       }
       iarg += 2;
       if (ave == WINDOW) iarg++;
     } else if (strcmp(arg[iarg],"start") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/time command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/time command");
       startstep = atoi(arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"mode") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/time command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/time command");
       if (strcmp(arg[iarg+1],"scalar") == 0) mode = SCALAR;
       else if (strcmp(arg[iarg+1],"vector") == 0) mode = VECTOR;
-      else error->all("Illegal fix ave/time command");
+      else error->all(FLERR,"Illegal fix ave/time command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"off") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/time command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/time command");
       memory->grow(offlist,noff+1,"ave/time:offlist");
       offlist[noff++] = atoi(arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"title1") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/spatial command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/spatial command");
       delete [] title1;
       int n = strlen(arg[iarg+1]) + 1;
       title1 = new char[n];
       strcpy(title1,arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"title2") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/spatial command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/spatial command");
       delete [] title2;
       int n = strlen(arg[iarg+1]) + 1;
       title2 = new char[n];
       strcpy(title2,arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"title3") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix ave/spatial command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/spatial command");
       delete [] title3;
       int n = strlen(arg[iarg+1]) + 1;
       title3 = new char[n];
       strcpy(title3,arg[iarg+1]);
       iarg += 2;
-    } else error->all("Illegal fix ave/time command");
+    } else error->all(FLERR,"Illegal fix ave/time command");
   }
 }
 
diff --git a/src/fix_aveforce.cpp b/src/fix_aveforce.cpp
index b4fd4f333a5f640c2b6b3c55bea8f565719a4106..c825e51b382a9af245ae823fba1ce1f5b46ad15a 100644
--- a/src/fix_aveforce.cpp
+++ b/src/fix_aveforce.cpp
@@ -34,7 +34,7 @@ enum{NONE,CONSTANT,EQUAL};
 FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 6) error->all("Illegal fix aveforce command");
+  if (narg < 6) error->all(FLERR,"Illegal fix aveforce command");
 
   vector_flag = 1;
   size_vector = 3;
@@ -82,15 +82,15 @@ FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) :
   int iarg = 6;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"region") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix aveforce command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix aveforce command");
       iregion = domain->find_region(arg[iarg+1]);
       if (iregion == -1)
-	error->all("Region ID for fix aveforce does not exist");
+	error->all(FLERR,"Region ID for fix aveforce does not exist");
       int n = strlen(arg[iarg+1]) + 1;
       idregion = new char[n];
       strcpy(idregion,arg[iarg+1]);
       iarg += 2;
-    } else error->all("Illegal fix aveforce command");
+    } else error->all(FLERR,"Illegal fix aveforce command");
 
   }
 
@@ -127,28 +127,28 @@ void FixAveForce::init()
 
   if (xstr) {
     xvar = input->variable->find(xstr);
-    if (xvar < 0) error->all("Variable name for fix aveforce does not exist");
+    if (xvar < 0) error->all(FLERR,"Variable name for fix aveforce does not exist");
     if (input->variable->equalstyle(xvar)) xstyle = EQUAL;
-    else error->all("Variable for fix aveforce is invalid style");
+    else error->all(FLERR,"Variable for fix aveforce is invalid style");
   }
   if (ystr) {
     yvar = input->variable->find(ystr);
-    if (yvar < 0) error->all("Variable name for fix aveforce does not exist");
+    if (yvar < 0) error->all(FLERR,"Variable name for fix aveforce does not exist");
     if (input->variable->equalstyle(yvar)) ystyle = EQUAL;
-    else error->all("Variable for fix aveforce is invalid style");
+    else error->all(FLERR,"Variable for fix aveforce is invalid style");
   }
   if (zstr) {
     zvar = input->variable->find(zstr);
-    if (zvar < 0) error->all("Variable name for fix aveforce does not exist");
+    if (zvar < 0) error->all(FLERR,"Variable name for fix aveforce does not exist");
     if (input->variable->equalstyle(zvar)) zstyle = EQUAL;
-    else error->all("Variable for fix aveforce is invalid style");
+    else error->all(FLERR,"Variable for fix aveforce is invalid style");
   }
 
   // set index and check validity of region
 
   if (iregion >= 0) {
     iregion = domain->find_region(idregion);
-    if (iregion == -1) error->all("Region ID for fix aveforce does not exist");
+    if (iregion == -1) error->all(FLERR,"Region ID for fix aveforce does not exist");
   }
 
   if (xstyle == EQUAL || ystyle == EQUAL || zstyle == EQUAL) varflag = EQUAL;
diff --git a/src/fix_box_relax.cpp b/src/fix_box_relax.cpp
index 7d4d74d08a890572edcc6c337a6ec61a30c42972..09d6f286654c55c12da951b29fef488ada03763a 100644
--- a/src/fix_box_relax.cpp
+++ b/src/fix_box_relax.cpp
@@ -32,9 +32,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 enum{NONE,XYZ,XY,YZ,XZ};
 enum{ISO,ANISO,TRICLINIC};
 
@@ -45,7 +42,7 @@ enum{ISO,ANISO,TRICLINIC};
 FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 5) error->all("Illegal fix box/relax command");
+  if (narg < 5) error->all(FLERR,"Illegal fix box/relax command");
 
   scalar_flag = 1;
   extscalar = 1;
@@ -74,7 +71,7 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) :
 
   while (iarg < narg) {
     if (strcmp(arg[iarg],"iso") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix box/relax command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
       pcouple = XYZ;
       p_target[0] = p_target[1] = p_target[2] = atof(arg[iarg+1]);
       p_flag[0] = p_flag[1] = p_flag[2] = 1;
@@ -84,7 +81,7 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) :
       }
       iarg += 2; 
     } else if (strcmp(arg[iarg],"aniso") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix box/relax command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
       pcouple = NONE;
       p_target[0] = p_target[1] = p_target[2] = atof(arg[iarg+1]);
       p_flag[0] = p_flag[1] = p_flag[2] = 1;
@@ -94,7 +91,7 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) :
       }
       iarg += 2;
     } else if (strcmp(arg[iarg],"tri") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix box/relax command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
       pcouple = NONE;
       p_target[0] = p_target[1] = p_target[2] = atof(arg[iarg+1]);
       p_flag[0] = p_flag[1] = p_flag[2] = 1;
@@ -107,75 +104,75 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) :
       iarg += 2;
 
     } else if (strcmp(arg[iarg],"x") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix box/relax command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
       p_target[0] = atof(arg[iarg+1]);
       p_flag[0] = 1;
       deviatoric_flag = 1;
       iarg += 2; 
     } else if (strcmp(arg[iarg],"y") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix box/relax command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
       p_target[1] = atof(arg[iarg+1]);
       p_flag[1] = 1;
       deviatoric_flag = 1;
       iarg += 2; 
     } else if (strcmp(arg[iarg],"z") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix box/relax command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
       p_target[2] = atof(arg[iarg+1]);
       p_flag[2] = 1;
       deviatoric_flag = 1;
       iarg += 2; 
       if (dimension == 2)
-	error->all("Invalid fix box/relax command for a 2d simulation");
+	error->all(FLERR,"Invalid fix box/relax command for a 2d simulation");
 
     } else if (strcmp(arg[iarg],"yz") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix box/relax command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
       p_target[3] = atof(arg[iarg+1]);
       p_flag[3] = 1;
       deviatoric_flag = 1;
       iarg += 2; 
       if (dimension == 2)
-	error->all("Invalid fix box/relax command for a 2d simulation");
+	error->all(FLERR,"Invalid fix box/relax command for a 2d simulation");
     } else if (strcmp(arg[iarg],"xz") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix box/relax command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
       p_target[4] = atof(arg[iarg+1]);
       p_flag[4] = 1;
       deviatoric_flag = 1;
       iarg += 2; 
       if (dimension == 2)
-	error->all("Invalid fix box/relax command for a 2d simulation");
+	error->all(FLERR,"Invalid fix box/relax command for a 2d simulation");
     } else if (strcmp(arg[iarg],"xy") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix box/relax command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
       p_target[5] = atof(arg[iarg+1]);
       p_flag[5] = 1;
       deviatoric_flag = 1;
       iarg += 2; 
 
     } else if (strcmp(arg[iarg],"couple") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix box/relax command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
       if (strcmp(arg[iarg+1],"xyz") == 0) pcouple = XYZ;
       else if (strcmp(arg[iarg+1],"xy") == 0) pcouple = XY;
       else if (strcmp(arg[iarg+1],"yz") == 0) pcouple = YZ;
       else if (strcmp(arg[iarg+1],"xz") == 0) pcouple = XZ;
       else if (strcmp(arg[iarg+1],"none") == 0) pcouple = NONE;
-      else error->all("Illegal fix box/relax command");
+      else error->all(FLERR,"Illegal fix box/relax command");
       iarg += 2;
 
     } else if (strcmp(arg[iarg],"dilate") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix box/relax command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
       if (strcmp(arg[iarg+1],"all") == 0) allremap = 1;
       else if (strcmp(arg[iarg+1],"partial") == 0) allremap = 0;
-      else error->all("Illegal fix box/relax command");
+      else error->all(FLERR,"Illegal fix box/relax command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"vmax") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix box/relax command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
       vmax = atof(arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"nreset") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix box/relax command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
       nreset_h0 = atoi(arg[iarg+1]);
-      if (nreset_h0 < 0) error->all("Illegal fix box/relax command");
+      if (nreset_h0 < 0) error->all(FLERR,"Illegal fix box/relax command");
       iarg += 2;
-    } else error->all("Illegal fix box/relax command");
+    } else error->all(FLERR,"Illegal fix box/relax command");
   }
 
   if (p_flag[0] || p_flag[1] || p_flag[2]) box_change_size = 1;
@@ -185,51 +182,51 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) :
   // error checks
 
   if (dimension == 2 && (p_flag[2] || p_flag[3] || p_flag[4]))
-    error->all("Invalid fix box/relax command for a 2d simulation");
+    error->all(FLERR,"Invalid fix box/relax command for a 2d simulation");
   if (dimension == 2 && (pcouple == YZ || pcouple == XZ))
-    error->all("Invalid fix box/relax command for a 2d simulation");
+    error->all(FLERR,"Invalid fix box/relax command for a 2d simulation");
 
   if (pcouple == XYZ && (p_flag[0] == 0 || p_flag[1] == 0))
-    error->all("Invalid fix box/relax command pressure settings");
+    error->all(FLERR,"Invalid fix box/relax command pressure settings");
   if (pcouple == XYZ && dimension == 3 && p_flag[2] == 0)
-    error->all("Invalid fix box/relax command pressure settings");
+    error->all(FLERR,"Invalid fix box/relax command pressure settings");
   if (pcouple == XY && (p_flag[0] == 0 || p_flag[1] == 0))
-    error->all("Invalid fix box/relax command pressure settings");
+    error->all(FLERR,"Invalid fix box/relax command pressure settings");
   if (pcouple == YZ && (p_flag[1] == 0 || p_flag[2] == 0))
-    error->all("Invalid fix box/relax command pressure settings");
+    error->all(FLERR,"Invalid fix box/relax command pressure settings");
   if (pcouple == XZ && (p_flag[0] == 0 || p_flag[2] == 0))
-    error->all("Invalid fix box/relax command pressure settings");
+    error->all(FLERR,"Invalid fix box/relax command pressure settings");
 
   if (p_flag[0] && domain->xperiodic == 0)
-    error->all("Cannot use fix box/relax on a non-periodic dimension");
+    error->all(FLERR,"Cannot use fix box/relax on a non-periodic dimension");
   if (p_flag[1] && domain->yperiodic == 0)
-    error->all("Cannot use fix box/relax on a non-periodic dimension");
+    error->all(FLERR,"Cannot use fix box/relax on a non-periodic dimension");
   if (p_flag[2] && domain->zperiodic == 0)
-    error->all("Cannot use fix box/relax on a non-periodic dimension");
+    error->all(FLERR,"Cannot use fix box/relax on a non-periodic dimension");
   if (p_flag[3] && domain->zperiodic == 0)
-    error->all("Cannot use fix box/relax on a 2nd non-periodic dimension");
+    error->all(FLERR,"Cannot use fix box/relax on a 2nd non-periodic dimension");
   if (p_flag[4] && domain->zperiodic == 0)
-    error->all("Cannot use fix box/relax on a 2nd non-periodic dimension");
+    error->all(FLERR,"Cannot use fix box/relax on a 2nd non-periodic dimension");
   if (p_flag[5] && domain->yperiodic == 0)
-    error->all("Cannot use fix box/relax on a 2nd non-periodic dimension");
+    error->all(FLERR,"Cannot use fix box/relax on a 2nd non-periodic dimension");
 
   if (!domain->triclinic && (p_flag[3] || p_flag[4] || p_flag[5])) 
-    error->all("Can not specify Pxy/Pxz/Pyz in "
+    error->all(FLERR,"Can not specify Pxy/Pxz/Pyz in "
 	       "fix box/relax with non-triclinic box");
 
   if (pcouple == XYZ && dimension == 3 &&
       (p_target[0] != p_target[1] || p_target[0] != p_target[2]))
-    error->all("Invalid fix box/relax pressure settings");
+    error->all(FLERR,"Invalid fix box/relax pressure settings");
   if (pcouple == XYZ && dimension == 2 && p_target[0] != p_target[1])
-    error->all("Invalid fix box/relax pressure settings");
+    error->all(FLERR,"Invalid fix box/relax pressure settings");
   if (pcouple == XY && p_target[0] != p_target[1])
-    error->all("Invalid fix box/relax pressure settings");
+    error->all(FLERR,"Invalid fix box/relax pressure settings");
   if (pcouple == YZ && p_target[1] != p_target[2])
-    error->all("Invalid fix box/relax pressure settings");
+    error->all(FLERR,"Invalid fix box/relax pressure settings");
   if (pcouple == XZ && p_target[0] != p_target[2])
-    error->all("Invalid fix box/relax pressure settings");
+    error->all(FLERR,"Invalid fix box/relax pressure settings");
 
-  if (vmax <= 0.0) error->all("Illegal fix box/relax command");
+  if (vmax <= 0.0) error->all(FLERR,"Illegal fix box/relax command");
 
   // pstyle = TRICLINIC if any off-diagonal term is controlled -> 6 dof
   // else pstyle = ISO if XYZ coupling or XY coupling in 2d -> 1 dof
@@ -314,11 +311,11 @@ void FixBoxRelax::init()
 
   int icompute = modify->find_compute(id_temp);
   if (icompute < 0) 
-    error->all("Temperature ID for fix box/relax does not exist");
+    error->all(FLERR,"Temperature ID for fix box/relax does not exist");
   temperature = modify->compute[icompute];
 
   icompute = modify->find_compute(id_press);
-  if (icompute < 0) error->all("Pressure ID for fix box/relax does not exist");
+  if (icompute < 0) error->all(FLERR,"Pressure ID for fix box/relax does not exist");
   pressure = modify->compute[icompute];
 
   pv2e = 1.0 / force->nktv2p;
@@ -473,7 +470,7 @@ void FixBoxRelax::min_clearstore()
 void FixBoxRelax::min_pushstore()
 {
   if (current_lifo >= MAX_LIFO_DEPTH) {
-    error->all("Attempt to push beyond stack limit in fix box/relax");
+    error->all(FLERR,"Attempt to push beyond stack limit in fix box/relax");
     return;
   }
   current_lifo++;
@@ -487,7 +484,7 @@ void FixBoxRelax::min_pushstore()
 void FixBoxRelax::min_popstore()
 {
   if (current_lifo <= 0) {
-    error->all("Attempt to pop empty stack in fix box/relax");
+    error->all(FLERR,"Attempt to pop empty stack in fix box/relax");
     return;
   }
   current_lifo--;
@@ -611,7 +608,7 @@ void FixBoxRelax::remap()
       domain->boxlo[i] = currentBoxLo0 + (currentBoxLo0-ctr)*ds[i]/s0[i];
       domain->boxhi[i] = currentBoxHi0 + (currentBoxHi0-ctr)*ds[i]/s0[i];
       if (domain->boxlo[i] >= domain->boxhi[i])
-	error->all("Fix box/relax generated negative box length");
+	error->all(FLERR,"Fix box/relax generated negative box length");
     }
 
   if (pstyle == TRICLINIC) {
@@ -680,7 +677,7 @@ void FixBoxRelax::couple()
 int FixBoxRelax::modify_param(int narg, char **arg)
 {
   if (strcmp(arg[0],"temp") == 0) {
-    if (narg < 2) error->all("Illegal fix_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
     if (tflag) {
       modify->delete_compute(id_temp);
       tflag = 0;
@@ -691,24 +688,24 @@ int FixBoxRelax::modify_param(int narg, char **arg)
     strcpy(id_temp,arg[1]);
 
     int icompute = modify->find_compute(arg[1]);
-    if (icompute < 0) error->all("Could not find fix_modify temperature ID");
+    if (icompute < 0) error->all(FLERR,"Could not find fix_modify temperature ID");
     temperature = modify->compute[icompute];
 
     if (temperature->tempflag == 0)
-      error->all("Fix_modify temperature ID does not compute temperature");
+      error->all(FLERR,"Fix_modify temperature ID does not compute temperature");
     if (temperature->igroup != 0 && comm->me == 0)
-      error->warning("Temperature for fix modify is not for group all");
+      error->warning(FLERR,"Temperature for fix modify is not for group all");
 
     // reset id_temp of pressure to new temperature ID
     
     icompute = modify->find_compute(id_press);
-    if (icompute < 0) error->all("Pressure ID for fix modify does not exist");
+    if (icompute < 0) error->all(FLERR,"Pressure ID for fix modify does not exist");
     modify->compute[icompute]->reset_extra_compute_fix(id_temp);
 
     return 2;
 
   } else if (strcmp(arg[0],"press") == 0) {
-    if (narg < 2) error->all("Illegal fix_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
     if (pflag) {
       modify->delete_compute(id_press);
       pflag = 0;
@@ -719,11 +716,11 @@ int FixBoxRelax::modify_param(int narg, char **arg)
     strcpy(id_press,arg[1]);
 
     int icompute = modify->find_compute(arg[1]);
-    if (icompute < 0) error->all("Could not find fix_modify pressure ID");
+    if (icompute < 0) error->all(FLERR,"Could not find fix_modify pressure ID");
     pressure = modify->compute[icompute];
 
     if (pressure->pressflag == 0)
-      error->all("Fix_modify pressure ID does not compute pressure");
+      error->all(FLERR,"Fix_modify pressure ID does not compute pressure");
     return 2;
   }
   return 0;
diff --git a/src/fix_deform.cpp b/src/fix_deform.cpp
index 75db867299f6620d1c9f5b8d103a835bda0d17f9..039bba40b233d7a40bf2d16c51616b969ba64d1f 100644
--- a/src/fix_deform.cpp
+++ b/src/fix_deform.cpp
@@ -43,13 +43,13 @@ enum{NO_REMAP,X_REMAP,V_REMAP};
 
 FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
 {
-  if (narg < 4) error->all("Illegal fix deform command");
+  if (narg < 4) error->all(FLERR,"Illegal fix deform command");
 
   box_change = 1;
   no_change_box = 1;
 
   nevery = atoi(arg[3]);
-  if (nevery <= 0) error->all("Illegal fix deform command");
+  if (nevery <= 0) error->all(FLERR,"Illegal fix deform command");
 
   // set defaults
 
@@ -72,36 +72,36 @@ FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       else if (strcmp(arg[iarg],"y") == 0) index = 1;
       else if (strcmp(arg[iarg],"z") == 0) index = 2;
 
-      if (iarg+2 > narg) error->all("Illegal fix deform command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix deform command");
       if (strcmp(arg[iarg+1],"final") == 0) {
-	if (iarg+4 > narg) error->all("Illegal fix deform command");
+	if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command");
 	set[index].style = FINAL;
 	set[index].flo = atof(arg[iarg+2]);
 	set[index].fhi = atof(arg[iarg+3]);
 	iarg += 4;
       } else if (strcmp(arg[iarg+1],"delta") == 0) {
-	if (iarg+4 > narg) error->all("Illegal fix deform command");
+	if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command");
 	set[index].style = DELTA;
 	set[index].dlo = atof(arg[iarg+2]);
 	set[index].dhi = atof(arg[iarg+3]);
 	iarg += 4;
       } else if (strcmp(arg[iarg+1],"scale") == 0) {
-	if (iarg+3 > narg) error->all("Illegal fix deform command");
+	if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
 	set[index].style = SCALE;
 	set[index].scale = atof(arg[iarg+2]);
 	iarg += 3;
       } else if (strcmp(arg[iarg+1],"vel") == 0) {
-	if (iarg+3 > narg) error->all("Illegal fix deform command");
+	if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
 	set[index].style = VEL;
 	set[index].vel = atof(arg[iarg+2]);
 	iarg += 3;
       } else if (strcmp(arg[iarg+1],"erate") == 0) {
-	if (iarg+3 > narg) error->all("Illegal fix deform command");
+	if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
 	set[index].style = ERATE;
 	set[index].rate = atof(arg[iarg+2]);
 	iarg += 3;
       } else if (strcmp(arg[iarg+1],"trate") == 0) {
-	if (iarg+3 > narg) error->all("Illegal fix deform command");
+	if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
 	set[index].style = TRATE;
 	set[index].rate = atof(arg[iarg+2]);
 	iarg += 3;
@@ -109,60 +109,60 @@ FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
 	set[index].style = VOLUME;
 	iarg += 2;
       } else if (strcmp(arg[iarg+1],"wiggle") == 0) {
-	if (iarg+4 > narg) error->all("Illegal fix deform command");
+	if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command");
 	set[index].style = WIGGLE;
 	set[index].amplitude = atof(arg[iarg+2]);
 	set[index].tperiod = atof(arg[iarg+3]);
 	if (set[index].tperiod <= 0.0) 
-	  error->all("Illegal fix deform command");
+	  error->all(FLERR,"Illegal fix deform command");
 	iarg += 4;
-      } else error->all("Illegal fix deform command");
+      } else error->all(FLERR,"Illegal fix deform command");
       
     } else if (strcmp(arg[iarg],"xy") == 0 || 
 	       strcmp(arg[iarg],"xz") == 0 ||
 	       strcmp(arg[iarg],"yz") == 0) {
 
       if (triclinic == 0)
-	error->all("Fix deform tilt factors require triclinic box");
+	error->all(FLERR,"Fix deform tilt factors require triclinic box");
       if (strcmp(arg[iarg],"xy") == 0) index = 5;
       else if (strcmp(arg[iarg],"xz") == 0) index = 4;
       else if (strcmp(arg[iarg],"yz") == 0) index = 3;
 
-      if (iarg+2 > narg) error->all("Illegal fix deform command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix deform command");
       if (strcmp(arg[iarg+1],"final") == 0) {
-	if (iarg+3 > narg) error->all("Illegal fix deform command");
+	if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
 	set[index].style = FINAL;
 	set[index].ftilt = atof(arg[iarg+2]);
 	iarg += 3;
       } else if (strcmp(arg[iarg+1],"delta") == 0) {
-	if (iarg+3 > narg) error->all("Illegal fix deform command");
+	if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
 	set[index].style = DELTA;
 	set[index].dtilt = atof(arg[iarg+2]);
 	iarg += 3;
       } else if (strcmp(arg[iarg+1],"vel") == 0) {
-	if (iarg+3 > narg) error->all("Illegal fix deform command");
+	if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
 	set[index].style = VEL;
 	set[index].vel = atof(arg[iarg+2]);
 	iarg += 3;
       } else if (strcmp(arg[iarg+1],"erate") == 0) {
-	if (iarg+3 > narg) error->all("Illegal fix deform command");
+	if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
 	set[index].style = ERATE;
 	set[index].rate = atof(arg[iarg+2]);
 	iarg += 3;
       } else if (strcmp(arg[iarg+1],"trate") == 0) {
-	if (iarg+3 > narg) error->all("Illegal fix deform command");
+	if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
 	set[index].style = TRATE;
 	set[index].rate = atof(arg[iarg+2]);
 	iarg += 3;
       } else if (strcmp(arg[iarg+1],"wiggle") == 0) {
-	if (iarg+4 > narg) error->all("Illegal fix deform command");
+	if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command");
 	set[index].style = WIGGLE;
 	set[index].amplitude = atof(arg[iarg+2]);
 	set[index].tperiod = atof(arg[iarg+3]);
 	if (set[index].tperiod <= 0.0) 
-	  error->all("Illegal fix deform command");
+	  error->all(FLERR,"Illegal fix deform command");
 	iarg += 4;
-      } else error->all("Illegal fix deform command");
+      } else error->all(FLERR,"Illegal fix deform command");
 
     } else break;
   }
@@ -187,14 +187,14 @@ FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
   if ((set[0].style && domain->xperiodic == 0) ||
       (set[1].style && domain->yperiodic == 0) ||
       (set[2].style && domain->zperiodic == 0))
-    error->all("Cannot use fix deform on a non-periodic boundary");
+    error->all(FLERR,"Cannot use fix deform on a non-periodic boundary");
 
   if (set[3].style && domain->zperiodic == 0)
-    error->all("Cannot use fix deform on a 2nd non-periodic boundary");
+    error->all(FLERR,"Cannot use fix deform on a 2nd non-periodic boundary");
   if (set[4].style && domain->zperiodic == 0)
-    error->all("Cannot use fix deform on a 2nd non-periodic boundary");
+    error->all(FLERR,"Cannot use fix deform on a 2nd non-periodic boundary");
   if (set[5].style && domain->yperiodic == 0)
-    error->all("Cannot use fix deform on a 2nd non-periodic boundary");
+    error->all(FLERR,"Cannot use fix deform on a 2nd non-periodic boundary");
 
   // apply scaling to FINAL,DELTA,VEL,WIGGLE since they have distance/vel units
 
@@ -204,7 +204,7 @@ FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
 	set[i].style == VEL || set[i].style == WIGGLE) flag = 1;
 
   if (flag && scaleflag && domain->lattice == NULL)
-    error->all("Use of fix deform with undefined lattice");
+    error->all(FLERR,"Use of fix deform with undefined lattice");
 
   double xscale,yscale,zscale;
   if (flag && scaleflag) {
@@ -251,25 +251,25 @@ FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
 
     if (set[other1].style == NONE) {
       if (set[other2].style == NONE || set[other2].style == VOLUME)
-	error->all("Fix deform volume setting is invalid");
+	error->all(FLERR,"Fix deform volume setting is invalid");
       set[i].substyle = ONE_FROM_ONE;
       set[i].fixed = other1;
       set[i].dynamic1 = other2;
     } else if (set[other2].style == NONE) {
       if (set[other1].style == NONE || set[other1].style == VOLUME)
-	error->all("Fix deform volume setting is invalid");
+	error->all(FLERR,"Fix deform volume setting is invalid");
       set[i].substyle = ONE_FROM_ONE;
       set[i].fixed = other2;
       set[i].dynamic1 = other1;
     } else if (set[other1].style == VOLUME) {
       if (set[other2].style == NONE || set[other2].style == VOLUME)
-	error->all("Fix deform volume setting is invalid");
+	error->all(FLERR,"Fix deform volume setting is invalid");
       set[i].substyle = TWO_FROM_ONE;
       set[i].fixed = other1;
       set[i].dynamic1 = other2;
     } else if (set[other2].style == VOLUME) {
       if (set[other1].style == NONE || set[other1].style == VOLUME)
-	error->all("Fix deform volume setting is invalid");
+	error->all(FLERR,"Fix deform volume setting is invalid");
       set[i].substyle = TWO_FROM_ONE;
       set[i].fixed = other2;
       set[i].dynamic1 = other1;
@@ -347,7 +347,7 @@ void FixDeform::init()
   int count = 0;
   for (int i = 0; i < modify->nfix; i++)
     if (strcmp(modify->fix[i]->style,"deform") == 0) count++;
-  if (count > 1) error->all("More than one fix deform");
+  if (count > 1) error->all(FLERR,"More than one fix deform");
 
   // Kspace setting
 
@@ -395,7 +395,7 @@ void FixDeform::init()
       set[i].hi_stop = set[i].hi_start + 
 	0.5*delt*set[i].rate * (set[i].hi_start-set[i].lo_start);
       if (set[i].hi_stop <= set[i].lo_stop)
-	error->all("Final box dimension due to fix deform is < 0.0");
+	error->all(FLERR,"Final box dimension due to fix deform is < 0.0");
     } else if (set[i].style == TRATE) {
       set[i].lo_stop = 0.5*(set[i].lo_start+set[i].hi_start) - 
 	0.5*((set[i].hi_start-set[i].lo_start) * exp(set[i].rate*delt));
@@ -477,7 +477,7 @@ void FixDeform::init()
 
   for (int i = 3; i < 6; i++)
     if (set[i].style == TRATE && set[i].tilt_start == 0.0)
-      error->all("Cannot use fix deform trate on a box with zero tilt");
+      error->all(FLERR,"Cannot use fix deform trate on a box with zero tilt");
 
   // if yz changes and will cause box flip, then xy cannot be changing
   // test for WIGGLE is on min/max oscillation limit, not tilt_stop
@@ -499,7 +499,7 @@ void FixDeform::init()
 	  hi > 0.5*(set[1].hi_stop-set[1].lo_stop)) flag = 1;
     }
     if (flag)
-      error->all("Fix deform is changing yz by too much with changing xy");
+      error->all(FLERR,"Fix deform is changing yz by too much with changing xy");
   }
 
   // set domain->h_rate values for use by domain and other fixes/computes
@@ -823,7 +823,7 @@ void FixDeform::end_of_step()
 
 void FixDeform::options(int narg, char **arg)
 {
-  if (narg < 0) error->all("Illegal fix deform command");
+  if (narg < 0) error->all(FLERR,"Illegal fix deform command");
 
   remapflag = X_REMAP;
   scaleflag = 1;
@@ -831,18 +831,18 @@ void FixDeform::options(int narg, char **arg)
   int iarg = 0;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"remap") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix deform command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix deform command");
       if (strcmp(arg[iarg+1],"x") == 0) remapflag = X_REMAP;
       else if (strcmp(arg[iarg+1],"v") == 0) remapflag = V_REMAP;
       else if (strcmp(arg[iarg+1],"none") == 0) remapflag = NO_REMAP;
-      else error->all("Illegal fix deform command");
+      else error->all(FLERR,"Illegal fix deform command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"units") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix deform command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix deform command");
       if (strcmp(arg[iarg+1],"box") == 0) scaleflag = 0;
       else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1;
-      else error->all("Illegal fix deform command");
+      else error->all(FLERR,"Illegal fix deform command");
       iarg += 2;
-    } else error->all("Illegal fix deform command");
+    } else error->all(FLERR,"Illegal fix deform command");
   }
 }
diff --git a/src/fix_deposit.cpp b/src/fix_deposit.cpp
index 357a325942ba53e856a773812a76fac99abcf106..214856ce3743161db07293d9c9ee3b2d314f3645 100644
--- a/src/fix_deposit.cpp
+++ b/src/fix_deposit.cpp
@@ -36,7 +36,7 @@ using namespace LAMMPS_NS;
 FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 7) error->all("Illegal fix deposit command");
+  if (narg < 7) error->all(FLERR,"Illegal fix deposit command");
 
   restart_global = 1;
   time_depend = 1;
@@ -48,7 +48,7 @@ FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) :
   nfreq = atoi(arg[5]);
   seed = atoi(arg[6]);
 
-  if (seed <= 0) error->all("Illegal fix deposit command");
+  if (seed <= 0) error->all(FLERR,"Illegal fix deposit command");
 
   // set defaults
 
@@ -68,11 +68,11 @@ FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) :
 
   // error checks on region and its extent being inside simulation box
 
-  if (iregion == -1) error->all("Must specify a region in fix deposit");
+  if (iregion == -1) error->all(FLERR,"Must specify a region in fix deposit");
   if (domain->regions[iregion]->bboxflag == 0)
-    error->all("Fix deposit region does not support a bounding box");
+    error->all(FLERR,"Fix deposit region does not support a bounding box");
   if (domain->regions[iregion]->dynamic_check())
-    error->all("Fix deposit region cannot be dynamic");
+    error->all(FLERR,"Fix deposit region cannot be dynamic");
 
   xlo = domain->regions[iregion]->extent_xlo;
   xhi = domain->regions[iregion]->extent_xhi;
@@ -85,18 +85,18 @@ FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) :
     if (xlo < domain->boxlo[0] || xhi > domain->boxhi[0] || 
 	ylo < domain->boxlo[1] || yhi > domain->boxhi[1] || 
 	zlo < domain->boxlo[2] || zhi > domain->boxhi[2])
-      error->all("Deposition region extends outside simulation box");
+      error->all(FLERR,"Deposition region extends outside simulation box");
   } else {
     if (xlo < domain->boxlo_bound[0] || xhi > domain->boxhi_bound[0] || 
 	ylo < domain->boxlo_bound[1] || yhi > domain->boxhi_bound[1] || 
 	zlo < domain->boxlo_bound[2] || zhi > domain->boxhi_bound[2])
-      error->all("Deposition region extends outside simulation box");
+      error->all(FLERR,"Deposition region extends outside simulation box");
   }
 
   // setup scaling
 
   if (scaleflag && domain->lattice == NULL)
-    error->all("Use of fix deposit with undefined lattice");
+    error->all(FLERR,"Use of fix deposit with undefined lattice");
 
   double xscale,yscale,zscale;
   if (scaleflag) {
@@ -162,7 +162,7 @@ void FixDeposit::init()
   // set index and check validity of region
 
   iregion = domain->find_region(idregion);
-  if (iregion == -1) error->all("Region ID for fix deposit does not exist");
+  if (iregion == -1) error->all(FLERR,"Region ID for fix deposit does not exist");
 }
 
 /* ----------------------------------------------------------------------
@@ -323,7 +323,7 @@ void FixDeposit::pre_exchange()
   // warn if not successful b/c too many attempts or no proc owned particle
 
   if (!success && comm->me == 0)
-    error->warning("Particle deposition was unsuccessful",0);
+    error->warning(FLERR,"Particle deposition was unsuccessful",0);
 
   // reset global natoms
   // set tag # of new particle beyond all previous atoms
@@ -356,28 +356,28 @@ void FixDeposit::pre_exchange()
 
 void FixDeposit::options(int narg, char **arg)
 {
-  if (narg < 0) error->all("Illegal fix indent command");
+  if (narg < 0) error->all(FLERR,"Illegal fix indent command");
 
   int iarg = 0;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"region") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix deposit command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix deposit command");
       iregion = domain->find_region(arg[iarg+1]);
       if (iregion == -1)
-	error->all("Region ID for fix deposit does not exist");
+	error->all(FLERR,"Region ID for fix deposit does not exist");
       int n = strlen(arg[iarg+1]) + 1;
       idregion = new char[n];
       strcpy(idregion,arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"global") == 0) {
-      if (iarg+3 > narg) error->all("Illegal fix deposit command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal fix deposit command");
       globalflag = 1;
       localflag = 0;
       lo = atof(arg[iarg+1]);
       hi = atof(arg[iarg+2]);
       iarg += 3;
     } else if (strcmp(arg[iarg],"local") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix deposit command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix deposit command");
       localflag = 1;
       globalflag = 0;
       lo = atof(arg[iarg+1]);
@@ -385,40 +385,40 @@ void FixDeposit::options(int narg, char **arg)
       deltasq = atof(arg[iarg+3])*atof(arg[iarg+3]);
       iarg += 4;
     } else if (strcmp(arg[iarg],"near") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix deposit command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix deposit command");
       nearsq = atof(arg[iarg+1])*atof(arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"attempt") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix deposit command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix deposit command");
       maxattempt = atoi(arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"rate") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix deposit command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix deposit command");
       rateflag = 1;
       rate = atof(arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"vx") == 0) {
-      if (iarg+3 > narg) error->all("Illegal fix deposit command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal fix deposit command");
       vxlo = atof(arg[iarg+1]);
       vxhi = atof(arg[iarg+2]);
       iarg += 3;
     } else if (strcmp(arg[iarg],"vy") == 0) {
-      if (iarg+3 > narg) error->all("Illegal fix deposit command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal fix deposit command");
       vylo = atof(arg[iarg+1]);
       vyhi = atof(arg[iarg+2]);
       iarg += 3;
     } else if (strcmp(arg[iarg],"vz") == 0) {
-      if (iarg+3 > narg) error->all("Illegal fix deposit command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal fix deposit command");
       vzlo = atof(arg[iarg+1]);
       vzhi = atof(arg[iarg+2]);
       iarg += 3;
     } else if (strcmp(arg[iarg],"units") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix deposit command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix deposit command");
       if (strcmp(arg[iarg+1],"box") == 0) scaleflag = 0;
       else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1;
-      else error->all("Illegal fix deposit command");
+      else error->all(FLERR,"Illegal fix deposit command");
       iarg += 2;
-    } else error->all("Illegal fix deposit command");
+    } else error->all(FLERR,"Illegal fix deposit command");
   }
 }
 
diff --git a/src/fix_drag.cpp b/src/fix_drag.cpp
index 357495bd679e81c58dfdcbeb0bedd1bf290aff83..51e744aadaf8334ccbd9f237f476b0d06c5e65a7 100644
--- a/src/fix_drag.cpp
+++ b/src/fix_drag.cpp
@@ -28,7 +28,7 @@ using namespace LAMMPS_NS;
 FixDrag::FixDrag(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg != 8) error->all("Illegal fix drag command");
+  if (narg != 8) error->all(FLERR,"Illegal fix drag command");
 
   vector_flag = 1;
   size_vector = 3;
diff --git a/src/fix_dt_reset.cpp b/src/fix_dt_reset.cpp
index 8991a879e5f11b96a1c9e2982e3c6d20f9eac1aa..758c8b32a55904485f99d156f1f3bb241e5f08a1 100644
--- a/src/fix_dt_reset.cpp
+++ b/src/fix_dt_reset.cpp
@@ -33,15 +33,12 @@ using namespace LAMMPS_NS;
 
 #define BIG 1.0e20
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 FixDtReset::FixDtReset(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 7) error->all("Illegal fix dt/reset command");
+  if (narg < 7) error->all(FLERR,"Illegal fix dt/reset command");
 
   time_depend = 1;
   scalar_flag = 1;
@@ -52,7 +49,7 @@ FixDtReset::FixDtReset(LAMMPS *lmp, int narg, char **arg) :
   extvector = 0;
 
   nevery = atoi(arg[3]);
-  if (nevery <= 0) error->all("Illegal fix dt/reset command");
+  if (nevery <= 0) error->all(FLERR,"Illegal fix dt/reset command");
 
   minbound = maxbound = 1;
   tmin = tmax = 0.0;
@@ -62,29 +59,29 @@ FixDtReset::FixDtReset(LAMMPS *lmp, int narg, char **arg) :
   else tmax = atof(arg[5]);
   xmax = atof(arg[6]);
 
-  if (minbound && tmin < 0.0) error->all("Illegal fix dt/reset command");
-  if (maxbound && tmax < 0.0) error->all("Illegal fix dt/reset command");
+  if (minbound && tmin < 0.0) error->all(FLERR,"Illegal fix dt/reset command");
+  if (maxbound && tmax < 0.0) error->all(FLERR,"Illegal fix dt/reset command");
   if (minbound && maxbound && tmin >= tmax)
-    error->all("Illegal fix dt/reset command");
-  if (xmax <= 0.0) error->all("Illegal fix dt/reset command");
+    error->all(FLERR,"Illegal fix dt/reset command");
+  if (xmax <= 0.0) error->all(FLERR,"Illegal fix dt/reset command");
 
   int scaleflag = 1;
 
   int iarg = 7;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"units") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix dt/reset command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix dt/reset command");
       if (strcmp(arg[iarg+1],"box") == 0) scaleflag = 0;
       else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1;
-      else error->all("Illegal fix dt/reset command");
+      else error->all(FLERR,"Illegal fix dt/reset command");
       iarg += 2;
-    } else error->all("Illegal fix dt/reset command");
+    } else error->all(FLERR,"Illegal fix dt/reset command");
   }
 
   // setup scaling, based on xlattice parameter
 
   if (scaleflag && domain->lattice == NULL)
-    error->all("Use of fix dt/reset with undefined lattice");
+    error->all(FLERR,"Use of fix dt/reset with undefined lattice");
   if (scaleflag) xmax *= domain->lattice->xlattice;
 
   // initializations
@@ -116,7 +113,7 @@ void FixDtReset::init()
   for (int i = 0; i < output->ndump; i++)
     if ((strcmp(output->dump[i]->style,"dcd") == 0 ||
 	strcmp(output->dump[i]->style,"xtc") == 0) && comm->me == 0)
-      error->warning("Dump dcd/xtc timestamp may be wrong with fix dt/reset");
+      error->warning(FLERR,"Dump dcd/xtc timestamp may be wrong with fix dt/reset");
 
   ftm2v = force->ftm2v;
 }
diff --git a/src/fix_efield.cpp b/src/fix_efield.cpp
index 31c7ba147a50a5f21078bacf207a43a9ba6cd55d..42bc2efc94f754460febff9ec70588478da29f19 100644
--- a/src/fix_efield.cpp
+++ b/src/fix_efield.cpp
@@ -38,7 +38,7 @@ enum{CONSTANT,EQUAL,ATOM};
 FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg != 6) error->all("Illegal fix efield command");
+  if (narg != 6) error->all(FLERR,"Illegal fix efield command");
 
   qe2f = force->qe2f;
   xstr = ystr = zstr = NULL;
@@ -98,30 +98,30 @@ int FixEfield::setmask()
 
 void FixEfield::init()
 {
-  if (!atom->q_flag) error->all("Fix efield requires atom attribute q");
+  if (!atom->q_flag) error->all(FLERR,"Fix efield requires atom attribute q");
 
   // check variables
 
   if (xstr) {
     xvar = input->variable->find(xstr);
-    if (xvar < 0) error->all("Variable name for fix efield does not exist");
+    if (xvar < 0) error->all(FLERR,"Variable name for fix efield does not exist");
     if (input->variable->equalstyle(xvar)) xstyle = EQUAL;
     else if (input->variable->atomstyle(xvar)) xstyle = ATOM;
-    else error->all("Variable for fix efield is invalid style");
+    else error->all(FLERR,"Variable for fix efield is invalid style");
   }
   if (ystr) {
     yvar = input->variable->find(ystr);
-    if (yvar < 0) error->all("Variable name for fix efield does not exist");
+    if (yvar < 0) error->all(FLERR,"Variable name for fix efield does not exist");
     if (input->variable->equalstyle(yvar)) ystyle = EQUAL;
     else if (input->variable->atomstyle(yvar)) ystyle = ATOM;
-    else error->all("Variable for fix efield is invalid style");
+    else error->all(FLERR,"Variable for fix efield is invalid style");
   }
   if (zstr) {
     zvar = input->variable->find(zstr);
-    if (zvar < 0) error->all("Variable name for fix efield does not exist");
+    if (zvar < 0) error->all(FLERR,"Variable name for fix efield does not exist");
     if (input->variable->equalstyle(zvar)) zstyle = EQUAL;
     else if (input->variable->atomstyle(zvar)) zstyle = ATOM;
-    else error->all("Variable for fix efield is invalid style");
+    else error->all(FLERR,"Variable for fix efield is invalid style");
   }
 
   if (xstyle == ATOM || ystyle == ATOM || zstyle == ATOM)
diff --git a/src/fix_enforce2d.cpp b/src/fix_enforce2d.cpp
index c08c1ecdced61fb1de5d3e42eaf5633f18c259ea..ad7ef9f615b9290e980c62624abc53803f5d95c9 100644
--- a/src/fix_enforce2d.cpp
+++ b/src/fix_enforce2d.cpp
@@ -26,7 +26,7 @@ using namespace LAMMPS_NS;
 FixEnforce2D::FixEnforce2D(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Illegal fix enforce2d command");
+  if (narg != 3) error->all(FLERR,"Illegal fix enforce2d command");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -45,7 +45,7 @@ int FixEnforce2D::setmask()
 void FixEnforce2D::init()
 {
   if (domain->dimension == 3)
-    error->all("Cannot use fix enforce2d with 3d simulation");
+    error->all(FLERR,"Cannot use fix enforce2d with 3d simulation");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/fix_evaporate.cpp b/src/fix_evaporate.cpp
index 4e8c779561195aa20cae36008b9fde1a30b220e4..a0446c4675ecd9d3465b7d5f5d32d619212fcd90 100644
--- a/src/fix_evaporate.cpp
+++ b/src/fix_evaporate.cpp
@@ -30,15 +30,12 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 FixEvaporate::FixEvaporate(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 7) error->all("Illegal fix evaporate command");
+  if (narg < 7) error->all(FLERR,"Illegal fix evaporate command");
 
   scalar_flag = 1;
   global_freq = 1;
@@ -52,9 +49,9 @@ FixEvaporate::FixEvaporate(LAMMPS *lmp, int narg, char **arg) :
   strcpy(idregion,arg[5]);
   int seed = atoi(arg[6]);
 
-  if (nevery <= 0 || nflux <= 0) error->all("Illegal fix evaporate command");
-  if (iregion == -1) error->all("Region ID for fix evaporate does not exist");
-  if (seed <= 0) error->all("Illegal fix evaporate command");
+  if (nevery <= 0 || nflux <= 0) error->all(FLERR,"Illegal fix evaporate command");
+  if (iregion == -1) error->all(FLERR,"Region ID for fix evaporate does not exist");
+  if (seed <= 0) error->all(FLERR,"Illegal fix evaporate command");
 
   // random number generator, same for all procs
 
@@ -67,12 +64,12 @@ FixEvaporate::FixEvaporate(LAMMPS *lmp, int narg, char **arg) :
   int iarg = 7;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"molecule") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix evaporate command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix evaporate command");
       if (strcmp(arg[iarg+1],"no") == 0) molflag = 0;
       else if (strcmp(arg[iarg+1],"yes") == 0) molflag = 1;
-      else error->all("Illegal fix evaporate command");
+      else error->all(FLERR,"Illegal fix evaporate command");
       iarg += 2;
-    } else error->all("Illegal fix evaporate command");
+    } else error->all(FLERR,"Illegal fix evaporate command");
   }
 
   // set up reneighboring
@@ -113,7 +110,7 @@ void FixEvaporate::init()
 
   iregion = domain->find_region(idregion);
   if (iregion == -1)
-    error->all("Region ID for fix evaporate does not exist");
+    error->all(FLERR,"Region ID for fix evaporate does not exist");
 
   // check that no deletable atoms are in atom->firstgroup
   // deleting such an atom would not leave firstgroup atoms first
@@ -131,7 +128,7 @@ void FixEvaporate::init()
     MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
 
     if (flagall)
-      error->all("Cannot evaporate atoms in atom_modify first group");
+      error->all(FLERR,"Cannot evaporate atoms in atom_modify first group");
   }
 
   // if molflag not set, warn if any deletable atom has a mol ID
@@ -147,12 +144,12 @@ void FixEvaporate::init()
     int flagall;
     MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
     if (flagall && comm->me == 0)
-      error->
-	warning("Fix evaporate may delete atom with non-zero molecule ID");
+      error->warning(FLERR,
+		     "Fix evaporate may delete atom with non-zero molecule ID");
   }
 
   if (molflag && atom->molecule_flag == 0)
-      error->all("Fix evaporate molecule requires atom attribute molecule");
+      error->all(FLERR,"Fix evaporate molecule requires atom attribute molecule");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/fix_external.cpp b/src/fix_external.cpp
index 449a6d07c990ba4401618a57757bf062a2e0fe11..dd92847cf0df77f4ce9ca58c83ddfbebb42737bc 100644
--- a/src/fix_external.cpp
+++ b/src/fix_external.cpp
@@ -26,7 +26,7 @@ using namespace LAMMPS_NS;
 FixExternal::FixExternal(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Illegal fix external command");
+  if (narg != 3) error->all(FLERR,"Illegal fix external command");
 
   callback = NULL;
 
@@ -55,7 +55,7 @@ int FixExternal::setmask()
 
 void FixExternal::init()
 {
-  if (callback == NULL) error->all("Fix external callback function not set");
+  if (callback == NULL) error->all(FLERR,"Fix external callback function not set");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/fix_gravity.cpp b/src/fix_gravity.cpp
index e3d2ae8ead1020aef3a51f59bd82a74b3fc07e2b..09a2e2c7f152fd5baf80fb54d4bf92aba92eba95 100644
--- a/src/fix_gravity.cpp
+++ b/src/fix_gravity.cpp
@@ -31,7 +31,7 @@ enum{CHUTE,SPHERICAL,GRADIENT,VECTOR};
 FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 5) error->all("Illegal fix gravity command");
+  if (narg < 5) error->all(FLERR,"Illegal fix gravity command");
 
   time_depend = 1;
   scalar_flag = 1;
@@ -41,29 +41,29 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) :
   magnitude = atof(arg[3]);
 
   if (strcmp(arg[4],"chute") == 0) {
-    if (narg != 6) error->all("Illegal fix gravity command");
+    if (narg != 6) error->all(FLERR,"Illegal fix gravity command");
     style = CHUTE;
     phi = 0.0;
     theta = 180.0 - atof(arg[5]);
   } else if (strcmp(arg[4],"spherical") == 0) {
-    if (narg != 7) error->all("Illegal fix gravity command");
+    if (narg != 7) error->all(FLERR,"Illegal fix gravity command");
     style = SPHERICAL;
     phi = atof(arg[5]);
     theta = atof(arg[6]);
   } else if (strcmp(arg[4],"gradient") == 0) {
-    if (narg != 9) error->all("Illegal fix gravity command");
+    if (narg != 9) error->all(FLERR,"Illegal fix gravity command");
     style = GRADIENT;
     phi = atof(arg[5]);
     theta = atof(arg[6]);
     phigrad = atof(arg[7]);
     thetagrad = atof(arg[8]);
   } else if (strcmp(arg[4],"vector") == 0) {
-    if (narg != 8) error->all("Illegal fix gravity command");
+    if (narg != 8) error->all(FLERR,"Illegal fix gravity command");
     style = VECTOR;
     xdir = atof(arg[5]);
     ydir = atof(arg[6]);
     zdir = atof(arg[7]);
-  } else error->all("Illegal fix gravity command");
+  } else error->all(FLERR,"Illegal fix gravity command");
 
   double PI = 4.0*atan(1.0);
   degree2rad = PI/180.0;
diff --git a/src/fix_heat.cpp b/src/fix_heat.cpp
index 450d0bb8413ead8fad7e21b497e37927dc3236f3..45bd030cc23e52dbeae3f94769fe44044584da2e 100644
--- a/src/fix_heat.cpp
+++ b/src/fix_heat.cpp
@@ -33,14 +33,14 @@ using namespace LAMMPS_NS;
 
 FixHeat::FixHeat(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
 {
-  if (narg < 4) error->all("Illegal fix heat command");
+  if (narg < 4) error->all(FLERR,"Illegal fix heat command");
 
   scalar_flag = 1;
   global_freq = 1;
   extscalar = 0;
 
   nevery = atoi(arg[3]);
-  if (nevery <= 0) error->all("Illegal fix heat command");
+  if (nevery <= 0) error->all(FLERR,"Illegal fix heat command");
 
   heat_input = atof(arg[4]);
 
@@ -52,14 +52,14 @@ FixHeat::FixHeat(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
   int iarg = 5;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"region") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix heat command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix heat command");
       iregion = domain->find_region(arg[iarg+1]);
-      if (iregion == -1) error->all("Region ID for fix heat does not exist");
+      if (iregion == -1) error->all(FLERR,"Region ID for fix heat does not exist");
       int n = strlen(arg[iarg+1]) + 1;
       idregion = new char[n];
       strcpy(idregion,arg[iarg+1]);
       iarg += 2;
-    } else error->all("Illegal fix heat command");
+    } else error->all(FLERR,"Illegal fix heat command");
   }
 
   scale = 1.0;
@@ -89,12 +89,12 @@ void FixHeat::init()
 
   if (iregion >= 0) {
     iregion = domain->find_region(idregion);
-    if (iregion == -1) error->all("Region ID for fix heat does not exist");
+    if (iregion == -1) error->all(FLERR,"Region ID for fix heat does not exist");
   }
 
   // cannot have 0 atoms in group
 
-  if (group->count(igroup) == 0) error->all("Fix heat group has no atoms");
+  if (group->count(igroup) == 0) error->all(FLERR,"Fix heat group has no atoms");
   masstotal = group->mass(igroup);
 }
 
@@ -113,7 +113,7 @@ void FixHeat::end_of_step()
     group->vcm(igroup,masstotal,vcm);
   } else {
     masstotal = group->mass(igroup,iregion);
-    if (masstotal == 0.0) error->all("Fix heat group has no atoms");
+    if (masstotal == 0.0) error->all(FLERR,"Fix heat group has no atoms");
     heat = heat_input*nevery*update->dt*force->ftm2v;
     ke = group->ke(igroup,iregion)*force->ftm2v;
     group->vcm(igroup,masstotal,vcm,iregion);
@@ -121,7 +121,7 @@ void FixHeat::end_of_step()
 
   double vcmsq = vcm[0]*vcm[0] + vcm[1]*vcm[1] + vcm[2]*vcm[2];
   double escale = (ke + heat - 0.5*vcmsq*masstotal)/(ke - 0.5*vcmsq*masstotal);
-  if (escale < 0.0) error->all("Fix heat kinetic energy went negative");
+  if (escale < 0.0) error->all(FLERR,"Fix heat kinetic energy went negative");
   scale = sqrt(escale);
 
   vsub[0] = (scale-1.0) * vcm[0];
diff --git a/src/fix_indent.cpp b/src/fix_indent.cpp
index dd6f7490ee19416224aa94e50cfbc20f96e78f10..48f72ac0487c648c1abd387fbf8c68f0335778ff 100644
--- a/src/fix_indent.cpp
+++ b/src/fix_indent.cpp
@@ -40,7 +40,7 @@ enum{INSIDE,OUTSIDE};
 FixIndent::FixIndent(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 4) error->all("Illegal fix indent command");
+  if (narg < 4) error->all(FLERR,"Illegal fix indent command");
 
   scalar_flag = 1;
   vector_flag = 1;
@@ -59,7 +59,7 @@ FixIndent::FixIndent(LAMMPS *lmp, int narg, char **arg) :
   // setup scaling
 
   if (scaleflag && domain->lattice == NULL)
-    error->all("Use of fix indent with undefined lattice");
+    error->all(FLERR,"Use of fix indent with undefined lattice");
 
   double xscale,yscale,zscale;
   if (scaleflag) {
@@ -80,7 +80,7 @@ FixIndent::FixIndent(LAMMPS *lmp, int narg, char **arg) :
     if (cdim == 0 && !pstr) pvalue *= xscale;
     else if (cdim == 1 && !pstr) pvalue *= yscale;
     else if (cdim == 2 && !pstr) pvalue *= zscale;
-  } else error->all("Illegal fix indent command");
+  } else error->all(FLERR,"Illegal fix indent command");
 
   varflag = 0;
   if (xstr || ystr || zstr || rstr || pstr) varflag = 1;
@@ -118,33 +118,33 @@ void FixIndent::init()
 {
   if (xstr) {
     xvar = input->variable->find(xstr);
-    if (xvar < 0) error->all("Variable name for fix indent does not exist");
+    if (xvar < 0) error->all(FLERR,"Variable name for fix indent does not exist");
     if (!input->variable->equalstyle(xvar))
-      error->all("Variable for fix indent is invalid style");
+      error->all(FLERR,"Variable for fix indent is invalid style");
   }
   if (ystr) {
     yvar = input->variable->find(ystr);
-    if (yvar < 0) error->all("Variable name for fix indent does not exist");
+    if (yvar < 0) error->all(FLERR,"Variable name for fix indent does not exist");
     if (!input->variable->equalstyle(yvar))
-      error->all("Variable for fix indent is not equal style");
+      error->all(FLERR,"Variable for fix indent is not equal style");
   }
   if (zstr) {
     zvar = input->variable->find(zstr);
-    if (zvar < 0) error->all("Variable name for fix indent does not exist");
+    if (zvar < 0) error->all(FLERR,"Variable name for fix indent does not exist");
     if (!input->variable->equalstyle(zvar))
-      error->all("Variable for fix indent is not equal style");
+      error->all(FLERR,"Variable for fix indent is not equal style");
   }
   if (rstr) {
     rvar = input->variable->find(rstr);
-    if (rvar < 0) error->all("Variable name for fix indent does not exist");
+    if (rvar < 0) error->all(FLERR,"Variable name for fix indent does not exist");
     if (!input->variable->equalstyle(rvar))
-      error->all("Variable for fix indent is not equal style");
+      error->all(FLERR,"Variable for fix indent is not equal style");
   }
   if (pstr) {
     pvar = input->variable->find(pstr);
-    if (pvar < 0) error->all("Variable name for fix indent does not exist");
+    if (pvar < 0) error->all(FLERR,"Variable name for fix indent does not exist");
     if (!input->variable->equalstyle(pvar))
-      error->all("Variable for fix indent is not equal style");
+      error->all(FLERR,"Variable for fix indent is not equal style");
   }
 
   if (strstr(update->integrate_style,"respa"))
@@ -396,7 +396,7 @@ double FixIndent::compute_vector(int n)
 
 void FixIndent::options(int narg, char **arg)
 {
-  if (narg < 0) error->all("Illegal fix indent command");
+  if (narg < 0) error->all(FLERR,"Illegal fix indent command");
 
   istyle = NONE;
   xstr = ystr = zstr = rstr = pstr = NULL;
@@ -407,7 +407,7 @@ void FixIndent::options(int narg, char **arg)
   int iarg = 0;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"sphere") == 0) {
-      if (iarg+5 > narg) error->all("Illegal fix indent command");
+      if (iarg+5 > narg) error->all(FLERR,"Illegal fix indent command");
 
       if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
 	int n = strlen(&arg[iarg+1][2]) + 1;
@@ -434,7 +434,7 @@ void FixIndent::options(int narg, char **arg)
       iarg += 5;
 
     } else if (strcmp(arg[iarg],"cylinder") == 0) {
-      if (iarg+5 > narg) error->all("Illegal fix indent command");
+      if (iarg+5 > narg) error->all(FLERR,"Illegal fix indent command");
 
       if (strcmp(arg[iarg+1],"x") == 0) {
 	cdim = 0;
@@ -472,7 +472,7 @@ void FixIndent::options(int narg, char **arg)
 	  ystr = new char[n];
 	  strcpy(ystr,&arg[iarg+3][2]);
 	} else yvalue = atof(arg[iarg+3]);
-      } else error->all("Illegal fix indent command");
+      } else error->all(FLERR,"Illegal fix indent command");
 
       if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) {
 	int n = strlen(&arg[iarg+4][2]) + 1;
@@ -484,11 +484,11 @@ void FixIndent::options(int narg, char **arg)
       iarg += 5;
 
     } else if (strcmp(arg[iarg],"plane") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix indent command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix indent command");
       if (strcmp(arg[iarg+1],"x") == 0) cdim = 0;
       else if (strcmp(arg[iarg+1],"y") == 0) cdim = 1;
       else if (strcmp(arg[iarg+1],"z") == 0) cdim = 2;
-      else error->all("Illegal fix indent command");
+      else error->all(FLERR,"Illegal fix indent command");
 
       if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
 	int n = strlen(&arg[iarg+2][2]) + 1;
@@ -498,23 +498,23 @@ void FixIndent::options(int narg, char **arg)
 
       if (strcmp(arg[iarg+3],"lo") == 0) planeside = -1;
       else if (strcmp(arg[iarg+3],"hi") == 0) planeside = 1;
-      else error->all("Illegal fix indent command");
+      else error->all(FLERR,"Illegal fix indent command");
       istyle = PLANE;
       iarg += 4;
 
     } else if (strcmp(arg[iarg],"units") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix indent command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix indent command");
       if (strcmp(arg[iarg+1],"box") == 0) scaleflag = 0;
       else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1;
-      else error->all("Illegal fix indent command");
+      else error->all(FLERR,"Illegal fix indent command");
       iarg += 2;
 
     } else if (strcmp(arg[iarg],"side") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix indent command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix indent command");
       if (strcmp(arg[iarg+1],"in") == 0) side = INSIDE;
       else if (strcmp(arg[iarg+1],"out") == 0) side = OUTSIDE;
-      else error->all("Illegal fix indent command");
+      else error->all(FLERR,"Illegal fix indent command");
       iarg += 2;
-    } else error->all("Illegal fix indent command");
+    } else error->all(FLERR,"Illegal fix indent command");
   }
 }
diff --git a/src/fix_langevin.cpp b/src/fix_langevin.cpp
index e887928993a3d527d424dd06494c388b591148b3..d7683d7dee62968bce50a96eaad73a20941c8a08 100644
--- a/src/fix_langevin.cpp
+++ b/src/fix_langevin.cpp
@@ -48,7 +48,7 @@ enum{NOBIAS,BIAS};
 FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 7) error->all("Illegal fix langevin command");
+  if (narg < 7) error->all(FLERR,"Illegal fix langevin command");
 
   scalar_flag = 1;
   global_freq = 1;
@@ -60,8 +60,8 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) :
   t_period = atof(arg[5]);
   int seed = atoi(arg[6]);
 
-  if (t_period <= 0.0) error->all("Fix langevin period must be > 0.0");
-  if (seed <= 0) error->all("Illegal fix langevin command");
+  if (t_period <= 0.0) error->all(FLERR,"Fix langevin period must be > 0.0");
+  if (seed <= 0) error->all(FLERR,"Illegal fix langevin command");
 
   // initialize Marsaglia RNG with processor-unique seed
 
@@ -83,38 +83,38 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) :
   int iarg = 7;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"angmom") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix langevin command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix langevin command");
       if (strcmp(arg[iarg+1],"no") == 0) aflag = 0;
       else if (strcmp(arg[iarg+1],"yes") == 0) aflag = 1;
-      else error->all("Illegal fix langevin command");
+      else error->all(FLERR,"Illegal fix langevin command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"omega") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix langevin command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix langevin command");
       if (strcmp(arg[iarg+1],"no") == 0) oflag = 0;
       else if (strcmp(arg[iarg+1],"yes") == 0) oflag = 1;
-      else error->all("Illegal fix langevin command");
+      else error->all(FLERR,"Illegal fix langevin command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"scale") == 0) {
-      if (iarg+3 > narg) error->all("Illegal fix langevin command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal fix langevin command");
       int itype = atoi(arg[iarg+1]);
       double scale = atof(arg[iarg+2]);
       if (itype <= 0 || itype > atom->ntypes)
-	error->all("Illegal fix langevin command");
+	error->all(FLERR,"Illegal fix langevin command");
       ratio[itype] = scale;
       iarg += 3;
     } else if (strcmp(arg[iarg],"tally") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix langevin command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix langevin command");
       if (strcmp(arg[iarg+1],"no") == 0) tally = 0;
       else if (strcmp(arg[iarg+1],"yes") == 0) tally = 1;
-      else error->all("Illegal fix langevin command");
+      else error->all(FLERR,"Illegal fix langevin command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"zero") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix langevin command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix langevin command");
       if (strcmp(arg[iarg+1],"no") == 0) zeroflag = 0;
       else if (strcmp(arg[iarg+1],"yes") == 0) zeroflag = 1;
-      else error->all("Illegal fix langevin command");
+      else error->all(FLERR,"Illegal fix langevin command");
       iarg += 2;
-    } else error->all("Illegal fix langevin command");
+    } else error->all(FLERR,"Illegal fix langevin command");
   }
 
   // error check
@@ -122,7 +122,7 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) :
   if (aflag) {
     avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
     if (!avec) 
-      error->all("Fix langevin angmom requires atom style ellipsoid");
+      error->all(FLERR,"Fix langevin angmom requires atom style ellipsoid");
   }
 
   // set temperature = NULL, user can override via fix_modify if wants bias
@@ -167,9 +167,9 @@ int FixLangevin::setmask()
 void FixLangevin::init()
 {
   if (oflag && !atom->sphere_flag)
-    error->all("Fix langevin omega require atom style sphere");
+    error->all(FLERR,"Fix langevin omega require atom style sphere");
   if (aflag && !atom->ellipsoid_flag)
-    error->all("Fix langevin angmom require atom style ellipsoid");
+    error->all(FLERR,"Fix langevin angmom require atom style ellipsoid");
 
   // if oflag or aflag set, check that all group particles are finite-size
 
@@ -181,7 +181,7 @@ void FixLangevin::init()
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
 	if (radius[i] == 0.0)
-	  error->one("Fix langevin omega requires extended particles");
+	  error->one(FLERR,"Fix langevin omega requires extended particles");
   }
 
   if (aflag) {
@@ -192,7 +192,7 @@ void FixLangevin::init()
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
 	if (ellipsoid[i] < 0)
-	  error->one("Fix langevin angmom requires extended particles");
+	  error->one(FLERR,"Fix langevin angmom requires extended particles");
   }
 
   // set force prefactors
@@ -283,7 +283,7 @@ void FixLangevin::post_force_no_tally()
   if (zeroflag) {
     count = group->count(igroup);
     if (count == 0)
-      error->all("Cannot zero Langevin force of 0 atoms");
+      error->all(FLERR,"Cannot zero Langevin force of 0 atoms");
   }
   
   if (rmass) {
@@ -656,20 +656,20 @@ void FixLangevin::reset_dt()
 int FixLangevin::modify_param(int narg, char **arg)
 {
   if (strcmp(arg[0],"temp") == 0) {
-    if (narg < 2) error->all("Illegal fix_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
     delete [] id_temp;
     int n = strlen(arg[1]) + 1;
     id_temp = new char[n];
     strcpy(id_temp,arg[1]);
 
     int icompute = modify->find_compute(id_temp);
-    if (icompute < 0) error->all("Could not find fix_modify temperature ID");
+    if (icompute < 0) error->all(FLERR,"Could not find fix_modify temperature ID");
     temperature = modify->compute[icompute];
 
     if (temperature->tempflag == 0)
-      error->all("Fix_modify temperature ID does not compute temperature");
+      error->all(FLERR,"Fix_modify temperature ID does not compute temperature");
     if (temperature->igroup != igroup && comm->me == 0)
-      error->warning("Group for fix_modify temp != fix group");
+      error->warning(FLERR,"Group for fix_modify temp != fix group");
     return 2;
   }
   return 0;
diff --git a/src/fix_lineforce.cpp b/src/fix_lineforce.cpp
index 9f3f6b241bf6804629d22026aedf0d5e496e5b69..f56c28146a9bc786f06d2584857e3a2cbbb419a2 100644
--- a/src/fix_lineforce.cpp
+++ b/src/fix_lineforce.cpp
@@ -27,13 +27,13 @@ using namespace LAMMPS_NS;
 FixLineForce::FixLineForce(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg != 6) error->all("Illegal fix lineforce command");
+  if (narg != 6) error->all(FLERR,"Illegal fix lineforce command");
   xdir = atof(arg[3]);
   ydir = atof(arg[4]);
   zdir = atof(arg[5]);
 
   double len = sqrt(xdir*xdir + ydir*ydir + zdir*zdir);
-  if (len == 0.0) error->all("Illegal fix lineforce command");
+  if (len == 0.0) error->all(FLERR,"Illegal fix lineforce command");
 
   xdir /= len;
   ydir /= len;
diff --git a/src/fix_momentum.cpp b/src/fix_momentum.cpp
index 400f394c933fc9ca5e101984527bf64cc4fdd16d..8fb7f3ae026bf437de49760cc4a607710a09fa7e 100644
--- a/src/fix_momentum.cpp
+++ b/src/fix_momentum.cpp
@@ -30,16 +30,16 @@ using namespace LAMMPS_NS;
 FixMomentum::FixMomentum(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 4) error->all("Illegal fix momentum command");
+  if (narg < 4) error->all(FLERR,"Illegal fix momentum command");
   nevery = atoi(arg[3]);
-  if (nevery <= 0) error->all("Illegal fix momentum command");
+  if (nevery <= 0) error->all(FLERR,"Illegal fix momentum command");
 
   linear = angular = 0;
 
   int iarg = 4;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"linear") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix momentum command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix momentum command");
       linear = 1;
       xflag = atoi(arg[iarg+1]);
       yflag = atoi(arg[iarg+2]);
@@ -48,20 +48,20 @@ FixMomentum::FixMomentum(LAMMPS *lmp, int narg, char **arg) :
     } else if (strcmp(arg[iarg],"angular") == 0) {
       angular = 1;
       iarg += 1;
-    } else error->all("Illegal fix momentum command");
+    } else error->all(FLERR,"Illegal fix momentum command");
   }
 
   if (linear == 0 && angular == 0)
-    error->all("Illegal fix momentum command");
+    error->all(FLERR,"Illegal fix momentum command");
 
   if (linear)
     if (xflag < 0 || xflag > 1 || yflag < 0 || yflag > 1 || 
-	zflag < 0 || zflag > 1) error->all("Illegal fix momentum command");
+	zflag < 0 || zflag > 1) error->all(FLERR,"Illegal fix momentum command");
 
   // cannot have 0 atoms in group
 
   if (group->count(igroup) == 0)
-    error->all("Fix momentum group has no atoms");
+    error->all(FLERR,"Fix momentum group has no atoms");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/fix_move.cpp b/src/fix_move.cpp
index bb886f8ec036be454d8546de6b084570963d475d..afd087772eed869c1e9015c5e8bd495f66e81ddd 100644
--- a/src/fix_move.cpp
+++ b/src/fix_move.cpp
@@ -39,7 +39,7 @@ enum{EQUAL,ATOM};
 FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 4) error->all("Illegal fix move command");
+  if (narg < 4) error->all(FLERR,"Illegal fix move command");
 
   restart_global = 1;
   restart_peratom = 1;
@@ -57,7 +57,7 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) :
   vxvarstr = vyvarstr = vzvarstr = NULL;
 
   if (strcmp(arg[3],"linear") == 0) {
-    if (narg < 7) error->all("Illegal fix move command");
+    if (narg < 7) error->all(FLERR,"Illegal fix move command");
     iarg = 7;
     mstyle = LINEAR;
     if (strcmp(arg[4],"NULL") == 0) vxflag = 0;
@@ -77,7 +77,7 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) :
     }
 
   } else if (strcmp(arg[3],"wiggle") == 0) {
-    if (narg < 8) error->all("Illegal fix move command");
+    if (narg < 8) error->all(FLERR,"Illegal fix move command");
     iarg = 8;
     mstyle = WIGGLE;
     if (strcmp(arg[4],"NULL") == 0) axflag = 0;
@@ -98,7 +98,7 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) :
     period = atof(arg[7]);
 
   } else if (strcmp(arg[3],"rotate") == 0) {
-    if (narg < 11) error->all("Illegal fix move command");
+    if (narg < 11) error->all(FLERR,"Illegal fix move command");
     iarg = 11;
     mstyle = ROTATE;
     point[0] = atof(arg[4]);
@@ -110,7 +110,7 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) :
     period = atof(arg[10]);
 
   } else if (strcmp(arg[3],"variable") == 0) {
-    if (narg < 10) error->all("Illegal fix move command");
+    if (narg < 10) error->all(FLERR,"Illegal fix move command");
     iarg = 10;
     mstyle = VARIABLE;
     if (strcmp(arg[4],"NULL") == 0) xvarstr = NULL;
@@ -118,39 +118,39 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) :
       int n = strlen(&arg[4][2]) + 1;
       xvarstr = new char[n];
       strcpy(xvarstr,&arg[4][2]);
-    } else error->all("Illegal fix move command");
+    } else error->all(FLERR,"Illegal fix move command");
     if (strcmp(arg[5],"NULL") == 0) yvarstr = NULL;
     else if (strstr(arg[5],"v_") == arg[5]) {
       int n = strlen(&arg[5][2]) + 1;
       yvarstr = new char[n];
       strcpy(yvarstr,&arg[5][2]);
-    } else error->all("Illegal fix move command");
+    } else error->all(FLERR,"Illegal fix move command");
     if (strcmp(arg[6],"NULL") == 0) zvarstr = NULL;
     else if (strstr(arg[6],"v_") == arg[6]) {
       int n = strlen(&arg[6][2]) + 1;
       zvarstr = new char[n];
       strcpy(zvarstr,&arg[6][2]);
-    } else error->all("Illegal fix move command");
+    } else error->all(FLERR,"Illegal fix move command");
     if (strcmp(arg[7],"NULL") == 0) vxvarstr = NULL;
     else if (strstr(arg[7],"v_") == arg[7]) {
       int n = strlen(&arg[7][2]) + 1;
       vxvarstr = new char[n];
       strcpy(vxvarstr,&arg[7][2]);
-    } else error->all("Illegal fix move command");
+    } else error->all(FLERR,"Illegal fix move command");
     if (strcmp(arg[8],"NULL") == 0) vyvarstr = NULL;
     else if (strstr(arg[8],"v_") == arg[8]) {
       int n = strlen(&arg[8][2]) + 1;
       vyvarstr = new char[n];
       strcpy(vyvarstr,&arg[8][2]);
-    } else error->all("Illegal fix move command");
+    } else error->all(FLERR,"Illegal fix move command");
     if (strcmp(arg[9],"NULL") == 0) vzvarstr = NULL;
     else if (strstr(arg[9],"v_") == arg[9]) {
       int n = strlen(&arg[9][2]) + 1;
       vzvarstr = new char[n];
       strcpy(vzvarstr,&arg[9][2]);
-    } else error->all("Illegal fix move command");
+    } else error->all(FLERR,"Illegal fix move command");
     
-  } else error->all("Illegal fix move command");
+  } else error->all(FLERR,"Illegal fix move command");
 
   // optional args
 
@@ -158,38 +158,38 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) :
 
   while (iarg < narg) {
     if (strcmp(arg[iarg],"units") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix move command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix move command");
       if (strcmp(arg[iarg+1],"box") == 0) scaleflag = 0;
       else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1;
-      else error->all("Illegal fix move command");
+      else error->all(FLERR,"Illegal fix move command");
       iarg += 2;
-    } else error->all("Illegal fix move command");
+    } else error->all(FLERR,"Illegal fix move command");
   }
 
   // error checks and warnings
 
   if (domain->dimension == 2) {
     if (mstyle == LINEAR && vzflag && vz != 0.0)
-      error->all("Fix move cannot set linear z motion for 2d problem");
+      error->all(FLERR,"Fix move cannot set linear z motion for 2d problem");
     if (mstyle == WIGGLE && azflag && az != 0.0)
-      error->all("Fix move cannot set wiggle z motion for 2d problem");
+      error->all(FLERR,"Fix move cannot set wiggle z motion for 2d problem");
     if (mstyle == ROTATE && (axis[0] != 0.0 || axis[1] != 0.0))
-      error->all("Fix move cannot rotate aroung non z-axis for 2d problem");
+      error->all(FLERR,"Fix move cannot rotate aroung non z-axis for 2d problem");
     if (mstyle == VARIABLE && (zvarstr || vzvarstr))
-      error->all("Fix move cannot define z or vz variable for 2d problem");
+      error->all(FLERR,"Fix move cannot define z or vz variable for 2d problem");
   }
 
   if (atom->angmom_flag && comm->me == 0)
-    error->warning("Fix move does not update angular momentum");
+    error->warning(FLERR,"Fix move does not update angular momentum");
   if (atom->ellipsoid_flag && comm->me == 0)
-    error->warning("Fix move does not update quaternions");
+    error->warning(FLERR,"Fix move does not update quaternions");
 
   // setup scaling and apply scaling factors to velocity & amplitude
 
   if ((mstyle == LINEAR || mstyle == WIGGLE || mstyle == ROTATE) && 
       scaleflag) {
     if (domain->lattice == NULL)
-      error->all("Use of fix move with undefined lattice");
+      error->all(FLERR,"Use of fix move with undefined lattice");
 
     double xscale,yscale,zscale;
     if (scaleflag) {
@@ -226,7 +226,7 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) :
   if (mstyle == ROTATE) {
     double len = sqrt(axis[0]*axis[0] + axis[1]*axis[1] + axis[2]*axis[2]);
     if (len == 0.0) 
-      error->all("Fix move cannot have 0 length rotation vector");
+      error->all(FLERR,"Fix move cannot have 0 length rotation vector");
     runit[0] = axis[0]/len;
     runit[1] = axis[1]/len;
     runit[2] = axis[2]/len;
@@ -310,45 +310,45 @@ void FixMove::init()
   if (mstyle == VARIABLE) {
     if (xvarstr) {
       xvar = input->variable->find(xvarstr);
-      if (xvar < 0) error->all("Variable name for fix move does not exist");
+      if (xvar < 0) error->all(FLERR,"Variable name for fix move does not exist");
       if (input->variable->equalstyle(xvar)) xvarstyle = EQUAL;
       else if (input->variable->atomstyle(xvar)) xvarstyle = ATOM;
-      else error->all("Variable for fix move is invalid style");
+      else error->all(FLERR,"Variable for fix move is invalid style");
     }
     if (yvarstr) {
       yvar = input->variable->find(yvarstr);
-      if (yvar < 0) error->all("Variable name for fix move does not exist");
+      if (yvar < 0) error->all(FLERR,"Variable name for fix move does not exist");
       if (input->variable->equalstyle(yvar)) yvarstyle = EQUAL;
       else if (input->variable->atomstyle(yvar)) yvarstyle = ATOM;
-      else error->all("Variable for fix move is invalid style");
+      else error->all(FLERR,"Variable for fix move is invalid style");
     }
     if (zvarstr) {
       zvar = input->variable->find(zvarstr);
-      if (zvar < 0) error->all("Variable name for fix move does not exist");
+      if (zvar < 0) error->all(FLERR,"Variable name for fix move does not exist");
       if (input->variable->equalstyle(zvar)) zvarstyle = EQUAL;
       else if (input->variable->atomstyle(zvar)) zvarstyle = ATOM;
-      else error->all("Variable for fix move is invalid style");
+      else error->all(FLERR,"Variable for fix move is invalid style");
     }
     if (vxvarstr) {
       vxvar = input->variable->find(vxvarstr);
-      if (vxvar < 0) error->all("Variable name for fix move does not exist");
+      if (vxvar < 0) error->all(FLERR,"Variable name for fix move does not exist");
       if (input->variable->equalstyle(vxvar)) vxvarstyle = EQUAL;
       else if (input->variable->atomstyle(vxvar)) vxvarstyle = ATOM;
-      else error->all("Variable for fix move is invalid style");
+      else error->all(FLERR,"Variable for fix move is invalid style");
     }
     if (vyvarstr) {
       vyvar = input->variable->find(vyvarstr);
-      if (vyvar < 0) error->all("Variable name for fix move does not exist");
+      if (vyvar < 0) error->all(FLERR,"Variable name for fix move does not exist");
       if (input->variable->equalstyle(vyvar)) vyvarstyle = EQUAL;
       else if (input->variable->atomstyle(vyvar)) vyvarstyle = ATOM;
-      else error->all("Variable for fix move is invalid style");
+      else error->all(FLERR,"Variable for fix move is invalid style");
     }
     if (vzvarstr) {
       vzvar = input->variable->find(vzvarstr);
-      if (vzvar < 0) error->all("Variable name for fix move does not exist");
+      if (vzvar < 0) error->all(FLERR,"Variable name for fix move does not exist");
       if (input->variable->equalstyle(vzvar)) vzvarstyle = EQUAL;
       else if (input->variable->atomstyle(vzvar)) vzvarstyle = ATOM;
-      else error->all("Variable for fix move is invalid style");
+      else error->all(FLERR,"Variable for fix move is invalid style");
     }
 
     displaceflag = velocityflag = 0;
@@ -883,7 +883,7 @@ void FixMove::set_arrays(int i)
   // backup particle to time_origin
 
   if (mstyle == VARIABLE)
-    error->all("Cannot add atoms to fix move variable");
+    error->all(FLERR,"Cannot add atoms to fix move variable");
 
   domain->unmap(x[i],image[i],xoriginal[i]);
   double delta = (update->ntimestep - time_origin) * update->dt;
@@ -1005,5 +1005,5 @@ int FixMove::size_restart(int nlocal)
 
 void FixMove::reset_dt()
 {
-  error->all("Resetting timestep is not allowed with fix move");
+  error->all(FLERR,"Resetting timestep is not allowed with fix move");
 }
diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp
index 285489305772010f59185af5940a463de85650b7..2bf3df8a898f21abf493d2349957374b0059b85e 100644
--- a/src/fix_nh.cpp
+++ b/src/fix_nh.cpp
@@ -39,9 +39,6 @@ using namespace LAMMPS_NS;
 #define DELTAFLIP 0.1
 #define TILTMAX 1.5
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 enum{NOBIAS,BIAS};
 enum{NONE,XYZ,XY,YZ,XZ};
 enum{ISO,ANISO,TRICLINIC};
@@ -52,7 +49,7 @@ enum{ISO,ANISO,TRICLINIC};
 
 FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
 {
-  if (narg < 4) error->all("Illegal fix nvt/npt/nph command");
+  if (narg < 4) error->all(FLERR,"Illegal fix nvt/npt/nph command");
 
   restart_global = 1;
   time_integrate = 1;
@@ -106,17 +103,17 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
 
   while (iarg < narg) {
     if (strcmp(arg[iarg],"temp") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       tstat_flag = 1;
       t_start = atof(arg[iarg+1]);
       t_stop = atof(arg[iarg+2]);
       t_period = atof(arg[iarg+3]);
       if (t_start < 0.0 || t_stop <= 0.0)
-	error->all("Target temperature for fix nvt/npt/nph cannot be 0.0");
+	error->all(FLERR,"Target temperature for fix nvt/npt/nph cannot be 0.0");
       iarg += 4;
 
     } else if (strcmp(arg[iarg],"iso") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       pcouple = XYZ;
       p_start[0] = p_start[1] = p_start[2] = atof(arg[iarg+1]);
       p_stop[0] = p_stop[1] = p_stop[2] = atof(arg[iarg+2]);
@@ -128,7 +125,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       }
       iarg += 4; 
     } else if (strcmp(arg[iarg],"aniso") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       pcouple = NONE;
       p_start[0] = p_start[1] = p_start[2] = atof(arg[iarg+1]);
       p_stop[0] = p_stop[1] = p_stop[2] = atof(arg[iarg+2]);
@@ -140,7 +137,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       }
       iarg += 4;
     } else if (strcmp(arg[iarg],"tri") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       pcouple = NONE;
       scalexy = scalexz = scaleyz = 0;
       p_start[0] = p_start[1] = p_start[2] = atof(arg[iarg+1]);
@@ -161,7 +158,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       }
       iarg += 4;
     } else if (strcmp(arg[iarg],"x") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       p_start[0] = atof(arg[iarg+1]);
       p_stop[0] = atof(arg[iarg+2]);
       p_period[0] = atof(arg[iarg+3]);
@@ -169,7 +166,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       deviatoric_flag = 1;
       iarg += 4; 
     } else if (strcmp(arg[iarg],"y") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       p_start[1] = atof(arg[iarg+1]);
       p_stop[1] = atof(arg[iarg+2]);
       p_period[1] = atof(arg[iarg+3]);
@@ -177,7 +174,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       deviatoric_flag = 1;
       iarg += 4; 
     } else if (strcmp(arg[iarg],"z") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       p_start[2] = atof(arg[iarg+1]);
       p_stop[2] = atof(arg[iarg+2]);
       p_period[2] = atof(arg[iarg+3]);
@@ -185,10 +182,10 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       deviatoric_flag = 1;
       iarg += 4; 
       if (dimension == 2)
-	error->all("Invalid fix nvt/npt/nph command for a 2d simulation");
+	error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
 
     } else if (strcmp(arg[iarg],"yz") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       scaleyz = 0;
       p_start[3] = atof(arg[iarg+1]);
       p_stop[3] = atof(arg[iarg+2]);
@@ -197,9 +194,9 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       deviatoric_flag = 1;
       iarg += 4; 
       if (dimension == 2)
-	error->all("Invalid fix nvt/npt/nph command for a 2d simulation");
+	error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
     } else if (strcmp(arg[iarg],"xz") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       scalexz = 0;
       p_start[4] = atof(arg[iarg+1]);
       p_stop[4] = atof(arg[iarg+2]);
@@ -208,10 +205,10 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       deviatoric_flag = 1;
       iarg += 4; 
       if (dimension == 2)
-	error->all("Invalid fix nvt/npt/nph command for a 2d simulation");
+	error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
     } else if (strcmp(arg[iarg],"xy") == 0) {
       scalexy = 0;
-      if (iarg+4 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       p_start[5] = atof(arg[iarg+1]);
       p_stop[5] = atof(arg[iarg+2]);
       p_period[5] = atof(arg[iarg+3]);
@@ -220,158 +217,158 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       iarg += 4; 
 
     } else if (strcmp(arg[iarg],"couple") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       if (strcmp(arg[iarg+1],"xyz") == 0) pcouple = XYZ;
       else if (strcmp(arg[iarg+1],"xy") == 0) pcouple = XY;
       else if (strcmp(arg[iarg+1],"yz") == 0) pcouple = YZ;
       else if (strcmp(arg[iarg+1],"xz") == 0) pcouple = XZ;
       else if (strcmp(arg[iarg+1],"none") == 0) pcouple = NONE;
-      else error->all("Illegal fix nvt/npt/nph command");
+      else error->all(FLERR,"Illegal fix nvt/npt/nph command");
       iarg += 2;
 
     } else if (strcmp(arg[iarg],"drag") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       drag = atof(arg[iarg+1]);
-      if (drag < 0.0) error->all("Illegal fix nvt/npt/nph command");
+      if (drag < 0.0) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"dilate") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       if (strcmp(arg[iarg+1],"all") == 0) allremap = 1;
       else if (strcmp(arg[iarg+1],"partial") == 0) allremap = 0;
-      else error->all("Illegal fix nvt/npt/nph command");
+      else error->all(FLERR,"Illegal fix nvt/npt/nph command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"tchain") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       mtchain = atoi(arg[iarg+1]);
       // used by FixNVTSllod to preserve non-default value  
       mtchain_default_flag = 0;
-      if (mtchain < 1) error->all("Illegal fix nvt/npt/nph command");
+      if (mtchain < 1) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"pchain") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       mpchain = atoi(arg[iarg+1]);
-      if (mpchain < 0) error->all("Illegal fix nvt/npt/nph command");
+      if (mpchain < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"mtk") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       if (strcmp(arg[iarg+1],"yes") == 0) mtk_flag = 1;
       else if (strcmp(arg[iarg+1],"no") == 0) mtk_flag = 0;
-      else error->all("Illegal fix nvt/npt/nph command");
+      else error->all(FLERR,"Illegal fix nvt/npt/nph command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"tloop") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       nc_tchain = atoi(arg[iarg+1]);
-      if (nc_tchain < 0) error->all("Illegal fix nvt/npt/nph command");
+      if (nc_tchain < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"ploop") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       nc_pchain = atoi(arg[iarg+1]);
-      if (nc_pchain < 0) error->all("Illegal fix nvt/npt/nph command");
+      if (nc_pchain < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"nreset") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       nreset_h0 = atoi(arg[iarg+1]);
-      if (nreset_h0 < 0) error->all("Illegal fix nvt/npt/nph command");
+      if (nreset_h0 < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"scalexy") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       if (strcmp(arg[iarg+1],"yes") == 0) scalexy = 1;
       else if (strcmp(arg[iarg+1],"no") == 0) scalexy = 0;
-      else error->all("Illegal fix nvt/npt/nph command");
+      else error->all(FLERR,"Illegal fix nvt/npt/nph command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"scalexz") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       if (strcmp(arg[iarg+1],"yes") == 0) scalexz = 1;
       else if (strcmp(arg[iarg+1],"no") == 0) scalexz = 0;
-      else error->all("Illegal fix nvt/npt/nph command");
+      else error->all(FLERR,"Illegal fix nvt/npt/nph command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"scaleyz") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix nvt/npt/nph command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       if (strcmp(arg[iarg+1],"yes") == 0) scaleyz = 1;
       else if (strcmp(arg[iarg+1],"no") == 0) scaleyz = 0;
-      else error->all("Illegal fix nvt/npt/nph command");
+      else error->all(FLERR,"Illegal fix nvt/npt/nph command");
       iarg += 2;
-    } else error->all("Illegal fix nvt/npt/nph command");
+    } else error->all(FLERR,"Illegal fix nvt/npt/nph command");
   }
 
   // error checks
 
   if (dimension == 2 && (p_flag[2] || p_flag[3] || p_flag[4]))
-    error->all("Invalid fix nvt/npt/nph command for a 2d simulation");
+    error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
   if (dimension == 2 && (pcouple == YZ || pcouple == XZ))
-    error->all("Invalid fix nvt/npt/nph command for a 2d simulation");
+    error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
   if (dimension == 2 && (scalexz == 1 || scaleyz == 1 ))
-    error->all("Invalid fix nvt/npt/nph command for a 2d simulation");
+    error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
 
   if (pcouple == XYZ && (p_flag[0] == 0 || p_flag[1] == 0))
-    error->all("Invalid fix nvt/npt/nph command pressure settings");
+    error->all(FLERR,"Invalid fix nvt/npt/nph command pressure settings");
   if (pcouple == XYZ && dimension == 3 && p_flag[2] == 0)
-    error->all("Invalid fix nvt/npt/nph command pressure settings");
+    error->all(FLERR,"Invalid fix nvt/npt/nph command pressure settings");
   if (pcouple == XY && (p_flag[0] == 0 || p_flag[1] == 0))
-    error->all("Invalid fix nvt/npt/nph command pressure settings");
+    error->all(FLERR,"Invalid fix nvt/npt/nph command pressure settings");
   if (pcouple == YZ && (p_flag[1] == 0 || p_flag[2] == 0))
-    error->all("Invalid fix nvt/npt/nph command pressure settings");
+    error->all(FLERR,"Invalid fix nvt/npt/nph command pressure settings");
   if (pcouple == XZ && (p_flag[0] == 0 || p_flag[2] == 0))
-    error->all("Invalid fix nvt/npt/nph command pressure settings");
+    error->all(FLERR,"Invalid fix nvt/npt/nph command pressure settings");
 
   if (p_flag[0] && domain->xperiodic == 0)
-    error->all("Cannot use fix nvt/npt/nph on a non-periodic dimension");
+    error->all(FLERR,"Cannot use fix nvt/npt/nph on a non-periodic dimension");
   if (p_flag[1] && domain->yperiodic == 0)
-    error->all("Cannot use fix nvt/npt/nph on a non-periodic dimension");
+    error->all(FLERR,"Cannot use fix nvt/npt/nph on a non-periodic dimension");
   if (p_flag[2] && domain->zperiodic == 0)
-    error->all("Cannot use fix nvt/npt/nph on a non-periodic dimension");
+    error->all(FLERR,"Cannot use fix nvt/npt/nph on a non-periodic dimension");
   if (p_flag[3] && domain->zperiodic == 0)
-    error->all("Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension");
+    error->all(FLERR,"Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension");
   if (p_flag[4] && domain->zperiodic == 0)
-    error->all("Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension");
+    error->all(FLERR,"Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension");
   if (p_flag[5] && domain->yperiodic == 0)
-    error->all("Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension");
+    error->all(FLERR,"Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension");
 
   if (scaleyz == 1 && domain->zperiodic == 0)
-    error->all("Cannot use fix nvt/npt/nph "
+    error->all(FLERR,"Cannot use fix nvt/npt/nph "
 	       "with yz dynamics when z is non-periodic dimension");
   if (scalexz == 1 && domain->zperiodic == 0)
-    error->all("Cannot use fix nvt/npt/nph "
+    error->all(FLERR,"Cannot use fix nvt/npt/nph "
 	       "with xz dynamics when z is non-periodic dimension");
   if (scalexy == 1 && domain->yperiodic == 0)
-    error->all("Cannot use fix nvt/npt/nph "
+    error->all(FLERR,"Cannot use fix nvt/npt/nph "
 	       "with xy dynamics when y is non-periodic dimension");
 
   if (p_flag[3] && scaleyz == 1)
-    error->all("Cannot use fix nvt/npt/nph with"
+    error->all(FLERR,"Cannot use fix nvt/npt/nph with"
 	       "both yz dynamics and yz scaling");
   if (p_flag[4] && scalexz == 1)
-    error->all("Cannot use fix nvt/npt/nph with "
+    error->all(FLERR,"Cannot use fix nvt/npt/nph with "
 	       "both xz dynamics and xz scaling");
   if (p_flag[5] && scalexy == 1)
-    error->all("Cannot use fix nvt/npt/nph with "
+    error->all(FLERR,"Cannot use fix nvt/npt/nph with "
 	       "both xy dynamics and xy scaling");
 
   if (!domain->triclinic && (p_flag[3] || p_flag[4] || p_flag[5])) 
-    error->all("Can not specify Pxy/Pxz/Pyz in "
+    error->all(FLERR,"Can not specify Pxy/Pxz/Pyz in "
 	       "fix nvt/npt/nph with non-triclinic box");
 
   if (pcouple == XYZ && dimension == 3 &&
       (p_start[0] != p_start[1] || p_start[0] != p_start[2] || 
        p_stop[0] != p_stop[1] || p_stop[0] != p_stop[2] || 
        p_period[0] != p_period[1] || p_period[0] != p_period[2]))
-    error->all("Invalid fix nvt/npt/nph pressure settings");
+    error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
   if (pcouple == XYZ && dimension == 2 &&
       (p_start[0] != p_start[1] || p_stop[0] != p_stop[1] || 
        p_period[0] != p_period[1]))
-    error->all("Invalid fix nvt/npt/nph pressure settings");
+    error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
   if (pcouple == XY && 
       (p_start[0] != p_start[1] || p_stop[0] != p_stop[1] || 
        p_period[0] != p_period[1]))
-    error->all("Invalid fix nvt/npt/nph pressure settings");
+    error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
   if (pcouple == YZ && 
       (p_start[1] != p_start[2] || p_stop[1] != p_stop[2] ||
        p_period[1] != p_period[2]))
-    error->all("Invalid fix nvt/npt/nph pressure settings");
+    error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
   if (pcouple == XZ && 
       (p_start[0] != p_start[2] || p_stop[0] != p_stop[2] ||
        p_period[0] != p_period[2]))
-    error->all("Invalid fix nvt/npt/nph pressure settings");
+    error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
 
   if ((tstat_flag && t_period <= 0.0) || 
       (p_flag[0] && p_period[0] <= 0.0) || 
@@ -380,7 +377,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       (p_flag[3] && p_period[3] <= 0.0) || 
       (p_flag[4] && p_period[4] <= 0.0) || 
       (p_flag[5] && p_period[5] <= 0.0))
-    error->all("Fix nvt/npt/nph damping parameters must be > 0.0");
+    error->all(FLERR,"Fix nvt/npt/nph damping parameters must be > 0.0");
 
   // set pstat_flag and box change and restart_pbc variables
 
@@ -544,7 +541,7 @@ void FixNH::init()
 	if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) || 
 	    (p_flag[2] && dimflag[2]) || (p_flag[3] && dimflag[3]) || 
 	    (p_flag[4] && dimflag[4]) || (p_flag[5] && dimflag[5]))
-	  error->all("Cannot use fix npt and fix deform on "
+	  error->all(FLERR,"Cannot use fix npt and fix deform on "
 		     "same component of stress tensor");
       }
 
@@ -552,7 +549,7 @@ void FixNH::init()
 
   int icompute = modify->find_compute(id_temp);
   if (icompute < 0) 
-    error->all("Temperature ID for fix nvt/nph/npt does not exist");
+    error->all(FLERR,"Temperature ID for fix nvt/nph/npt does not exist");
   temperature = modify->compute[icompute];
 
   if (temperature->tempbias) which = BIAS;
@@ -560,7 +557,7 @@ void FixNH::init()
 
   if (pstat_flag) {
     icompute = modify->find_compute(id_press);
-    if (icompute < 0) error->all("Pressure ID for fix npt/nph does not exist");
+    if (icompute < 0) error->all(FLERR,"Pressure ID for fix npt/nph does not exist");
     pressure = modify->compute[icompute];
   }
 
@@ -1092,7 +1089,7 @@ void FixNH::remap()
   if (domain->yz < -TILTMAX*domain->yprd || domain->yz > TILTMAX*domain->yprd ||
       domain->xz < -TILTMAX*domain->xprd || domain->xz > TILTMAX*domain->xprd ||
       domain->xy < -TILTMAX*domain->xprd || domain->xy > TILTMAX*domain->xprd)
-    error->all("Fix npt/nph has tilted box too far in one step - "
+    error->all(FLERR,"Fix npt/nph has tilted box too far in one step - "
 	       "periodic cell is too far from equilibrium state");
 
   domain->set_global_box();
@@ -1263,7 +1260,7 @@ void FixNH::restart(char *buf)
 int FixNH::modify_param(int narg, char **arg)
 {
   if (strcmp(arg[0],"temp") == 0) {
-    if (narg < 2) error->all("Illegal fix_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
     if (tflag) {
       modify->delete_compute(id_temp);
       tflag = 0;
@@ -1274,28 +1271,28 @@ int FixNH::modify_param(int narg, char **arg)
     strcpy(id_temp,arg[1]);
 
     int icompute = modify->find_compute(arg[1]);
-    if (icompute < 0) error->all("Could not find fix_modify temperature ID");
+    if (icompute < 0) error->all(FLERR,"Could not find fix_modify temperature ID");
     temperature = modify->compute[icompute];
 
     if (temperature->tempflag == 0)
-      error->all("Fix_modify temperature ID does not compute temperature");
+      error->all(FLERR,"Fix_modify temperature ID does not compute temperature");
     if (temperature->igroup != 0 && comm->me == 0)
-      error->warning("Temperature for fix modify is not for group all");
+      error->warning(FLERR,"Temperature for fix modify is not for group all");
 
     // reset id_temp of pressure to new temperature ID
 
     if (pstat_flag) {
       icompute = modify->find_compute(id_press);
       if (icompute < 0) 
-	error->all("Pressure ID for fix modify does not exist");
+	error->all(FLERR,"Pressure ID for fix modify does not exist");
       modify->compute[icompute]->reset_extra_compute_fix(id_temp);
     }
 
     return 2;
 
   } else if (strcmp(arg[0],"press") == 0) {
-    if (narg < 2) error->all("Illegal fix_modify command");
-    if (!pstat_flag) error->all("Illegal fix_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
+    if (!pstat_flag) error->all(FLERR,"Illegal fix_modify command");
     if (pflag) {
       modify->delete_compute(id_press);
       pflag = 0;
@@ -1306,11 +1303,11 @@ int FixNH::modify_param(int narg, char **arg)
     strcpy(id_press,arg[1]);
 
     int icompute = modify->find_compute(arg[1]);
-    if (icompute < 0) error->all("Could not find fix_modify pressure ID");
+    if (icompute < 0) error->all(FLERR,"Could not find fix_modify pressure ID");
     pressure = modify->compute[icompute];
 
     if (pressure->pressflag == 0)
-      error->all("Fix_modify pressure ID does not compute pressure");
+      error->all(FLERR,"Fix_modify pressure ID does not compute pressure");
     return 2;
   }
 
diff --git a/src/fix_nh_sphere.cpp b/src/fix_nh_sphere.cpp
index ed414e511de5da495a1e4f9c8b94de5f6b63aed5..7bdbcee266c304c35380976764d11499ec99bb79 100644
--- a/src/fix_nh_sphere.cpp
+++ b/src/fix_nh_sphere.cpp
@@ -32,7 +32,7 @@ FixNHSphere::FixNHSphere(LAMMPS *lmp, int narg, char **arg) :
   FixNH(lmp, narg, arg)
 {
   if (!atom->sphere_flag)
-    error->all("Fix nvt/nph/npt sphere requires atom style sphere");
+    error->all(FLERR,"Fix nvt/nph/npt sphere requires atom style sphere");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -49,7 +49,7 @@ void FixNHSphere::init()
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit)
       if (radius[i] == 0.0)
-	error->one("Fix nvt/sphere requires extended particles");
+	error->one(FLERR,"Fix nvt/sphere requires extended particles");
 
   FixNH::init();
 }
diff --git a/src/fix_nph.cpp b/src/fix_nph.cpp
index b863be12abf5633d2da5b4a0e148645f2cd90e00..e65da36589b4e8328d561276ed0dd20c8722a829 100644
--- a/src/fix_nph.cpp
+++ b/src/fix_nph.cpp
@@ -24,9 +24,9 @@ FixNPH::FixNPH(LAMMPS *lmp, int narg, char **arg) :
   FixNH(lmp, narg, arg)
 {
   if (tstat_flag)
-    error->all("Temperature control can not be used with fix nph");
+    error->all(FLERR,"Temperature control can not be used with fix nph");
   if (!pstat_flag)
-    error->all("Pressure control must be used with fix nph");
+    error->all(FLERR,"Pressure control must be used with fix nph");
 
   // create a new compute temp style
   // id = fix-ID + temp
diff --git a/src/fix_nph_sphere.cpp b/src/fix_nph_sphere.cpp
index bc0e23a3b63f8b31637ffaeb6aa5712ba7c2fba6..550dd8f5bc260c0a9ddab69746d7453e97943ca5 100644
--- a/src/fix_nph_sphere.cpp
+++ b/src/fix_nph_sphere.cpp
@@ -24,9 +24,9 @@ FixNPHSphere::FixNPHSphere(LAMMPS *lmp, int narg, char **arg) :
   FixNHSphere(lmp, narg, arg)
 {
   if (tstat_flag)
-    error->all("Temperature control can not be used with fix nph/sphere");
+    error->all(FLERR,"Temperature control can not be used with fix nph/sphere");
   if (!pstat_flag)
-    error->all("Pressure control must be used with fix nph/sphere");
+    error->all(FLERR,"Pressure control must be used with fix nph/sphere");
 
   // create a new compute temp style
   // id = fix-ID + temp
diff --git a/src/fix_npt.cpp b/src/fix_npt.cpp
index 3963e69ebb1ffd1d52ac85c1c303b16c38e1e4d6..84522560ac9b5f9b9def07b67cb7cbdd85970ae4 100644
--- a/src/fix_npt.cpp
+++ b/src/fix_npt.cpp
@@ -24,9 +24,9 @@ FixNPT::FixNPT(LAMMPS *lmp, int narg, char **arg) :
   FixNH(lmp, narg, arg)
 {
   if (!tstat_flag)
-    error->all("Temperature control must be used with fix npt");
+    error->all(FLERR,"Temperature control must be used with fix npt");
   if (!pstat_flag)
-    error->all("Pressure control must be used with fix npt");
+    error->all(FLERR,"Pressure control must be used with fix npt");
 
   // create a new compute temp style
   // id = fix-ID + temp
diff --git a/src/fix_npt_sphere.cpp b/src/fix_npt_sphere.cpp
index 2e250fad8d2e71f9c54d3c94496be89361182185..b58971f550c196c9fe01e4b37f6052f014b43cd9 100644
--- a/src/fix_npt_sphere.cpp
+++ b/src/fix_npt_sphere.cpp
@@ -24,9 +24,9 @@ FixNPTSphere::FixNPTSphere(LAMMPS *lmp, int narg, char **arg) :
   FixNHSphere(lmp, narg, arg)
 {
   if (!tstat_flag)
-    error->all("Temperature control must be used with fix npt/sphere");
+    error->all(FLERR,"Temperature control must be used with fix npt/sphere");
   if (!pstat_flag)
-    error->all("Pressure control must be used with fix npt/sphere");
+    error->all(FLERR,"Pressure control must be used with fix npt/sphere");
 
   // create a new compute temp style
   // id = fix-ID + temp
diff --git a/src/fix_nve.cpp b/src/fix_nve.cpp
index bb500561ae74c89e434f54d104f4347d6fce71d7..ce4e253069e2ce69c9e9f2b8ab5e1455239d9021 100644
--- a/src/fix_nve.cpp
+++ b/src/fix_nve.cpp
@@ -28,7 +28,7 @@ FixNVE::FixNVE(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
   if (strcmp(style,"nve/sphere") != 0 && narg < 3)
-    error->all("Illegal fix nve command");
+    error->all(FLERR,"Illegal fix nve command");
 
   time_integrate = 1;
 }
diff --git a/src/fix_nve_limit.cpp b/src/fix_nve_limit.cpp
index 2fed70c49e0b4febf29e6fb42210113d5f506514..a5e2b28946abe51e922c13c8372f84b010b8041e 100644
--- a/src/fix_nve_limit.cpp
+++ b/src/fix_nve_limit.cpp
@@ -29,7 +29,7 @@ using namespace LAMMPS_NS;
 FixNVELimit::FixNVELimit(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg != 4) error->all("Illegal fix nve/limit command");
+  if (narg != 4) error->all(FLERR,"Illegal fix nve/limit command");
 
   time_integrate = 1;
   scalar_flag = 1;
diff --git a/src/fix_nve_noforce.cpp b/src/fix_nve_noforce.cpp
index b0095ab180a8981a9d68a1711b6893cd04228492..b4d67be752186682e5237acc90550d401992d380 100644
--- a/src/fix_nve_noforce.cpp
+++ b/src/fix_nve_noforce.cpp
@@ -26,7 +26,7 @@ using namespace LAMMPS_NS;
 FixNVENoforce::FixNVENoforce(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg != 3) error->all("Illegal fix nve/noforce command");
+  if (narg != 3) error->all(FLERR,"Illegal fix nve/noforce command");
 
   time_integrate = 1;
 }
diff --git a/src/fix_nve_sphere.cpp b/src/fix_nve_sphere.cpp
index 935c9f069963a6f75fb610ace50d0c0935d9d226..c81452994c5a859d1f17c79f97f04211b41e23d4 100644
--- a/src/fix_nve_sphere.cpp
+++ b/src/fix_nve_sphere.cpp
@@ -33,7 +33,7 @@ enum{NONE,DIPOLE};
 FixNVESphere::FixNVESphere(LAMMPS *lmp, int narg, char **arg) :
   FixNVE(lmp, narg, arg)
 {
-  if (narg < 3) error->all("Illegal fix nve/sphere command");
+  if (narg < 3) error->all(FLERR,"Illegal fix nve/sphere command");
 
   time_integrate = 1;
 
@@ -44,19 +44,19 @@ FixNVESphere::FixNVESphere(LAMMPS *lmp, int narg, char **arg) :
   int iarg = 3;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"update") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix nve/sphere command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix nve/sphere command");
       if (strcmp(arg[iarg+1],"dipole") == 0) extra = DIPOLE;
-      else error->all("Illegal fix nve/sphere command");
+      else error->all(FLERR,"Illegal fix nve/sphere command");
       iarg += 2;
-    } else error->all("Illegal fix nve/sphere command");
+    } else error->all(FLERR,"Illegal fix nve/sphere command");
   }
 
   // error checks
 
   if (!atom->sphere_flag)
-    error->all("Fix nve/sphere requires atom style sphere");
+    error->all(FLERR,"Fix nve/sphere requires atom style sphere");
   if (extra == DIPOLE && !atom->mu_flag)
-    error->all("Fix nve/sphere requires atom attribute mu");
+    error->all(FLERR,"Fix nve/sphere requires atom attribute mu");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -85,7 +85,7 @@ void FixNVESphere::init()
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit)
       if (radius[i] == 0.0)
-	error->one("Fix nve/sphere requires extended particles");
+	error->one(FLERR,"Fix nve/sphere requires extended particles");
 
   FixNVE::init();
 }
diff --git a/src/fix_nvt.cpp b/src/fix_nvt.cpp
index 7817113b05be960593bcffd30a2442183e746408..60478e6c410c5f0a24669762f4708eee1425dc55 100644
--- a/src/fix_nvt.cpp
+++ b/src/fix_nvt.cpp
@@ -25,9 +25,9 @@ FixNVT::FixNVT(LAMMPS *lmp, int narg, char **arg) :
   FixNH(lmp, narg, arg)
 {
   if (!tstat_flag)
-    error->all("Temperature control must be used with fix nvt");
+    error->all(FLERR,"Temperature control must be used with fix nvt");
   if (pstat_flag)
-    error->all("Pressure control can not be used with fix nvt");
+    error->all(FLERR,"Pressure control can not be used with fix nvt");
 
   // create a new compute temp style
   // id = fix-ID + temp
diff --git a/src/fix_nvt_sllod.cpp b/src/fix_nvt_sllod.cpp
index 576d0644095643edb381bfea6231c608f2f2bc94..ab5c876ad3245065308f35cea01cf211fb9a78f7 100644
--- a/src/fix_nvt_sllod.cpp
+++ b/src/fix_nvt_sllod.cpp
@@ -38,9 +38,9 @@ FixNVTSllod::FixNVTSllod(LAMMPS *lmp, int narg, char **arg) :
   FixNH(lmp, narg, arg)
 {
   if (!tstat_flag)
-    error->all("Temperature control must be used with fix nvt/sllod");
+    error->all(FLERR,"Temperature control must be used with fix nvt/sllod");
   if (pstat_flag)
-    error->all("Pressure control can not be used with fix nvt/sllod");
+    error->all(FLERR,"Pressure control can not be used with fix nvt/sllod");
 
   // default values
 
@@ -72,7 +72,7 @@ void FixNVTSllod::init()
   FixNH::init();
 
   if (!temperature->tempbias)
-    error->all("Temperature for fix nvt/sllod does not have a bias");
+    error->all(FLERR,"Temperature for fix nvt/sllod does not have a bias");
 
   nondeformbias = 0;
   if (strcmp(temperature->style,"temp/deform") != 0) nondeformbias = 1;
@@ -83,12 +83,12 @@ void FixNVTSllod::init()
   for (i = 0; i < modify->nfix; i++)
     if (strcmp(modify->fix[i]->style,"deform") == 0) {
       if (((FixDeform *) modify->fix[i])->remapflag != V_REMAP)
-	error->all("Using fix nvt/sllod with inconsistent fix deform "
+	error->all(FLERR,"Using fix nvt/sllod with inconsistent fix deform "
 		   "remap option");
       break;
     }
   if (i == modify->nfix)
-    error->all("Using fix nvt/sllod with no fix deform defined");
+    error->all(FLERR,"Using fix nvt/sllod with no fix deform defined");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/fix_nvt_sphere.cpp b/src/fix_nvt_sphere.cpp
index 9873917c9f07b9fd43c538d55dba08820219f32b..84c4a6bbc670209247c1ae253f6135a6762d3f60 100644
--- a/src/fix_nvt_sphere.cpp
+++ b/src/fix_nvt_sphere.cpp
@@ -25,9 +25,9 @@ FixNVTSphere::FixNVTSphere(LAMMPS *lmp, int narg, char **arg) :
   FixNHSphere(lmp, narg, arg)
 {
   if (!tstat_flag)
-    error->all("Temperature control must be used with fix nvt/sphere");
+    error->all(FLERR,"Temperature control must be used with fix nvt/sphere");
   if (pstat_flag)
-    error->all("Pressure control can not be used with fix nvt/sphere");
+    error->all(FLERR,"Pressure control can not be used with fix nvt/sphere");
 
   // create a new compute temp style
   // id = fix-ID + temp
diff --git a/src/fix_orient_fcc.cpp b/src/fix_orient_fcc.cpp
index 088c01785f2f76a22c2e42badd491387eea6fa4a..d0269acddb062331162c55d7f8ef1523eac0d3ca 100644
--- a/src/fix_orient_fcc.cpp
+++ b/src/fix_orient_fcc.cpp
@@ -35,9 +35,6 @@ using namespace LAMMPS_NS;
 
 #define BIG 1000000000
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 FixOrientFCC::FixOrientFCC(LAMMPS *lmp, int narg, char **arg) :
@@ -45,7 +42,7 @@ FixOrientFCC::FixOrientFCC(LAMMPS *lmp, int narg, char **arg) :
 {
   MPI_Comm_rank(world,&me);
 
-  if (narg != 11) error->all("Illegal fix orient/fcc command");
+  if (narg != 11) error->all(FLERR,"Illegal fix orient/fcc command");
 
   scalar_flag = 1;
   global_freq = 1;
@@ -76,7 +73,7 @@ FixOrientFCC::FixOrientFCC(LAMMPS *lmp, int narg, char **arg) :
     n = strlen(arg[10]) + 1;
     chifilename = new char[n];
     strcpy(chifilename,arg[10]);
-  } else error->all("Illegal fix orient/fcc command");
+  } else error->all(FLERR,"Illegal fix orient/fcc command");
 
   // initializations
 
@@ -96,22 +93,22 @@ FixOrientFCC::FixOrientFCC(LAMMPS *lmp, int narg, char **arg) :
     int count;
 
     FILE *infile = fopen(xifilename,"r");
-    if (infile == NULL) error->one("Fix orient/fcc file open failed");
+    if (infile == NULL) error->one(FLERR,"Fix orient/fcc file open failed");
     for (int i = 0; i < 6; i++) {
       result = fgets(line,512,infile);
-      if (!result) error->one("Fix orient/fcc file read failed");
+      if (!result) error->one(FLERR,"Fix orient/fcc file read failed");
       count = sscanf(line,"%lg %lg %lg",&Rxi[i][0],&Rxi[i][1],&Rxi[i][2]);
-      if (count != 3) error->one("Fix orient/fcc file read failed");
+      if (count != 3) error->one(FLERR,"Fix orient/fcc file read failed");
     }
     fclose(infile);
 
     infile = fopen(chifilename,"r");
-    if (infile == NULL) error->one("Fix orient/fcc file open failed");
+    if (infile == NULL) error->one(FLERR,"Fix orient/fcc file open failed");
     for (int i = 0; i < 6; i++) {
       result = fgets(line,512,infile);
-      if (!result) error->one("Fix orient/fcc file read failed");
+      if (!result) error->one(FLERR,"Fix orient/fcc file read failed");
       count = sscanf(line,"%lg %lg %lg",&Rchi[i][0],&Rchi[i][1],&Rchi[i][2]);
-      if (count != 3) error->one("Fix orient/fcc file read failed");
+      if (count != 3) error->one(FLERR,"Fix orient/fcc file read failed");
     }
     fclose(infile);
   }
@@ -396,7 +393,7 @@ void FixOrientFCC::post_force(int vflag)
 
       for (k = 0; k < nn; k++) {
 	if (id_self == nbr[m].id[k]) {
-	  if (found_myself) error->one("Fix orient/fcc found self twice");
+	  if (found_myself) error->one(FLERR,"Fix orient/fcc found self twice");
 	  found_myself = true;
 	  duxi_other = nbr[m].duxi;
 	  dxiptr = &nbr[m].dxi[k][0];
diff --git a/src/fix_planeforce.cpp b/src/fix_planeforce.cpp
index 0cf0ee2b92c89eca7a5759915365f73e0f4db934..5b7a0cfbec2f6c383a420d6408dae045e91996c1 100644
--- a/src/fix_planeforce.cpp
+++ b/src/fix_planeforce.cpp
@@ -27,13 +27,13 @@ using namespace LAMMPS_NS;
 FixPlaneForce::FixPlaneForce(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg != 6) error->all("Illegal fix planeforce command");
+  if (narg != 6) error->all(FLERR,"Illegal fix planeforce command");
   xdir = atof(arg[3]);
   ydir = atof(arg[4]);
   zdir = atof(arg[5]);
 
   double len = sqrt(xdir*xdir + ydir*ydir + zdir*zdir);
-  if (len == 0.0) error->all("Illegal fix planeforce command");
+  if (len == 0.0) error->all(FLERR,"Illegal fix planeforce command");
 
   xdir /= len;
   ydir /= len;
diff --git a/src/fix_press_berendsen.cpp b/src/fix_press_berendsen.cpp
index 2da7bde7b79c9533769dedf2f24632234dae0043..36abc158b204a94d59d855e8fe79908476395459 100644
--- a/src/fix_press_berendsen.cpp
+++ b/src/fix_press_berendsen.cpp
@@ -29,9 +29,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 enum{NOBIAS,BIAS};
 enum{NONE,XYZ,XY,YZ,XZ};
 enum{ISO,ANISO};
@@ -41,7 +38,7 @@ enum{ISO,ANISO};
 FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 5) error->all("Illegal fix press/berendsen command");
+  if (narg < 5) error->all(FLERR,"Illegal fix press/berendsen command");
 
   box_change = 1;
   box_change_size = 1;
@@ -70,7 +67,7 @@ FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) :
 
   while (iarg < narg) {
     if (strcmp(arg[iarg],"iso") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix press/berendsen command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix press/berendsen command");
       pcouple = XYZ;
       p_start[0] = p_start[1] = p_start[2] = atof(arg[iarg+1]);
       p_stop[0] = p_stop[1] = p_stop[2] = atof(arg[iarg+2]);
@@ -82,7 +79,7 @@ FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) :
       }
       iarg += 4; 
     } else if (strcmp(arg[iarg],"aniso") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix press/berendsen command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix press/berendsen command");
       pcouple = NONE;
       p_start[0] = p_start[1] = p_start[2] = atof(arg[iarg+1]);
       p_stop[0] = p_stop[1] = p_stop[2] = atof(arg[iarg+2]);
@@ -95,52 +92,52 @@ FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) :
       iarg += 4;
 
     } else if (strcmp(arg[iarg],"x") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix press/berendsen command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix press/berendsen command");
       p_start[0] = atof(arg[iarg+1]);
       p_stop[0] = atof(arg[iarg+2]);
       p_period[0] = atof(arg[iarg+3]);
       p_flag[0] = 1;
       iarg += 4; 
     } else if (strcmp(arg[iarg],"y") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix press/berendsen command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix press/berendsen command");
       p_start[1] = atof(arg[iarg+1]);
       p_stop[1] = atof(arg[iarg+2]);
       p_period[1] = atof(arg[iarg+3]);
       p_flag[1] = 1;
       iarg += 4; 
     } else if (strcmp(arg[iarg],"z") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix press/berendsen command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix press/berendsen command");
       p_start[2] = atof(arg[iarg+1]);
       p_stop[2] = atof(arg[iarg+2]);
       p_period[2] = atof(arg[iarg+3]);
       p_flag[2] = 1;
       iarg += 4; 
       if (dimension == 2)
-	error->all("Invalid fix press/berendsen for a 2d simulation");
+	error->all(FLERR,"Invalid fix press/berendsen for a 2d simulation");
 
     } else if (strcmp(arg[iarg],"couple") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix press/berendsen command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix press/berendsen command");
       if (strcmp(arg[iarg+1],"xyz") == 0) pcouple = XYZ;
       else if (strcmp(arg[iarg+1],"xy") == 0) pcouple = XY;
       else if (strcmp(arg[iarg+1],"yz") == 0) pcouple = YZ;
       else if (strcmp(arg[iarg+1],"xz") == 0) pcouple = XZ;
       else if (strcmp(arg[iarg+1],"none") == 0) pcouple = NONE;
-      else error->all("Illegal fix press/berendsen command");
+      else error->all(FLERR,"Illegal fix press/berendsen command");
       iarg += 2;
 
     } else if (strcmp(arg[iarg],"modulus") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix press/berendsen command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix press/berendsen command");
       bulkmodulus = atof(arg[iarg+1]);
       if (bulkmodulus <= 0.0) 
-	error->all("Illegal fix press/berendsen command");
+	error->all(FLERR,"Illegal fix press/berendsen command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"dilate") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix press/berendsen command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix press/berendsen command");
       if (strcmp(arg[iarg+1],"all") == 0) allremap = 1;
       else if (strcmp(arg[iarg+1],"partial") == 0) allremap = 0;
-      else error->all("Illegal fix press/berendsen command");
+      else error->all(FLERR,"Illegal fix press/berendsen command");
       iarg += 2;
-    } else error->all("Illegal fix press/berendsen command");
+    } else error->all(FLERR,"Illegal fix press/berendsen command");
   }
 
   if (allremap == 0) restart_pbc = 1;
@@ -148,54 +145,54 @@ FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) :
   // error checks
 
   if (dimension == 2 && p_flag[2])
-    error->all("Invalid fix press/berendsen for a 2d simulation");
+    error->all(FLERR,"Invalid fix press/berendsen for a 2d simulation");
   if (dimension == 2 && (pcouple == YZ || pcouple == XZ))
-    error->all("Invalid fix press/berendsen for a 2d simulation");
+    error->all(FLERR,"Invalid fix press/berendsen for a 2d simulation");
 
   if (pcouple == XYZ && (p_flag[0] == 0 || p_flag[1] == 0))
-    error->all("Invalid fix press/berendsen pressure settings");
+    error->all(FLERR,"Invalid fix press/berendsen pressure settings");
   if (pcouple == XYZ && dimension == 3 && p_flag[2] == 0)
-    error->all("Invalid fix press/berendsen pressure settings");
+    error->all(FLERR,"Invalid fix press/berendsen pressure settings");
   if (pcouple == XY && (p_flag[0] == 0 || p_flag[1] == 0))
-    error->all("Invalid fix press/berendsen pressure settings");
+    error->all(FLERR,"Invalid fix press/berendsen pressure settings");
   if (pcouple == YZ && (p_flag[1] == 0 || p_flag[2] == 0))
-    error->all("Invalid fix press/berendsen pressure settings");
+    error->all(FLERR,"Invalid fix press/berendsen pressure settings");
   if (pcouple == XZ && (p_flag[0] == 0 || p_flag[2] == 0))
-    error->all("Invalid fix press/berendsen pressure settings");
+    error->all(FLERR,"Invalid fix press/berendsen pressure settings");
 
   if (p_flag[0] && domain->xperiodic == 0)
-    error->all("Cannot use fix press/berendsen on a non-periodic dimension");
+    error->all(FLERR,"Cannot use fix press/berendsen on a non-periodic dimension");
   if (p_flag[1] && domain->yperiodic == 0)
-    error->all("Cannot use fix press/berendsen on a non-periodic dimension");
+    error->all(FLERR,"Cannot use fix press/berendsen on a non-periodic dimension");
   if (p_flag[2] && domain->zperiodic == 0)
-    error->all("Cannot use fix press/berendsen on a non-periodic dimension");
+    error->all(FLERR,"Cannot use fix press/berendsen on a non-periodic dimension");
 
   if (pcouple == XYZ && dimension == 3 &&
       (p_start[0] != p_start[1] || p_start[0] != p_start[2] || 
        p_stop[0] != p_stop[1] || p_stop[0] != p_stop[2] || 
        p_period[0] != p_period[1] || p_period[0] != p_period[2]))
-    error->all("Invalid fix press/berendsen pressure settings");
+    error->all(FLERR,"Invalid fix press/berendsen pressure settings");
   if (pcouple == XYZ && dimension == 2 &&
       (p_start[0] != p_start[1] || p_stop[0] != p_stop[1] || 
        p_period[0] != p_period[1]))
-    error->all("Invalid fix press/berendsen pressure settings");
+    error->all(FLERR,"Invalid fix press/berendsen pressure settings");
   if (pcouple == XY && 
       (p_start[0] != p_start[1] || p_stop[0] != p_stop[1] || 
        p_period[0] != p_period[1]))
-    error->all("Invalid fix press/berendsen pressure settings");
+    error->all(FLERR,"Invalid fix press/berendsen pressure settings");
   if (pcouple == YZ && 
       (p_start[1] != p_start[2] || p_stop[1] != p_stop[2] ||
        p_period[1] != p_period[2]))
-    error->all("Invalid fix press/berendsen pressure settings");
+    error->all(FLERR,"Invalid fix press/berendsen pressure settings");
   if (pcouple == XZ && 
       (p_start[0] != p_start[2] || p_stop[0] != p_stop[2] ||
        p_period[0] != p_period[2]))
-    error->all("Invalid fix press/berendsen pressure settings");
+    error->all(FLERR,"Invalid fix press/berendsen pressure settings");
 
   if ((p_flag[0] && p_period[0] <= 0.0) || 
       (p_flag[1] && p_period[1] <= 0.0) || 
       (p_flag[2] && p_period[2] <= 0.0))
-    error->all("Fix press/berendsen damping parameters must be > 0.0");
+    error->all(FLERR,"Fix press/berendsen damping parameters must be > 0.0");
 
   // pstyle = ISO if XYZ coupling or XY coupling in 2d -> 1 dof
   // else pstyle = ANISO -> 3 dof
@@ -271,7 +268,7 @@ int FixPressBerendsen::setmask()
 void FixPressBerendsen::init()
 {
   if (domain->triclinic) 
-    error->all("Cannot use fix press/berendsen with triclinic box");
+    error->all(FLERR,"Cannot use fix press/berendsen with triclinic box");
 
   // insure no conflict with fix deform
 
@@ -280,7 +277,7 @@ void FixPressBerendsen::init()
       int *dimflag = ((FixDeform *) modify->fix[i])->dimflag;
       if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) || 
 	  (p_flag[2] && dimflag[2]))
-	error->all("Cannot use fix press/berendsen and "
+	error->all(FLERR,"Cannot use fix press/berendsen and "
 		   "fix deform on same component of stress tensor");
     }
 
@@ -288,7 +285,7 @@ void FixPressBerendsen::init()
 
   int icompute = modify->find_compute(id_temp);
   if (icompute < 0) 
-    error->all("Temperature ID for fix press/berendsen does not exist");
+    error->all(FLERR,"Temperature ID for fix press/berendsen does not exist");
   temperature = modify->compute[icompute];
 
   if (temperature->tempbias) which = BIAS;
@@ -296,7 +293,7 @@ void FixPressBerendsen::init()
 
   icompute = modify->find_compute(id_press);
   if (icompute < 0)
-    error->all("Pressure ID for fix press/berendsen does not exist");
+    error->all(FLERR,"Pressure ID for fix press/berendsen does not exist");
   pressure = modify->compute[icompute];
 
   // Kspace setting
@@ -462,7 +459,7 @@ void FixPressBerendsen::remap()
 int FixPressBerendsen::modify_param(int narg, char **arg)
 {
   if (strcmp(arg[0],"temp") == 0) {
-    if (narg < 2) error->all("Illegal fix_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
     if (tflag) {
       modify->delete_compute(id_temp);
       tflag = 0;
@@ -473,25 +470,25 @@ int FixPressBerendsen::modify_param(int narg, char **arg)
     strcpy(id_temp,arg[1]);
 
     int icompute = modify->find_compute(arg[1]);
-    if (icompute < 0) error->all("Could not find fix_modify temperature ID");
+    if (icompute < 0) error->all(FLERR,"Could not find fix_modify temperature ID");
     temperature = modify->compute[icompute];
 
     if (temperature->tempflag == 0)
-      error->all("Fix_modify temperature ID does not compute temperature");
+      error->all(FLERR,"Fix_modify temperature ID does not compute temperature");
     if (temperature->igroup != 0 && comm->me == 0)
-      error->warning("Temperature for NPT is not for group all");
+      error->warning(FLERR,"Temperature for NPT is not for group all");
 
     // reset id_temp of pressure to new temperature ID
     
     icompute = modify->find_compute(id_press);
     if (icompute < 0) 
-      error->all("Pressure ID for fix press/berendsen does not exist");
+      error->all(FLERR,"Pressure ID for fix press/berendsen does not exist");
     modify->compute[icompute]->reset_extra_compute_fix(id_temp);
 
     return 2;
 
   } else if (strcmp(arg[0],"press") == 0) {
-    if (narg < 2) error->all("Illegal fix_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
     if (pflag) {
       modify->delete_compute(id_press);
       pflag = 0;
@@ -502,11 +499,11 @@ int FixPressBerendsen::modify_param(int narg, char **arg)
     strcpy(id_press,arg[1]);
 
     int icompute = modify->find_compute(arg[1]);
-    if (icompute < 0) error->all("Could not find fix_modify pressure ID");
+    if (icompute < 0) error->all(FLERR,"Could not find fix_modify pressure ID");
     pressure = modify->compute[icompute];
 
     if (pressure->pressflag == 0)
-      error->all("Fix_modify pressure ID does not compute pressure");
+      error->all(FLERR,"Fix_modify pressure ID does not compute pressure");
     return 2;
   }
   return 0;
diff --git a/src/fix_print.cpp b/src/fix_print.cpp
index 682c7b1b518e1390983e78b40e054be0c71cd764..c38945a8c0edf1847ca0668fad4aba1cf206df6e 100644
--- a/src/fix_print.cpp
+++ b/src/fix_print.cpp
@@ -29,9 +29,9 @@ using namespace LAMMPS_NS;
 FixPrint::FixPrint(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 5) error->all("Illegal fix print command");
+  if (narg < 5) error->all(FLERR,"Illegal fix print command");
   nevery = atoi(arg[3]);
-  if (nevery <= 0) error->all("Illegal fix print command");
+  if (nevery <= 0) error->all(FLERR,"Illegal fix print command");
 
   MPI_Comm_rank(world,&me);
 
@@ -48,31 +48,31 @@ FixPrint::FixPrint(LAMMPS *lmp, int narg, char **arg) :
   int iarg = 5;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"file") == 0 || strcmp(arg[iarg],"append") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix print command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix print command");
       if (me == 0) {
 	if (strcmp(arg[iarg],"file") == 0) fp = fopen(arg[iarg+1],"w");
 	else fp = fopen(arg[iarg+1],"a");
 	if (fp == NULL) {
 	  char str[128];
 	  sprintf(str,"Cannot open fix print file %s",arg[iarg+1]);
-	  error->one(str);
+	  error->one(FLERR,str);
 	}
       }
       iarg += 2;
     } else if (strcmp(arg[iarg],"screen") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix print command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix print command");
       if (strcmp(arg[iarg+1],"yes") == 0) screenflag = 1;
       else if (strcmp(arg[iarg+1],"no") == 0) screenflag = 0;
-      else error->all("Illegal fix print command");
+      else error->all(FLERR,"Illegal fix print command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"title") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix print command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix print command");
       delete [] title;
       int n = strlen(arg[iarg+1]) + 1;
       title = new char[n];
       strcpy(title,arg[iarg+1]);
       iarg += 2;
-    } else error->all("Illegal fix print command");
+    } else error->all(FLERR,"Illegal fix print command");
   }
 
   // print file comment line
diff --git a/src/fix_recenter.cpp b/src/fix_recenter.cpp
index cd2b311c9ab3a6bce72487d600f3353c90266a61..ac752b99c3a2c7b084a85a9e7e3c6807bdb0f260 100644
--- a/src/fix_recenter.cpp
+++ b/src/fix_recenter.cpp
@@ -35,7 +35,7 @@ enum{BOX,LATTICE,FRACTION};
 FixRecenter::FixRecenter(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 6) error->all("Illegal fix recenter command");
+  if (narg < 6) error->all(FLERR,"Illegal fix recenter command");
 
   xcom = ycom = zcom = 0.0;
   xflag = yflag = zflag = 1;
@@ -60,22 +60,22 @@ FixRecenter::FixRecenter(LAMMPS *lmp, int narg, char **arg) :
   while (iarg < narg) {
     if (strcmp(arg[iarg],"shift") == 0) {
       int igroup2 = group->find(arg[iarg+1]);
-      if (igroup2 < 0) error->all("Could not find fix recenter group ID");
+      if (igroup2 < 0) error->all(FLERR,"Could not find fix recenter group ID");
       group2bit = group->bitmask[igroup2];
       iarg += 2;
     } else if (strcmp(arg[iarg],"units") == 0) {
       if (strcmp(arg[iarg+1],"box") == 0) scaleflag = BOX;
       else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = LATTICE;
       else if (strcmp(arg[iarg+1],"fraction") == 0) scaleflag = FRACTION;
-      else error->all("Illegal fix recenter command");
+      else error->all(FLERR,"Illegal fix recenter command");
       iarg += 2;
-    } else error->all("Illegal fix recenter command");
+    } else error->all(FLERR,"Illegal fix recenter command");
   }
 
   // scale xcom,ycom,zcom
 
   if (scaleflag == LATTICE && domain->lattice == NULL)
-    error->all("Use of fix recenter with undefined lattice");
+    error->all(FLERR,"Use of fix recenter with undefined lattice");
 
   double xscale,yscale,zscale;
   if (scaleflag == LATTICE) {
@@ -92,7 +92,7 @@ FixRecenter::FixRecenter(LAMMPS *lmp, int narg, char **arg) :
   // cannot have 0 atoms in group
 
   if (group->count(igroup) == 0)
-    error->all("Fix recenter group has no atoms");
+    error->all(FLERR,"Fix recenter group has no atoms");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -117,7 +117,7 @@ void FixRecenter::init()
     else if ((modify->fmask[i] & INITIAL_INTEGRATE) && after) flag = 1;
   }
   if (flag && comm->me == 0)
-    error->warning("Fix recenter should come after all other integration fixes");
+    error->warning(FLERR,"Fix recenter should come after all other integration fixes");
 
   masstotal = group->mass(igroup);
 
diff --git a/src/fix_restrain.cpp b/src/fix_restrain.cpp
index b9e16c7a4111db746dcef5a3ca633e8fe8ce0adc..43f7f61087cf1fca76a943137037059406c45ee1 100644
--- a/src/fix_restrain.cpp
+++ b/src/fix_restrain.cpp
@@ -41,7 +41,7 @@ FixRestrain::FixRestrain(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
   int iarg = 6;
-  if (narg < iarg) error->all("Illegal fix restrain command");
+  if (narg < iarg) error->all(FLERR,"Illegal fix restrain command");
 
   scalar_flag = 1;
   global_freq = 1;
@@ -56,11 +56,11 @@ FixRestrain::FixRestrain(LAMMPS *lmp, int narg, char **arg) :
   if (strcmp(arg[5], "dihedral") == 0) {
     rstyle = DIHEDRAL;
     n_atoms = 4;
-  } else error->all("Illegal fix restrain command");
+  } else error->all(FLERR,"Illegal fix restrain command");
 
   n_bonds = (narg - iarg) / (n_atoms + 1);
   if (narg != iarg + n_bonds * (n_atoms + 1))
-    error->all("Illegal fix restrain command");
+    error->all(FLERR,"Illegal fix restrain command");
 
   // allocate arrays
 
@@ -98,7 +98,7 @@ FixRestrain::FixRestrain(LAMMPS *lmp, int narg, char **arg) :
   // require atom map to lookup atom IDs
 
   if (atom->map_style == 0) 
-    error->all("Fix restrain requires an atom map, see atom_modify");
+    error->all(FLERR,"Fix restrain requires an atom map, see atom_modify");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -218,7 +218,7 @@ void FixRestrain::restrain_dihedral()
 		BIGINT_FORMAT,
 		atom_id[n][0],atom_id[n][1],atom_id[n][2],atom_id[n][3],
 		comm->me,update->ntimestep);
-	error->one(str);
+	error->one(FLERR,str);
       }
     } else {
       if ((i1 == -1 || i1 >= nlocal) && (i2 == -1 || i2 >= nlocal) &&
@@ -230,7 +230,7 @@ void FixRestrain::restrain_dihedral()
 		BIGINT_FORMAT,
 		atom_id[n][0],atom_id[n][1],atom_id[n][2],atom_id[n][3],
 		comm->me,update->ntimestep);
-	error->one(str);
+	error->one(FLERR,str);
       }
     }
 
@@ -291,7 +291,7 @@ void FixRestrain::restrain_dihedral()
 	sprintf(str,"Restrain problem: %d " BIGINT_FORMAT " %d %d %d %d",
 		me,update->ntimestep,
 		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(str);
+	error->warning(FLERR,str);
 	fprintf(screen,"  1st atom: %d %g %g %g\n",
 		me,x[i1][0],x[i1][1],x[i1][2]);
 	fprintf(screen,"  2nd atom: %d %g %g %g\n",
diff --git a/src/fix_rigid.cpp b/src/fix_rigid.cpp
index b2b79a5af75b9dea0a9741a58b49d90f84edfed6..cf63dfa11678189d73e4a4a854657c53fdcb7b9c 100644
--- a/src/fix_rigid.cpp
+++ b/src/fix_rigid.cpp
@@ -36,9 +36,6 @@ using namespace LAMMPS_NS;
 #define TOLERANCE 1.0e-6
 #define EPSILON 1.0e-7
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
@@ -71,7 +68,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
   // parse args for rigid body specification
   // set nbody and body[i] for each atom
 
-  if (narg < 4) error->all("Illegal fix rigid command");
+  if (narg < 4) error->all(FLERR,"Illegal fix rigid command");
   int iarg;
 
   // single rigid body
@@ -99,7 +96,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
   } else if (strcmp(arg[3],"molecule") == 0) {
     iarg = 4;
     if (atom->molecule_flag == 0)
-      error->all("Fix rigid molecule requires atom attribute molecule");
+      error->all(FLERR,"Fix rigid molecule requires atom attribute molecule");
 
     int *mask = atom->mask;
     int *molecule = atom->molecule;
@@ -141,17 +138,17 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
   // error if atom belongs to more than 1 rigid body
 
   } else if (strcmp(arg[3],"group") == 0) {
-    if (narg < 5) error->all("Illegal fix rigid command");
+    if (narg < 5) error->all(FLERR,"Illegal fix rigid command");
     nbody = atoi(arg[4]);
-    if (nbody <= 0) error->all("Illegal fix rigid command");
-    if (narg < 5+nbody) error->all("Illegal fix rigid command");
+    if (nbody <= 0) error->all(FLERR,"Illegal fix rigid command");
+    if (narg < 5+nbody) error->all(FLERR,"Illegal fix rigid command");
     iarg = 5+nbody;
 
     int *igroups = new int[nbody];
     for (ibody = 0; ibody < nbody; ibody++) {
       igroups[ibody] = group->find(arg[5+ibody]);
       if (igroups[ibody] == -1) 
-	error->all("Could not find fix rigid group ID");
+	error->all(FLERR,"Could not find fix rigid group ID");
     }
 
     int *mask = atom->mask;
@@ -171,15 +168,15 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
     int flagall;
     MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
     if (flagall) 
-      error->all("One or more atoms belong to multiple rigid bodies");
+      error->all(FLERR,"One or more atoms belong to multiple rigid bodies");
 
     delete [] igroups;
 
-  } else error->all("Illegal fix rigid command");
+  } else error->all(FLERR,"Illegal fix rigid command");
 
   // error check on nbody
 
-  if (nbody == 0) error->all("No rigid bodies defined");
+  if (nbody == 0) error->all(FLERR,"No rigid bodies defined");
 
   // create all nbody-length arrays
 
@@ -233,7 +230,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
 
   while (iarg < narg) {
     if (strcmp(arg[iarg],"force") == 0) {
-      if (iarg+5 > narg) error->all("Illegal fix rigid command");
+      if (iarg+5 > narg) error->all(FLERR,"Illegal fix rigid command");
 
       int mlo,mhi;
       force->bounds(arg[iarg+1],nbody,mlo,mhi);
@@ -241,16 +238,16 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
       double xflag,yflag,zflag;
       if (strcmp(arg[iarg+2],"off") == 0) xflag = 0.0;
       else if (strcmp(arg[iarg+2],"on") == 0) xflag = 1.0;
-      else error->all("Illegal fix rigid command");
+      else error->all(FLERR,"Illegal fix rigid command");
       if (strcmp(arg[iarg+3],"off") == 0) yflag = 0.0;
       else if (strcmp(arg[iarg+3],"on") == 0) yflag = 1.0;
-      else error->all("Illegal fix rigid command");
+      else error->all(FLERR,"Illegal fix rigid command");
       if (strcmp(arg[iarg+4],"off") == 0) zflag = 0.0;
       else if (strcmp(arg[iarg+4],"on") == 0) zflag = 1.0;
-      else error->all("Illegal fix rigid command");
+      else error->all(FLERR,"Illegal fix rigid command");
 
       if (domain->dimension == 2 && zflag == 1.0)
-	error->all("Fix rigid z force cannot be on for 2d simulation");
+	error->all(FLERR,"Fix rigid z force cannot be on for 2d simulation");
 
       int count = 0;
       for (int m = mlo; m <= mhi; m++) {
@@ -259,12 +256,12 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
 	fflag[m-1][2] = zflag;
 	count++;
       }
-      if (count == 0) error->all("Illegal fix rigid command");
+      if (count == 0) error->all(FLERR,"Illegal fix rigid command");
 
       iarg += 5;
 
     } else if (strcmp(arg[iarg],"torque") == 0) {
-      if (iarg+5 > narg) error->all("Illegal fix rigid command");
+      if (iarg+5 > narg) error->all(FLERR,"Illegal fix rigid command");
 
       int mlo,mhi;
       force->bounds(arg[iarg+1],nbody,mlo,mhi);
@@ -272,16 +269,16 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
       double xflag,yflag,zflag;
       if (strcmp(arg[iarg+2],"off") == 0) xflag = 0.0;
       else if (strcmp(arg[iarg+2],"on") == 0) xflag = 1.0;
-      else error->all("Illegal fix rigid command");
+      else error->all(FLERR,"Illegal fix rigid command");
       if (strcmp(arg[iarg+3],"off") == 0) yflag = 0.0;
       else if (strcmp(arg[iarg+3],"on") == 0) yflag = 1.0;
-      else error->all("Illegal fix rigid command");
+      else error->all(FLERR,"Illegal fix rigid command");
       if (strcmp(arg[iarg+4],"off") == 0) zflag = 0.0;
       else if (strcmp(arg[iarg+4],"on") == 0) zflag = 1.0;
-      else error->all("Illegal fix rigid command");
+      else error->all(FLERR,"Illegal fix rigid command");
 
       if (domain->dimension == 2 && (xflag == 1.0 || yflag == 1.0))
-	  error->all("Fix rigid xy torque cannot be on for 2d simulation");
+	  error->all(FLERR,"Fix rigid xy torque cannot be on for 2d simulation");
 
       int count = 0;
       for (int m = mlo; m <= mhi; m++) {
@@ -290,28 +287,28 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
 	tflag[m-1][2] = zflag;
 	count++;
       }
-      if (count == 0) error->all("Illegal fix rigid command");
+      if (count == 0) error->all(FLERR,"Illegal fix rigid command");
 
       iarg += 5;
 
     } else if (strcmp(arg[iarg],"langevin") == 0) {
-      if (iarg+5 > narg) error->all("Illegal fix rigid command");
+      if (iarg+5 > narg) error->all(FLERR,"Illegal fix rigid command");
       if (strcmp(style,"rigid") != 0 && strcmp(style,"rigid/nve") != 0)
-	error->all("Illegal fix rigid command");
+	error->all(FLERR,"Illegal fix rigid command");
       langflag = 1;
       t_start = atof(arg[iarg+1]);
       t_stop = atof(arg[iarg+2]);
       t_period = atof(arg[iarg+3]);
       seed = atoi(arg[iarg+4]);
       if (t_period <= 0.0) 
-	error->all("Fix rigid langevin period must be > 0.0");
-      if (seed <= 0) error->all("Illegal fix rigid command");
+	error->all(FLERR,"Fix rigid langevin period must be > 0.0");
+      if (seed <= 0) error->all(FLERR,"Illegal fix rigid command");
       iarg += 5;
 
     } else if (strcmp(arg[iarg],"temp") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix rigid command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid command");
       if (strcmp(style,"rigid/nvt") != 0 && strcmp(style,"rigid/npt") != 0)
-	error->all("Illegal fix rigid command");
+	error->all(FLERR,"Illegal fix rigid command");
       tempflag = 1;
       t_start = atof(arg[iarg+1]);
       t_stop = atof(arg[iarg+2]);
@@ -319,9 +316,9 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
       iarg += 4;
 
     } else if (strcmp(arg[iarg],"press") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix rigid command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid command");
       if (strcmp(style,"rigid/npt") != 0)
-	error->all("Illegal fix rigid command");
+	error->all(FLERR,"Illegal fix rigid command");
       pressflag = 1;
       p_start = atof(arg[iarg+1]);
       p_stop = atof(arg[iarg+2]);
@@ -329,22 +326,22 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
       iarg += 4;
 
     } else if (strcmp(arg[iarg],"tparam") == 0) {
-      if (iarg+4 > narg) error->all("Illegal fix rigid command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid command");
       if (strcmp(style,"rigid/nvt") != 0)
-	error->all("Illegal fix rigid command");
+	error->all(FLERR,"Illegal fix rigid command");
       t_chain = atoi(arg[iarg+1]);
       t_iter = atoi(arg[iarg+2]);
       t_order = atoi(arg[iarg+3]);
       iarg += 4;
 
     } else if (strcmp(arg[iarg],"pparam") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix rigid command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix rigid command");
       if (strcmp(style,"rigid/npt") != 0)
-	error->all("Illegal fix rigid command");
+	error->all(FLERR,"Illegal fix rigid command");
       p_chain = atoi(arg[iarg+1]);
       iarg += 2;
 
-    } else error->all("Illegal fix rigid command");
+    } else error->all(FLERR,"Illegal fix rigid command");
   }
 
   // initialize Marsaglia RNG with processor-unique seed
@@ -376,7 +373,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
   delete [] ncount;
 
   for (ibody = 0; ibody < nbody; ibody++)
-    if (nrigid[ibody] <= 1) error->all("One or zero atoms in rigid body");
+    if (nrigid[ibody] <= 1) error->all(FLERR,"One or zero atoms in rigid body");
 
   // set image flags for each rigid body to default values
   // will be reset during init() based on xcm and then by pre_neighbor()
@@ -481,7 +478,7 @@ void FixRigid::init()
   int count = 0;
   for (i = 0; i < modify->nfix; i++)
     if (strcmp(modify->fix[i]->style,"rigid") == 0) count++;
-  if (count > 1 && me == 0) error->warning("More than one fix rigid");
+  if (count > 1 && me == 0) error->warning(FLERR,"More than one fix rigid");
 
   // error if npt,nph fix comes before rigid fix
 
@@ -492,7 +489,7 @@ void FixRigid::init()
   if (i < modify->nfix) {
     for (int j = i; j < modify->nfix; j++)
       if (strcmp(modify->fix[j]->style,"rigid") == 0)
-	error->all("Rigid fix must come before NPT/NPH fix");
+	error->all(FLERR,"Rigid fix must come before NPT/NPH fix");
   }
 
   // timestep info
@@ -595,7 +592,7 @@ void FixRigid::init()
 
     if ((xbox && !periodicity[0]) || (ybox && !periodicity[1]) ||
 	(zbox && !periodicity[2]))
-	error->one("Fix rigid atom has non-zero image flag "
+	error->one(FLERR,"Fix rigid atom has non-zero image flag "
 		   "in a non-periodic dimension");
 
     if (triclinic == 0) {
@@ -718,7 +715,7 @@ void FixRigid::init()
     tensor[0][1] = tensor[1][0] = all[ibody][5];
 
     ierror = MathExtra::jacobi(tensor,inertia[ibody],evectors);
-    if (ierror) error->all("Insufficient Jacobi rotations for rigid body");
+    if (ierror) error->all(FLERR,"Insufficient Jacobi rotations for rigid body");
 
     ex_space[ibody][0] = evectors[0][0];
     ex_space[ibody][1] = evectors[1][0];
@@ -864,30 +861,30 @@ void FixRigid::init()
   for (ibody = 0; ibody < nbody; ibody++) {
     if (inertia[ibody][0] == 0.0) {
       if (fabs(all[ibody][0]) > TOLERANCE)
-	error->all("Fix rigid: Bad principal moments");
+	error->all(FLERR,"Fix rigid: Bad principal moments");
     } else {
       if (fabs((all[ibody][0]-inertia[ibody][0])/inertia[ibody][0]) > 
-	  TOLERANCE) error->all("Fix rigid: Bad principal moments");
+	  TOLERANCE) error->all(FLERR,"Fix rigid: Bad principal moments");
     }
     if (inertia[ibody][1] == 0.0) {
       if (fabs(all[ibody][1]) > TOLERANCE)
-	error->all("Fix rigid: Bad principal moments");
+	error->all(FLERR,"Fix rigid: Bad principal moments");
     } else {
       if (fabs((all[ibody][1]-inertia[ibody][1])/inertia[ibody][1]) > 
-	  TOLERANCE) error->all("Fix rigid: Bad principal moments");
+	  TOLERANCE) error->all(FLERR,"Fix rigid: Bad principal moments");
     }
     if (inertia[ibody][2] == 0.0) {
       if (fabs(all[ibody][2]) > TOLERANCE)
-	error->all("Fix rigid: Bad principal moments");
+	error->all(FLERR,"Fix rigid: Bad principal moments");
     } else {
       if (fabs((all[ibody][2]-inertia[ibody][2])/inertia[ibody][2]) > 
-	  TOLERANCE) error->all("Fix rigid: Bad principal moments");
+	  TOLERANCE) error->all(FLERR,"Fix rigid: Bad principal moments");
     }
     norm = (inertia[ibody][0] + inertia[ibody][1] + inertia[ibody][2]) / 3.0;
     if (fabs(all[ibody][3]/norm) > TOLERANCE || 
 	fabs(all[ibody][4]/norm) > TOLERANCE ||
 	fabs(all[ibody][5]/norm) > TOLERANCE)
-      error->all("Fix rigid: Bad principal moments");
+      error->all(FLERR,"Fix rigid: Bad principal moments");
   }
 
   // temperature scale factor
@@ -1459,7 +1456,7 @@ int FixRigid::dof(int igroup)
 	nall[ibody]+mall[ibody] != nrigid[ibody]) flag = 1;
   }
   if (flag && me == 0)
-    error->warning("Computing temperature of portions of rigid bodies");
+    error->warning(FLERR,"Computing temperature of portions of rigid bodies");
 
   // remove appropriate DOFs for each rigid body wholly in temperature group
   // N = # of point particles in body
diff --git a/src/fix_rigid_nvt.cpp b/src/fix_rigid_nvt.cpp
index bad5e961df6bf711e029a6ec3b19012b91bef56c..824f8b4bbf499f205bf28d3a8352dffd953168fa 100644
--- a/src/fix_rigid_nvt.cpp
+++ b/src/fix_rigid_nvt.cpp
@@ -51,16 +51,16 @@ FixRigidNVT::FixRigidNVT(LAMMPS *lmp, int narg, char **arg) :
   // convert input period to frequency
 
   if (tempflag == 0)
-    error->all("Did not set temp for fix rigid/nvt");
+    error->all(FLERR,"Did not set temp for fix rigid/nvt");
   if (t_start < 0.0 || t_stop <= 0.0)
-    error->all("Target temperature for fix rigid/nvt cannot be 0.0");
-  if (t_period <= 0.0) error->all("Fix rigid/nvt period must be > 0.0");
+    error->all(FLERR,"Target temperature for fix rigid/nvt cannot be 0.0");
+  if (t_period <= 0.0) error->all(FLERR,"Fix rigid/nvt period must be > 0.0");
   t_freq = 1.0 / t_period;
 
-  if (t_chain < 1) error->all("Illegal fix_modify command");
-  if (t_iter < 1) error->all("Illegal fix_modify command");
+  if (t_chain < 1) error->all(FLERR,"Illegal fix_modify command");
+  if (t_iter < 1) error->all(FLERR,"Illegal fix_modify command");
   if (t_order != 3 && t_order != 5) 
-    error->all("Fix_modify order must be 3 or 5"); 
+    error->all(FLERR,"Fix_modify order must be 3 or 5"); 
   
   allocate_chain();
   allocate_order();
@@ -647,7 +647,7 @@ void FixRigidNVT::restart(char *buf)
   
   int t_chain_prev = static_cast<int> (list[n++]);
   if (t_chain_prev != t_chain)
-    error->all("Cannot restart fix rigid/nvt with different # of chains");
+    error->all(FLERR,"Cannot restart fix rigid/nvt with different # of chains");
 
   for (int i = 0; i < t_chain; i++) {
     eta_t[i] = list[n++];
diff --git a/src/fix_setforce.cpp b/src/fix_setforce.cpp
index 897aad56a99ffa879c66d3223e753cc156f29794..c7dba74f59937da0c1c05002e9945c01145e2c0c 100644
--- a/src/fix_setforce.cpp
+++ b/src/fix_setforce.cpp
@@ -34,7 +34,7 @@ enum{NONE,CONSTANT,EQUAL,ATOM};
 FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 6) error->all("Illegal fix setforce command");
+  if (narg < 6) error->all(FLERR,"Illegal fix setforce command");
 
   vector_flag = 1;
   size_vector = 3;
@@ -82,15 +82,15 @@ FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) :
   int iarg = 6;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"region") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix setforce command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix setforce command");
       iregion = domain->find_region(arg[iarg+1]);
       if (iregion == -1)
-	error->all("Region ID for fix setforce does not exist");
+	error->all(FLERR,"Region ID for fix setforce does not exist");
       int n = strlen(arg[iarg+1]) + 1;
       idregion = new char[n];
       strcpy(idregion,arg[iarg+1]);
       iarg += 2;
-    } else error->all("Illegal fix setforce command");
+    } else error->all(FLERR,"Illegal fix setforce command");
   }
 
   force_flag = 0;
@@ -130,31 +130,31 @@ void FixSetForce::init()
 
   if (xstr) {
     xvar = input->variable->find(xstr);
-    if (xvar < 0) error->all("Variable name for fix setforce does not exist");
+    if (xvar < 0) error->all(FLERR,"Variable name for fix setforce does not exist");
     if (input->variable->equalstyle(xvar)) xstyle = EQUAL;
     else if (input->variable->atomstyle(xvar)) xstyle = ATOM;
-    else error->all("Variable for fix setforce is invalid style");
+    else error->all(FLERR,"Variable for fix setforce is invalid style");
   }
   if (ystr) {
     yvar = input->variable->find(ystr);
-    if (yvar < 0) error->all("Variable name for fix setforce does not exist");
+    if (yvar < 0) error->all(FLERR,"Variable name for fix setforce does not exist");
     if (input->variable->equalstyle(yvar)) ystyle = EQUAL;
     else if (input->variable->atomstyle(yvar)) ystyle = ATOM;
-    else error->all("Variable for fix setforce is invalid style");
+    else error->all(FLERR,"Variable for fix setforce is invalid style");
   }
   if (zstr) {
     zvar = input->variable->find(zstr);
-    if (zvar < 0) error->all("Variable name for fix setforce does not exist");
+    if (zvar < 0) error->all(FLERR,"Variable name for fix setforce does not exist");
     if (input->variable->equalstyle(zvar)) zstyle = EQUAL;
     else if (input->variable->atomstyle(zvar)) zstyle = ATOM;
-    else error->all("Variable for fix setforce is invalid style");
+    else error->all(FLERR,"Variable for fix setforce is invalid style");
   }
 
   // set index and check validity of region
 
   if (iregion >= 0) {
     iregion = domain->find_region(idregion);
-    if (iregion == -1) error->all("Region ID for fix setforce does not exist");
+    if (iregion == -1) error->all(FLERR,"Region ID for fix setforce does not exist");
   }
 
   if (xstyle == ATOM || ystyle == ATOM || zstyle == ATOM) 
@@ -179,7 +179,7 @@ void FixSetForce::init()
     if (zstyle == CONSTANT && zvalue != 0.0) flag = 1;
   }
   if (flag) 
-    error->all("Cannot use non-zero forces in an energy minimization");
+    error->all(FLERR,"Cannot use non-zero forces in an energy minimization");
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/fix_shake.cpp b/src/fix_shake.cpp
index fca15216f3574f553e4309b8ef98296ced2ee32e..e00e84e424fefb1ab850aa582dc99167b7f1eae0 100644
--- a/src/fix_shake.cpp
+++ b/src/fix_shake.cpp
@@ -37,8 +37,6 @@ using namespace LAMMPS_NS;
 
 #define BIG 1.0e20
 #define MASSDELTA 0.1
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
 
 /* ---------------------------------------------------------------------- */
 
@@ -56,7 +54,7 @@ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) :
   // error check
 
   if (atom->molecular == 0)
-    error->all("Cannot use fix shake with non-molecular system");
+    error->all(FLERR,"Cannot use fix shake with non-molecular system");
 
   // perform initial allocation of atom-based arrays
   // register with Atom class
@@ -74,7 +72,7 @@ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) :
 
   // parse SHAKE args
 
-  if (narg < 8) error->all("Illegal fix shake command");
+  if (narg < 8) error->all(FLERR,"Illegal fix shake command");
 
   tolerance = atof(arg[3]);
   max_iter = atoi(arg[4]);
@@ -109,28 +107,28 @@ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) :
     } else if (mode == 'b') {
       int i = atoi(arg[next]);
       if (i < 1 || i > atom->nbondtypes) 
-	error->all("Invalid bond type index for fix shake");
+	error->all(FLERR,"Invalid bond type index for fix shake");
       bond_flag[i] = 1;
 
     } else if (mode == 'a') {
       int i = atoi(arg[next]);
       if (i < 1 || i > atom->nangletypes) 
-	error->all("Invalid angle type index for fix shake");
+	error->all(FLERR,"Invalid angle type index for fix shake");
       angle_flag[i] = 1;
 
     } else if (mode == 't') {
       int i = atoi(arg[next]);
       if (i < 1 || i > atom->ntypes) 
-	error->all("Invalid atom type index for fix shake");
+	error->all(FLERR,"Invalid atom type index for fix shake");
       type_flag[i] = 1;
 
     } else if (mode == 'm') {
       double massone = atof(arg[next]);
-      if (massone == 0.0) error->all("Invalid atom mass for fix shake");
-      if (nmass == atom->ntypes) error->all("Too many masses for fix shake");
+      if (massone == 0.0) error->all(FLERR,"Invalid atom mass for fix shake");
+      if (nmass == atom->ntypes) error->all(FLERR,"Too many masses for fix shake");
       mass_list[nmass++] = massone;
 
-    } else error->all("Illegal fix shake command");
+    } else error->all(FLERR,"Illegal fix shake command");
     next++;
   }
 
@@ -280,13 +278,13 @@ void FixShake::init()
   int count = 0;
   for (i = 0; i < modify->nfix; i++)
     if (strcmp(modify->fix[i]->style,"shake") == 0) count++;
-  if (count > 1) error->all("More than one fix shake");
+  if (count > 1) error->all(FLERR,"More than one fix shake");
 
   // cannot use with minimization since SHAKE turns off bonds
   // that should contribute to potential energy
 
   if (update->whichflag == 2)
-    error->all("Fix shake cannot be used with minimization");
+    error->all(FLERR,"Fix shake cannot be used with minimization");
 
   // error if npt,nph fix comes before shake fix
 
@@ -297,7 +295,7 @@ void FixShake::init()
   if (i < modify->nfix) {
     for (int j = i; j < modify->nfix; j++)
       if (strcmp(modify->fix[j]->style,"shake") == 0)
-	error->all("Shake fix must come before NPT/NPH fix");
+	error->all(FLERR,"Shake fix must come before NPT/NPH fix");
   }
 
   // if rRESPA, find associated fix that must exist
@@ -315,7 +313,7 @@ void FixShake::init()
   // set equilibrium bond distances
 
   if (force->bond == NULL)
-    error->all("Bond potential must be defined for SHAKE");
+    error->all(FLERR,"Bond potential must be defined for SHAKE");
   for (i = 1; i <= atom->nbondtypes; i++) 
     bond_distance[i] = force->bond->equilibrium_distance(i);
 
@@ -326,7 +324,7 @@ void FixShake::init()
   for (i = 1; i <= atom->nangletypes; i++) {
     if (angle_flag[i] == 0) continue;
     if (force->angle == NULL)
-      error->all("Angle potential must be defined for SHAKE");
+      error->all(FLERR,"Angle potential must be defined for SHAKE");
 
     // scan all atoms for a SHAKE angle cluster
     // extract bond types for the 2 bonds in the cluster
@@ -353,7 +351,7 @@ void FixShake::init()
     // error check for any bond types that are not the same
     
     MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_MAX,world);
-    if (flag_all) error->all("Shake angles have different bond types");
+    if (flag_all) error->all(FLERR,"Shake angles have different bond types");
     
     // insure all procs have bond types
     
@@ -458,7 +456,7 @@ void FixShake::pre_neighbor()
 	  sprintf(str,
 		  "Shake atoms %d %d missing on proc %d at step " BIGINT_FORMAT,
 		  shake_atom[i][0],shake_atom[i][1],me,update->ntimestep);
-	  error->one(str);
+	  error->one(FLERR,str);
 	}
 	if (i <= atom1 && i <= atom2) list[nlist++] = i;
       } else if (shake_flag[i] % 2 == 1) {
@@ -472,7 +470,7 @@ void FixShake::pre_neighbor()
 		  BIGINT_FORMAT,
 		  shake_atom[i][0],shake_atom[i][1],shake_atom[i][2],
 		  me,update->ntimestep);
-	  error->one(str);
+	  error->one(FLERR,str);
 	}
 	if (i <= atom1 && i <= atom2 && i <= atom3) list[nlist++] = i;
       } else {
@@ -488,7 +486,7 @@ void FixShake::pre_neighbor()
 		  shake_atom[i][0],shake_atom[i][1],
 		  shake_atom[i][2],shake_atom[i][3],
 		  me,update->ntimestep);
-	  error->one(str);
+	  error->one(FLERR,str);
 	}
 	if (i <= atom1 && i <= atom2 && i <= atom3 && i <= atom4) 
 	  list[nlist++] = i;
@@ -813,7 +811,7 @@ void FixShake::find_clusters()
     }
 
   MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_SUM,world);
-  if (flag_all) error->all("Did not find fix shake partner info");
+  if (flag_all) error->all(FLERR,"Did not find fix shake partner info");
 
   // -----------------------------------------------------
   // identify SHAKEable bonds
@@ -947,7 +945,7 @@ void FixShake::find_clusters()
   flag = 0;
   for (i = 0; i < nlocal; i++) if (nshake[i] > 3) flag = 1;
   MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_SUM,world);
-  if (flag_all) error->all("Shake cluster of more than 4 atoms");
+  if (flag_all) error->all(FLERR,"Shake cluster of more than 4 atoms");
 
   flag = 0;
   for (i = 0; i < nlocal; i++) {
@@ -956,7 +954,7 @@ void FixShake::find_clusters()
       if (partner_shake[i][j] && partner_nshake[i][j] > 1) flag = 1;
   }
   MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_SUM,world);
-  if (flag_all) error->all("Shake clusters are connected");
+  if (flag_all) error->all(FLERR,"Shake clusters are connected");
 
   // -----------------------------------------------------
   // set SHAKE arrays that are stored with atoms & add angle constraints
@@ -1349,7 +1347,7 @@ void FixShake::shake2(int m)
 
   double determ = b*b - 4.0*a*c;
   if (determ < 0.0) {
-    error->warning("Shake determinant < 0.0",0);
+    error->warning(FLERR,"Shake determinant < 0.0",0);
     determ = 0.0;
   }
 
@@ -1469,7 +1467,7 @@ void FixShake::shake3(int m)
   // inverse of matrix
 
   double determ = a11*a22 - a12*a21;
-  if (determ == 0.0) error->one("Shake determinant = 0.0");
+  if (determ == 0.0) error->one(FLERR,"Shake determinant = 0.0");
   double determinv = 1.0/determ;
   
   double a11inv = a22*determinv;
@@ -1663,7 +1661,7 @@ void FixShake::shake4(int m)
 
   double determ = a11*a22*a33 + a12*a23*a31 + a13*a21*a32 -
     a11*a23*a32 - a12*a21*a33 - a13*a22*a31;
-  if (determ == 0.0) error->one("Shake determinant = 0.0");
+  if (determ == 0.0) error->one(FLERR,"Shake determinant = 0.0");
   double determinv = 1.0/determ;
   
   double a11inv = determinv * (a22*a33 - a23*a32);
@@ -1903,7 +1901,7 @@ void FixShake::shake3angle(int m)
 
   double determ = a11*a22*a33 + a12*a23*a31 + a13*a21*a32 -
     a11*a23*a32 - a12*a21*a33 - a13*a22*a31;
-  if (determ == 0.0) error->one("Shake determinant = 0.0");
+  if (determ == 0.0) error->one(FLERR,"Shake determinant = 0.0");
   double determinv = 1.0/determ;
   
   double a11inv = determinv * (a22*a33 - a23*a32);
diff --git a/src/fix_shear_history.cpp b/src/fix_shear_history.cpp
index 0740a2f2571aaef9c5ee511289d7f288492112ec..4e284c7f65a6174ab9458a9c4bb455300d218e4d 100644
--- a/src/fix_shear_history.cpp
+++ b/src/fix_shear_history.cpp
@@ -86,7 +86,7 @@ int FixShearHistory::setmask()
 void FixShearHistory::init()
 {
   if (atom->tag_enable == 0) 
-    error->all("Pair style granular with history requires atoms have IDs");
+    error->all(FLERR,"Pair style granular with history requires atoms have IDs");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -166,7 +166,7 @@ void FixShearHistory::pre_exchange()
     if (npartner[i] >= MAXTOUCH) flag = 1;
   int flag_all;
   MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_SUM,world);
-  if (flag_all) error->all("Too many touching neighbors - boost MAXTOUCH");
+  if (flag_all) error->all(FLERR,"Too many touching neighbors - boost MAXTOUCH");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/fix_spring.cpp b/src/fix_spring.cpp
index d6666f2b473ff74a968e62022630ae15ab920c37..f3ac3e378b9207223b6cccf4546c462267deba60 100644
--- a/src/fix_spring.cpp
+++ b/src/fix_spring.cpp
@@ -30,9 +30,6 @@ using namespace LAMMPS_NS;
 
 #define SMALL 1.0e-10
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 enum{TETHER,COUPLE};
 
 /* ---------------------------------------------------------------------- */
@@ -40,7 +37,7 @@ enum{TETHER,COUPLE};
 FixSpring::FixSpring(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 9) error->all("Illegal fix spring command");
+  if (narg < 9) error->all(FLERR,"Illegal fix spring command");
 
   scalar_flag = 1;
   vector_flag = 1;
@@ -52,7 +49,7 @@ FixSpring::FixSpring(LAMMPS *lmp, int narg, char **arg) :
   group2 = NULL;
 
   if (strcmp(arg[3],"tether") == 0) {
-    if (narg != 9) error->all("Illegal fix spring command");
+    if (narg != 9) error->all(FLERR,"Illegal fix spring command");
     styleflag = TETHER;
     k_spring = atof(arg[4]);
     xflag = yflag = zflag = 1;
@@ -63,10 +60,10 @@ FixSpring::FixSpring(LAMMPS *lmp, int narg, char **arg) :
     if (strcmp(arg[7],"NULL") == 0) zflag = 0;
     else zc = atof(arg[7]);
     r0 = atof(arg[8]);
-    if (r0 < 0) error->all("R0 < 0 for fix spring command");
+    if (r0 < 0) error->all(FLERR,"R0 < 0 for fix spring command");
 
   } else if (strcmp(arg[3],"couple") == 0) {
-    if (narg != 10) error->all("Illegal fix spring command");
+    if (narg != 10) error->all(FLERR,"Illegal fix spring command");
     styleflag = COUPLE;
 
     int n = strlen(arg[4]) + 1;
@@ -74,9 +71,9 @@ FixSpring::FixSpring(LAMMPS *lmp, int narg, char **arg) :
     strcpy(group2,arg[4]);
     igroup2 = group->find(arg[4]);
     if (igroup2 == -1) 
-      error->all("Fix spring couple group ID does not exist"); 
+      error->all(FLERR,"Fix spring couple group ID does not exist"); 
     if (igroup2 == igroup) 
-      error->all("Two groups cannot be the same in fix spring couple"); 
+      error->all(FLERR,"Two groups cannot be the same in fix spring couple"); 
     group2bit = group->bitmask[igroup2];
 
     k_spring = atof(arg[5]);
@@ -88,9 +85,9 @@ FixSpring::FixSpring(LAMMPS *lmp, int narg, char **arg) :
     if (strcmp(arg[8],"NULL") == 0) zflag = 0;
     else zc = atof(arg[8]);
     r0 = atof(arg[9]);
-    if (r0 < 0) error->all("R0 < 0 for fix spring command");
+    if (r0 < 0) error->all(FLERR,"R0 < 0 for fix spring command");
 
-  } else error->all("Illegal fix spring command");
+  } else error->all(FLERR,"Illegal fix spring command");
 
   ftotal[0] = ftotal[1] = ftotal[2] = ftotal[3] = 0.0;
 }
@@ -123,7 +120,7 @@ void FixSpring::init()
   if (group2) {
     igroup2 = group->find(group2);
     if (igroup2 == -1) 
-      error->all("Fix spring couple group ID does not exist"); 
+      error->all(FLERR,"Fix spring couple group ID does not exist"); 
     group2bit = group->bitmask[igroup2];
   }
 
diff --git a/src/fix_spring_rg.cpp b/src/fix_spring_rg.cpp
index e4d55eba2d46a686313d9cfdc1016285b778592f..4723c8fdb9319351bd859f40accd671e216b0f15 100644
--- a/src/fix_spring_rg.cpp
+++ b/src/fix_spring_rg.cpp
@@ -34,7 +34,7 @@ using namespace LAMMPS_NS;
 FixSpringRG::FixSpringRG(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg != 5) error->all("Illegal fix spring/rg command");
+  if (narg != 5) error->all(FLERR,"Illegal fix spring/rg command");
 
   k = atof(arg[3]);
   rg0_flag = 0;
diff --git a/src/fix_spring_self.cpp b/src/fix_spring_self.cpp
index 849d7c47875f4e8d21e6aeca37307494d44d4b6a..6fb3472fb6022a8fa9d275062aecb926a7e32c0c 100644
--- a/src/fix_spring_self.cpp
+++ b/src/fix_spring_self.cpp
@@ -32,7 +32,7 @@ using namespace LAMMPS_NS;
 FixSpringSelf::FixSpringSelf(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg != 4) error->all("Illegal fix spring/self command");
+  if (narg != 4) error->all(FLERR,"Illegal fix spring/self command");
 
   restart_peratom = 1;
   scalar_flag = 1;
@@ -40,7 +40,7 @@ FixSpringSelf::FixSpringSelf(LAMMPS *lmp, int narg, char **arg) :
   extscalar = 1;
 
   k = atof(arg[3]);
-  if (k <= 0.0) error->all("Illegal fix spring/self command");
+  if (k <= 0.0) error->all(FLERR,"Illegal fix spring/self command");
 
   // perform initial allocation of atom-based array
   // register with Atom class
diff --git a/src/fix_store_force.cpp b/src/fix_store_force.cpp
index 5d1e52b64d485593bba3df07572d3492bc6087d1..98c5f918f87bde8e9bdccd4de2b84f50328cf3f0 100644
--- a/src/fix_store_force.cpp
+++ b/src/fix_store_force.cpp
@@ -27,7 +27,7 @@ using namespace LAMMPS_NS;
 FixStoreForce::FixStoreForce(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 3) error->all("Illegal fix store/coord command");
+  if (narg < 3) error->all(FLERR,"Illegal fix store/coord command");
 
   peratom_flag = 1;
   size_peratom_cols = 3;
diff --git a/src/fix_store_state.cpp b/src/fix_store_state.cpp
index 7f49140d57540fe4aab00de72ea9abac331aafdd..8a90365e0fe6a22ea28f196354c79bb5192a5a2d 100644
--- a/src/fix_store_state.cpp
+++ b/src/fix_store_state.cpp
@@ -37,13 +37,13 @@ enum{KEYWORD,COMPUTE,FIX,VARIABLE};
 FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 5) error->all("Illegal fix store/state command");
+  if (narg < 5) error->all(FLERR,"Illegal fix store/state command");
 
   restart_peratom = 1;
   peratom_freq = 1;
 
   nevery = atoi(arg[3]);
-  if (nevery < 0) error->all("Illegal fix store/state command");
+  if (nevery < 0) error->all(FLERR,"Illegal fix store/state command");
 
   // parse values until one isn't recognized
   // customize a new keyword by adding to if statement
@@ -65,7 +65,7 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) :
       pack_choice[nvalues++] = &FixStoreState::pack_id;
     } else if (strcmp(arg[iarg],"mol") == 0) {
       if (!atom->molecule_flag)
-	error->all("Fix store/state for atom property that isn't allocated");
+	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_molecule;
     } else if (strcmp(arg[iarg],"type") == 0) {
       pack_choice[nvalues++] = &FixStoreState::pack_type;
@@ -124,60 +124,60 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) :
 
     } else if (strcmp(arg[iarg],"q") == 0) {
       if (!atom->q_flag)
-	error->all("Fix store/state for atom property that isn't allocated");
+	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_q;
     } else if (strcmp(arg[iarg],"mux") == 0) {
       if (!atom->mu_flag)
-	error->all("Fix store/state for atom property that isn't allocated");
+	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_mux;
     } else if (strcmp(arg[iarg],"muy") == 0) {
       if (!atom->mu_flag)
-	error->all("Fix store/state for atom property that isn't allocated");
+	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_muy;
     } else if (strcmp(arg[iarg],"muz") == 0) {
       if (!atom->mu_flag)
-	error->all("Fix store/state for atom property that isn't allocated");
+	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_muz;
 
     } else if (strcmp(arg[iarg],"radius") == 0) {
       if (!atom->radius_flag)
-	error->all("Fix store/state for atom property that isn't allocated");
+	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_radius;
     } else if (strcmp(arg[iarg],"omegax") == 0) {
       if (!atom->omega_flag)
-	error->all("Fix store/state for atom property that isn't allocated");
+	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_omegax;
     } else if (strcmp(arg[iarg],"omegay") == 0) {
       if (!atom->omega_flag)
-	error->all("Fix store/state for atom property that isn't allocated");
+	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_omegay;
     } else if (strcmp(arg[iarg],"omegaz") == 0) {
       if (!atom->omega_flag)
-	error->all("Fix store/state for atom property that isn't allocated");
+	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_omegaz;
     } else if (strcmp(arg[iarg],"angmomx") == 0) {
       if (!atom->angmom_flag)
-	error->all("Fix store/state for atom property that isn't allocated");
+	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_angmomx;
     } else if (strcmp(arg[iarg],"angmomy") == 0) {
       if (!atom->angmom_flag)
-	error->all("Fix store/state for atom property that isn't allocated");
+	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_angmomy;
     } else if (strcmp(arg[iarg],"angmomz") == 0) {
       if (!atom->angmom_flag)
-	error->all("Fix store/state for atom property that isn't allocated");
+	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_angmomz;
     } else if (strcmp(arg[iarg],"tqx") == 0) {
       if (!atom->torque_flag)
-	error->all("Fix store/state for atom property that isn't allocated");
+	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_tqx;
     } else if (strcmp(arg[iarg],"tqy") == 0) {
       if (!atom->torque_flag)
-	error->all("Fix store/state for atom property that isn't allocated");
+	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_tqy;
     } else if (strcmp(arg[iarg],"tqz") == 0) {
       if (!atom->torque_flag)
-	error->all("Fix store/state for atom property that isn't allocated");
+	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_tqz;
 
     } else if (strncmp(arg[iarg],"c_",2) == 0 || 
@@ -195,7 +195,7 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) :
       char *ptr = strchr(suffix,'[');
       if (ptr) {
 	if (suffix[strlen(suffix)-1] != ']')
-	  error->all("Illegal fix store/state command");
+	  error->all(FLERR,"Illegal fix store/state command");
 	argindex[nvalues] = atoi(ptr+1);
 	*ptr = '\0';
       } else argindex[nvalues] = 0;
@@ -217,12 +217,12 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) :
 
   while (iarg < narg) {
     if (strcmp(arg[iarg],"com") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix store/state command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix store/state command");
       if (strcmp(arg[iarg+1],"no") == 0) comflag = 0;
       else if (strcmp(arg[iarg+1],"yes") == 0) comflag = 1;
-      else error->all("Illegal fix store/state command");
+      else error->all(FLERR,"Illegal fix store/state command");
       iarg += 2;
-    } else error->all("Illegal fix store/state command");
+    } else error->all(FLERR,"Illegal fix store/state command");
   }
 
   // error check
@@ -231,42 +231,42 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) :
     if (which[i] == COMPUTE) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all("Compute ID for fix store/state does not exist");
+	error->all(FLERR,"Compute ID for fix store/state does not exist");
       if (modify->compute[icompute]->peratom_flag == 0)
-	error->all("Fix store/state compute "
+	error->all(FLERR,"Fix store/state compute "
 		   "does not calculate per-atom values");
       if (argindex[i] == 0 && 
 	  modify->compute[icompute]->size_peratom_cols != 0)
-	error->all("Fix store/state compute does not "
+	error->all(FLERR,"Fix store/state compute does not "
 		   "calculate a per-atom vector");
       if (argindex[i] && modify->compute[icompute]->size_peratom_cols == 0)
-	error->all("Fix store/state compute does not "
+	error->all(FLERR,"Fix store/state compute does not "
 		   "calculate a per-atom array");
       if (argindex[i] && 
 	  argindex[i] > modify->compute[icompute]->size_peratom_cols)
-	error->all("Fix store/state compute array is accessed out-of-range");
+	error->all(FLERR,"Fix store/state compute array is accessed out-of-range");
 
     } else if (which[i] == FIX) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0)
-	error->all("Fix ID for fix store/state does not exist");
+	error->all(FLERR,"Fix ID for fix store/state does not exist");
       if (modify->fix[ifix]->peratom_flag == 0)
-	error->all("Fix store/state fix does not calculate per-atom values");
+	error->all(FLERR,"Fix store/state fix does not calculate per-atom values");
       if (argindex[i] == 0 && modify->fix[ifix]->size_peratom_cols != 0)
-	error->all("Fix store/state fix does not calculate a per-atom vector");
+	error->all(FLERR,"Fix store/state fix does not calculate a per-atom vector");
       if (argindex[i] && modify->fix[ifix]->size_peratom_cols == 0)
-	error->all("Fix store/state fix does not calculate a per-atom array");
+	error->all(FLERR,"Fix store/state fix does not calculate a per-atom array");
       if (argindex[i] && argindex[i] > modify->fix[ifix]->size_peratom_cols)
-	error->all("Fix store/state fix array is accessed out-of-range");
+	error->all(FLERR,"Fix store/state fix array is accessed out-of-range");
       if (nevery % modify->fix[ifix]->peratom_freq)
-	error->all("Fix for fix store/state not computed at compatible time");
+	error->all(FLERR,"Fix for fix store/state not computed at compatible time");
 
     } else if (which[i] == VARIABLE) {
       int ivariable = input->variable->find(ids[i]);
       if (ivariable < 0)
-	error->all("Variable name for fix store/state does not exist");
+	error->all(FLERR,"Variable name for fix store/state does not exist");
       if (input->variable->atomstyle(ivariable) == 0)
-	error->all("Fix store/state variable is not atom-style variable");
+	error->all(FLERR,"Fix store/state variable is not atom-style variable");
     }
   }
 
@@ -338,19 +338,19 @@ void FixStoreState::init()
     if (which[m] == COMPUTE) {
       int icompute = modify->find_compute(ids[m]);
       if (icompute < 0)
-	error->all("Compute ID for fix store/state does not exist");
+	error->all(FLERR,"Compute ID for fix store/state does not exist");
       value2index[m] = icompute;
       
     } else if (which[m] == FIX) {
       int ifix = modify->find_fix(ids[m]);
       if (ifix < 0) 
-	error->all("Fix ID for fix store/state does not exist");
+	error->all(FLERR,"Fix ID for fix store/state does not exist");
       value2index[m] = ifix;
 
     } else if (which[m] == VARIABLE) {
       int ivariable = input->variable->find(ids[m]);
       if (ivariable < 0) 
-	error->all("Variable name for fix store/state does not exist");
+	error->all(FLERR,"Variable name for fix store/state does not exist");
       value2index[m] = ivariable;
     }
   }
diff --git a/src/fix_temp_berendsen.cpp b/src/fix_temp_berendsen.cpp
index a74de7d36de867c2394cc844a7bc990e00a23d52..bed8d8bb6842880313f675408e84cfa96a2f7e69 100644
--- a/src/fix_temp_berendsen.cpp
+++ b/src/fix_temp_berendsen.cpp
@@ -33,7 +33,7 @@ enum{NOBIAS,BIAS};
 FixTempBerendsen::FixTempBerendsen(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg != 6) error->all("Illegal fix temp/berendsen command");
+  if (narg != 6) error->all(FLERR,"Illegal fix temp/berendsen command");
 
   // Berendsen thermostat should be applied every step
 
@@ -48,7 +48,7 @@ FixTempBerendsen::FixTempBerendsen(LAMMPS *lmp, int narg, char **arg) :
 
   // error checks
 
-  if (t_period <= 0.0) error->all("Fix temp/berendsen period must be > 0.0");
+  if (t_period <= 0.0) error->all(FLERR,"Fix temp/berendsen period must be > 0.0");
 
   // create a new compute temp style
   // id = fix-ID + temp, compute group = fix group
@@ -95,7 +95,7 @@ void FixTempBerendsen::init()
 {
   int icompute = modify->find_compute(id_temp);
   if (icompute < 0)
-    error->all("Temperature ID for fix temp/berendsen does not exist");
+    error->all(FLERR,"Temperature ID for fix temp/berendsen does not exist");
   temperature = modify->compute[icompute];
 
   if (temperature->tempbias) which = BIAS;
@@ -108,7 +108,7 @@ void FixTempBerendsen::end_of_step()
 {
   double t_current = temperature->compute_scalar();
   if (t_current == 0.0)
-    error->all("Computed temperature for fix temp/berendsen cannot be 0.0");
+    error->all(FLERR,"Computed temperature for fix temp/berendsen cannot be 0.0");
 
   double delta = update->ntimestep - update->beginstep;
   delta /= update->endstep - update->beginstep;
@@ -153,7 +153,7 @@ void FixTempBerendsen::end_of_step()
 int FixTempBerendsen::modify_param(int narg, char **arg)
 {
   if (strcmp(arg[0],"temp") == 0) {
-    if (narg < 2) error->all("Illegal fix_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
     if (tflag) {
       modify->delete_compute(id_temp);
       tflag = 0;
@@ -164,13 +164,13 @@ int FixTempBerendsen::modify_param(int narg, char **arg)
     strcpy(id_temp,arg[1]);
 
     int icompute = modify->find_compute(id_temp);
-    if (icompute < 0) error->all("Could not find fix_modify temperature ID");
+    if (icompute < 0) error->all(FLERR,"Could not find fix_modify temperature ID");
     temperature = modify->compute[icompute];
 
     if (temperature->tempflag == 0)
-      error->all("Fix_modify temperature ID does not compute temperature");
+      error->all(FLERR,"Fix_modify temperature ID does not compute temperature");
     if (temperature->igroup != igroup && comm->me == 0)
-      error->warning("Group for fix_modify temp != fix group");
+      error->warning(FLERR,"Group for fix_modify temp != fix group");
     return 2;
   }
   return 0;
diff --git a/src/fix_temp_rescale.cpp b/src/fix_temp_rescale.cpp
index 1b4c8f3f04a4eb71f5874a3f8fa3e0b706752f33..d0d67368bc0e4168303c15158fc48070b72c2884 100644
--- a/src/fix_temp_rescale.cpp
+++ b/src/fix_temp_rescale.cpp
@@ -35,10 +35,10 @@ enum{NOBIAS,BIAS};
 FixTempRescale::FixTempRescale(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 8) error->all("Illegal fix temp/rescale command");
+  if (narg < 8) error->all(FLERR,"Illegal fix temp/rescale command");
 
   nevery = atoi(arg[3]);
-  if (nevery <= 0) error->all("Illegal fix temp/rescale command");
+  if (nevery <= 0) error->all(FLERR,"Illegal fix temp/rescale command");
 
   scalar_flag = 1;
   global_freq = nevery;
@@ -94,7 +94,7 @@ void FixTempRescale::init()
 {
   int icompute = modify->find_compute(id_temp);
   if (icompute < 0) 
-    error->all("Temperature ID for fix temp/rescale does not exist");
+    error->all(FLERR,"Temperature ID for fix temp/rescale does not exist");
   temperature = modify->compute[icompute];
 
   if (temperature->tempbias) which = BIAS;
@@ -107,7 +107,7 @@ void FixTempRescale::end_of_step()
 {
   double t_current = temperature->compute_scalar();
   if (t_current == 0.0)
-    error->all("Computed temperature for fix temp/rescale cannot be 0.0");
+    error->all(FLERR,"Computed temperature for fix temp/rescale cannot be 0.0");
 
   double delta = update->ntimestep - update->beginstep;
   delta /= update->endstep - update->beginstep;
@@ -157,7 +157,7 @@ void FixTempRescale::end_of_step()
 int FixTempRescale::modify_param(int narg, char **arg)
 {
   if (strcmp(arg[0],"temp") == 0) {
-    if (narg < 2) error->all("Illegal fix_modify command");
+    if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
     if (tflag) {
       modify->delete_compute(id_temp);
       tflag = 0;
@@ -168,13 +168,13 @@ int FixTempRescale::modify_param(int narg, char **arg)
     strcpy(id_temp,arg[1]);
 
     int icompute = modify->find_compute(id_temp);
-    if (icompute < 0) error->all("Could not find fix_modify temperature ID");
+    if (icompute < 0) error->all(FLERR,"Could not find fix_modify temperature ID");
     temperature = modify->compute[icompute];
 
     if (temperature->tempflag == 0)
-      error->all("Fix_modify temperature ID does not compute temperature");
+      error->all(FLERR,"Fix_modify temperature ID does not compute temperature");
     if (temperature->igroup != igroup && comm->me == 0)
-      error->warning("Group for fix_modify temp != fix group");
+      error->warning(FLERR,"Group for fix_modify temp != fix group");
     return 2;
   }
   return 0;
diff --git a/src/fix_thermal_conductivity.cpp b/src/fix_thermal_conductivity.cpp
index b53c3626a62512cbbaad0479cee02fed1874f89f..b339bbd82c9ff4d53f41ddddbd0edf743ee7c9ab 100644
--- a/src/fix_thermal_conductivity.cpp
+++ b/src/fix_thermal_conductivity.cpp
@@ -31,21 +31,18 @@ using namespace LAMMPS_NS;
 
 #define BIG 1.0e10
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 FixThermalConductivity::FixThermalConductivity(LAMMPS *lmp,
 					       int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 6) error->all("Illegal fix thermal/conductivity command");
+  if (narg < 6) error->all(FLERR,"Illegal fix thermal/conductivity command");
 
   MPI_Comm_rank(world,&me);
 
   nevery = atoi(arg[3]);
-  if (nevery <= 0) error->all("Illegal fix thermal/conductivity command");
+  if (nevery <= 0) error->all(FLERR,"Illegal fix thermal/conductivity command");
 
   scalar_flag = 1;
   global_freq = nevery;
@@ -54,11 +51,11 @@ FixThermalConductivity::FixThermalConductivity(LAMMPS *lmp,
   if (strcmp(arg[4],"x") == 0) edim = 0;
   else if (strcmp(arg[4],"y") == 0) edim = 1;
   else if (strcmp(arg[4],"z") == 0) edim = 2;
-  else error->all("Illegal fix thermal/conductivity command");
+  else error->all(FLERR,"Illegal fix thermal/conductivity command");
 
   nbin = atoi(arg[5]);
   if (nbin % 2 || nbin <= 2) 
-    error->all("Illegal fix thermal/conductivity command");
+    error->all(FLERR,"Illegal fix thermal/conductivity command");
 
   // optional keywords
 
@@ -68,12 +65,12 @@ FixThermalConductivity::FixThermalConductivity(LAMMPS *lmp,
   while (iarg < narg) {
     if (strcmp(arg[iarg],"swap") == 0) {
       if (iarg+2 > narg)
-	error->all("Illegal fix thermal/conductivity command");
+	error->all(FLERR,"Illegal fix thermal/conductivity command");
       nswap = atoi(arg[iarg+1]);
       if (nswap <= 0)
-	error->all("Fix thermal/conductivity swap value must be positive");
+	error->all(FLERR,"Fix thermal/conductivity swap value must be positive");
       iarg += 2;
-    } else error->all("Illegal fix thermal/conductivity command");
+    } else error->all(FLERR,"Illegal fix thermal/conductivity command");
   }
 
   // initialize array sizes to nswap+1 so have space to shift values down
@@ -116,7 +113,7 @@ void FixThermalConductivity::init()
   for (int i = 0; i < modify->nfix; i++) {
     if (modify->fix[i] == this) foundme = 1;
     if (foundme && strcmp(modify->fix[i]->style,"ave/spatial") == 0 && me == 0)
-      error->warning("Fix thermal/conductivity comes before fix ave/spatial");
+      error->warning(FLERR,"Fix thermal/conductivity comes before fix ave/spatial");
   }
 
   // set bounds of 2 slabs in edim
diff --git a/src/fix_tmd.cpp b/src/fix_tmd.cpp
index 50865b200af6d8b451e15f47c5f53e270761a24f..b73b04c5bef3ed17d4d5edb8a1969513b7eff322 100644
--- a/src/fix_tmd.cpp
+++ b/src/fix_tmd.cpp
@@ -42,12 +42,12 @@ using namespace LAMMPS_NS;
 FixTMD::FixTMD(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 6) error->all("Illegal fix tmd command");
+  if (narg < 6) error->all(FLERR,"Illegal fix tmd command");
 
   rho_stop = atof(arg[3]);
   nfileevery = atoi(arg[5]);
-  if (rho_stop < 0 || nfileevery < 0) error->all("Illegal fix tmd command");
-  if (nfileevery && narg != 7) error->all("Illegal fix tmd command");
+  if (rho_stop < 0 || nfileevery < 0) error->all(FLERR,"Illegal fix tmd command");
+  if (nfileevery && narg != 7) error->all(FLERR,"Illegal fix tmd command");
 
   MPI_Comm_rank(world,&me);
 
@@ -62,7 +62,7 @@ FixTMD::FixTMD(LAMMPS *lmp, int narg, char **arg) :
   // make sure an atom map exists before reading in target coordinates
 
   if (atom->map_style == 0) 
-    error->all("Cannot use fix TMD unless atom map exists");
+    error->all(FLERR,"Cannot use fix TMD unless atom map exists");
 
   // read from arg[4] and store coordinates of final target in xf
 
@@ -71,13 +71,13 @@ FixTMD::FixTMD(LAMMPS *lmp, int narg, char **arg) :
   // open arg[6] statistics file and write header
 
   if (nfileevery) {
-    if (narg != 7) error->all("Illegal fix tmd command");
+    if (narg != 7) error->all(FLERR,"Illegal fix tmd command");
     if (me == 0) {
       fp = fopen(arg[6],"w");
       if (fp == NULL) {
 	char str[128];
 	sprintf(str,"Cannot open fix tmd file %s",arg[6]);
-	error->one(str);
+	error->one(FLERR,str);
       }
       fprintf(fp,"%s %s\n","# Step rho_target rho_old gamma_back",
 	      "gamma_forward lambda work_lambda work_analytical");
@@ -169,7 +169,7 @@ void FixTMD::init()
     if (flag && strcmp(modify->fix[i]->style,"npt") == 0) flag = 2;
     if (flag && strcmp(modify->fix[i]->style,"nph") == 0) flag = 2;
   }
-  if (flag == 2) error->all("Fix tmd must come after integration fixes");
+  if (flag == 2) error->all(FLERR,"Fix tmd must come after integration fixes");
 
   // timesteps
 
@@ -465,15 +465,15 @@ void FixTMD::readfile(char *file)
 	  continue;
 	} else if (atom->count_words(bufptr) == 4) {
 	  if (xprd >= 0.0 || yprd >= 0.0 || zprd >= 0.0) 
-	    error->all("Incorrect format in TMD target file");
+	    error->all(FLERR,"Incorrect format in TMD target file");
 	  imageflag = 0;
 	  firstline = 0;
 	} else if (atom->count_words(bufptr) == 7) {
 	  if (xprd < 0.0 || yprd < 0.0 || zprd < 0.0) 
-	    error->all("Incorrect format in TMD target file");
+	    error->all(FLERR,"Incorrect format in TMD target file");
 	  imageflag = 1;
 	  firstline = 0;
-	} else error->all("Incorrect format in TMD target file");
+	} else error->all(FLERR,"Incorrect format in TMD target file");
       }
 
       if (imageflag)
@@ -521,7 +521,7 @@ void FixTMD::readfile(char *file)
 
   int flagall;
   MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
-  if (flagall) error->all("TMD target file did not list all group atoms");
+  if (flagall) error->all(FLERR,"TMD target file did not list all group atoms");
 }
 
 /* ----------------------------------------------------------------------
@@ -541,14 +541,14 @@ void FixTMD::open(char *file)
     sprintf(gunzip,"gunzip -c %s",file);
     fp = popen(gunzip,"r");
 #else
-    error->one("Cannot open gzipped file");
+    error->one(FLERR,"Cannot open gzipped file");
 #endif
   }
 
   if (fp == NULL) {
     char str[128];
     sprintf(str,"Cannot open file %s",file);
-    error->one(str);
+    error->one(FLERR,str);
   }
 }
 
diff --git a/src/fix_ttm.cpp b/src/fix_ttm.cpp
index ff037a7804223c762bf008766c972223f9755e0b..4bc35c5097ff50a532eef7a429fa4879712fc54a 100644
--- a/src/fix_ttm.cpp
+++ b/src/fix_ttm.cpp
@@ -35,9 +35,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 #define MAXLINE 1024
 
 /* ---------------------------------------------------------------------- */
@@ -45,7 +42,7 @@ using namespace LAMMPS_NS;
 FixTTM::FixTTM(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 15) error->all("Illegal fix ttm command");
+  if (narg < 15) error->all(FLERR,"Illegal fix ttm command");
 
   vector_flag = 1;
   size_vector = 2;
@@ -70,38 +67,38 @@ FixTTM::FixTTM(LAMMPS *lmp, int narg, char **arg) :
   if (fpr == NULL) {
     char str[128];
     sprintf(str,"Cannot open file %s",arg[13]);
-    error->one(str);
+    error->one(FLERR,str);
   }
 
   nfileevery = atoi(arg[14]);
 
   if (nfileevery) {
-    if (narg != 16) error->all("Illegal fix ttm command");
+    if (narg != 16) error->all(FLERR,"Illegal fix ttm command");
     MPI_Comm_rank(world,&me);
     if (me == 0) {
       fp = fopen(arg[15],"w");
       if (fp == NULL) {
         char str[128];
         sprintf(str,"Cannot open fix ttm file %s",arg[15]);
-        error->one(str);
+        error->one(FLERR,str);
       }
     }
   }
 
   // error check
 
-  if (seed <= 0) error->all("Invalid random number seed in fix ttm command");
+  if (seed <= 0) error->all(FLERR,"Invalid random number seed in fix ttm command");
   if (electronic_specific_heat <= 0.0) 
-    error->all("Fix ttm electronic_specific_heat must be > 0.0");
+    error->all(FLERR,"Fix ttm electronic_specific_heat must be > 0.0");
   if (electronic_density <= 0.0) 
-    error->all("Fix ttm electronic_density must be > 0.0");
+    error->all(FLERR,"Fix ttm electronic_density must be > 0.0");
   if (electronic_thermal_conductivity < 0.0)
-    error->all("Fix ttm electronic_thermal_conductivity must be >= 0.0");
-  if (gamma_p <= 0.0) error->all("Fix ttm gamma_p must be > 0.0");
-  if (gamma_s < 0.0) error->all("Fix ttm gamma_s must be >= 0.0");
-  if (v_0 < 0.0) error->all("Fix ttm v_0 must be >= 0.0");
+    error->all(FLERR,"Fix ttm electronic_thermal_conductivity must be >= 0.0");
+  if (gamma_p <= 0.0) error->all(FLERR,"Fix ttm gamma_p must be > 0.0");
+  if (gamma_s < 0.0) error->all(FLERR,"Fix ttm gamma_s must be >= 0.0");
+  if (v_0 < 0.0) error->all(FLERR,"Fix ttm v_0 must be >= 0.0");
   if (nxnodes <= 0 || nynodes <= 0 || nznodes <= 0)
-    error->all("Fix ttm number of nodes must be > 0");
+    error->all(FLERR,"Fix ttm number of nodes must be > 0");
 
   v_0_sq = v_0*v_0;
 
@@ -194,11 +191,11 @@ int FixTTM::setmask()
 void FixTTM::init()
 {
   if (domain->dimension == 2)
-    error->all("Cannot use fix ttm with 2d simulation");
+    error->all(FLERR,"Cannot use fix ttm with 2d simulation");
   if (domain->nonperiodic != 0)
-    error->all("Cannot use nonperiodic boundares with fix ttm");
+    error->all(FLERR,"Cannot use nonperiodic boundares with fix ttm");
   if (domain->triclinic)
-    error->all("Cannot use fix ttm with triclinic box");
+    error->all(FLERR,"Cannot use fix ttm with triclinic box");
 
   // set force prefactors
 
@@ -262,7 +259,7 @@ void FixTTM::post_force(int vflag)
       while (iznode < 0) iznode += nznodes;
 
       if (T_electron[ixnode][iynode][iznode] < 0) 
-        error->all("Electronic temperature dropped below zero");
+        error->all(FLERR,"Electronic temperature dropped below zero");
 
       double tsqrt = sqrt(T_electron[ixnode][iynode][iznode]);
 
@@ -345,7 +342,7 @@ void FixTTM::read_initial_electron_temperatures()
   while (1) {
     if (fgets(line,MAXLINE,fpr) == NULL) break;
     sscanf(line,"%d %d %d %lg",&ixnode,&iynode,&iznode,&T_tmp);
-    if (T_tmp < 0.0) error->one("Fix ttm electron temperatures must be > 0.0");
+    if (T_tmp < 0.0) error->one(FLERR,"Fix ttm electron temperatures must be > 0.0");
     T_electron[ixnode][iynode][iznode] = T_tmp;
     T_initial_set[ixnode][iynode][iznode] = 1;
   }
@@ -354,7 +351,7 @@ void FixTTM::read_initial_electron_temperatures()
     for (int iynode = 0; iynode < nynodes; iynode++)
       for (int iznode = 0; iznode < nznodes; iznode++)
         if (T_initial_set[ixnode][iynode][iznode] == 0)
-          error->one("Initial temperatures not all set in fix ttm");
+          error->one(FLERR,"Initial temperatures not all set in fix ttm");
 
   // close file
 
@@ -420,7 +417,7 @@ void FixTTM::end_of_step()
     num_inner_timesteps = static_cast<int>(update->dt/inner_dt) + 1;
     inner_dt = update->dt/double(num_inner_timesteps);
     if (num_inner_timesteps > 1000000) 
-      error->warning("Too many inner timesteps in fix ttm",0);
+      error->warning(FLERR,"Too many inner timesteps in fix ttm",0);
   }
 
   for (int ith_inner_timestep = 0; ith_inner_timestep < num_inner_timesteps; 
diff --git a/src/fix_viscosity.cpp b/src/fix_viscosity.cpp
index 8191e6d97cfd9d610f0ac20b6d3a4a63332e8c10..04bcd3394cb3fd4064f0344d6a3ef259ef71414b 100644
--- a/src/fix_viscosity.cpp
+++ b/src/fix_viscosity.cpp
@@ -32,20 +32,17 @@ using namespace LAMMPS_NS;
 
 #define BIG 1.0e10
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 FixViscosity::FixViscosity(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 7) error->all("Illegal fix viscosity command");
+  if (narg < 7) error->all(FLERR,"Illegal fix viscosity command");
 
   MPI_Comm_rank(world,&me);
 
   nevery = atoi(arg[3]);
-  if (nevery <= 0) error->all("Illegal fix viscosity command");
+  if (nevery <= 0) error->all(FLERR,"Illegal fix viscosity command");
 
   scalar_flag = 1;
   global_freq = nevery;
@@ -54,15 +51,15 @@ FixViscosity::FixViscosity(LAMMPS *lmp, int narg, char **arg) :
   if (strcmp(arg[4],"x") == 0) vdim = 0;
   else if (strcmp(arg[4],"y") == 0) vdim = 1;
   else if (strcmp(arg[4],"z") == 0) vdim = 2;
-  else error->all("Illegal fix viscosity command");
+  else error->all(FLERR,"Illegal fix viscosity command");
 
   if (strcmp(arg[5],"x") == 0) pdim = 0;
   else if (strcmp(arg[5],"y") == 0) pdim = 1;
   else if (strcmp(arg[5],"z") == 0) pdim = 2;
-  else error->all("Illegal fix viscosity command");
+  else error->all(FLERR,"Illegal fix viscosity command");
 
   nbin = atoi(arg[6]);
-  if (nbin % 2 || nbin <= 2) error->all("Illegal fix viscosity command");
+  if (nbin % 2 || nbin <= 2) error->all(FLERR,"Illegal fix viscosity command");
 
   // optional keywords
 
@@ -72,18 +69,18 @@ FixViscosity::FixViscosity(LAMMPS *lmp, int narg, char **arg) :
   int iarg = 7;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"swap") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix viscosity command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix viscosity command");
       nswap = atoi(arg[iarg+1]);
-      if (nswap <= 0) error->all("Fix viscosity swap value must be positive");
+      if (nswap <= 0) error->all(FLERR,"Fix viscosity swap value must be positive");
       iarg += 2;
     } else if (strcmp(arg[iarg],"vtarget") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix viscosity command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix viscosity command");
       if (strcmp(arg[iarg+1],"INF") == 0) vtarget = BIG;
       else vtarget = atof(arg[iarg+1]);
       if (vtarget <= 0.0)
-	error->all("Fix viscosity vtarget value must be positive");
+	error->all(FLERR,"Fix viscosity vtarget value must be positive");
       iarg += 2;
-    } else error->all("Illegal fix viscosity command");
+    } else error->all(FLERR,"Illegal fix viscosity command");
   }
 
   // initialize array sizes to nswap+1 so have space to shift values down
@@ -126,7 +123,7 @@ void FixViscosity::init()
   for (int i = 0; i < modify->nfix; i++) {
     if (modify->fix[i] == this) foundme = 1;
     if (foundme && strcmp(modify->fix[i]->style,"ave/spatial") == 0 && me == 0)
-      error->warning("Fix viscosity comes before fix ave/spatial");
+      error->warning(FLERR,"Fix viscosity comes before fix ave/spatial");
   }
 
   // set bounds of 2 slabs in pdim
diff --git a/src/fix_viscous.cpp b/src/fix_viscous.cpp
index 770eee55930c9afdf2f27acec3220cd47a7d06be..5345268bb4e2c828da267a4afb7c43d582ea2ad6 100644
--- a/src/fix_viscous.cpp
+++ b/src/fix_viscous.cpp
@@ -27,7 +27,7 @@ using namespace LAMMPS_NS;
 FixViscous::FixViscous(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 4) error->all("Illegal fix viscous command");
+  if (narg < 4) error->all(FLERR,"Illegal fix viscous command");
 
   double gamma_one = atof(arg[3]);
   gamma = new double[atom->ntypes+1];
@@ -38,14 +38,14 @@ FixViscous::FixViscous(LAMMPS *lmp, int narg, char **arg) :
   int iarg = 4;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"scale") == 0) {
-      if (iarg+3 > narg) error->all("Illegal fix viscous command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal fix viscous command");
       int itype = atoi(arg[iarg+1]);
       double scale = atof(arg[iarg+2]);
       if (itype <= 0 || itype > atom->ntypes)
-	error->all("Illegal fix viscous command");
+	error->all(FLERR,"Illegal fix viscous command");
       gamma[itype] = gamma_one * scale;
       iarg += 3;
-    } else error->all("Illegal fix viscous command");
+    } else error->all(FLERR,"Illegal fix viscous command");
   }
 }
 
diff --git a/src/fix_wall.cpp b/src/fix_wall.cpp
index fdff4a11fb398c73b9a84837623a3cc1a8f762dd..3cc68017cc1a27fb763212b837a5f2d45b6b1904 100644
--- a/src/fix_wall.cpp
+++ b/src/fix_wall.cpp
@@ -51,7 +51,7 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) :
     if ((strcmp(arg[iarg],"xlo") == 0) || (strcmp(arg[iarg],"xhi") == 0) ||
 	(strcmp(arg[iarg],"ylo") == 0) || (strcmp(arg[iarg],"yhi") == 0) ||
 	(strcmp(arg[iarg],"zlo") == 0) || (strcmp(arg[iarg],"zhi") == 0)) {
-      if (iarg+5 > narg) error->all("Illegal fix wall command");
+      if (iarg+5 > narg) error->all(FLERR,"Illegal fix wall command");
 
       int newwall;
       if (strcmp(arg[iarg],"xlo") == 0) newwall = XLO;
@@ -63,7 +63,7 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) :
 
       for (int m = 0; m < nwall; m++)
 	if (newwall == wallwhich[m])
-	  error->all("Wall defined twice in fix wall command");
+	  error->all(FLERR,"Wall defined twice in fix wall command");
 
       wallwhich[nwall] = newwall;
       if (strcmp(arg[iarg+1],"EDGE") == 0) {
@@ -89,35 +89,35 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) :
       iarg += 5;
 
     } else if (strcmp(arg[iarg],"units") == 0) {
-      if (iarg+2 > narg) error->all("Illegal fix wall command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix wall command");
       if (strcmp(arg[iarg+1],"box") == 0) scaleflag = 0;
       else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1;
-      else error->all("Illegal fix wall command");
+      else error->all(FLERR,"Illegal fix wall command");
       iarg += 2;
-    } else error->all("Illegal fix wall command");
+    } else error->all(FLERR,"Illegal fix wall command");
   }
 
   size_vector = nwall;
 
   // error check
 
-  if (nwall == 0) error->all("Illegal fix wall command");
+  if (nwall == 0) error->all(FLERR,"Illegal fix wall command");
   for (int m = 0; m < nwall; m++)
     if (cutoff[m] <= 0.0)
-      error->all("Fix wall cutoff <= 0.0");
+      error->all(FLERR,"Fix wall cutoff <= 0.0");
 
   for (int m = 0; m < nwall; m++) {
     if ((wallwhich[m] == XLO || wallwhich[m] == XHI) && domain->xperiodic)
-      error->all("Cannot use fix wall in periodic dimension");
+      error->all(FLERR,"Cannot use fix wall in periodic dimension");
     if ((wallwhich[m] == YLO || wallwhich[m] == YHI) && domain->yperiodic)
-      error->all("Cannot use fix wall in periodic dimension");
+      error->all(FLERR,"Cannot use fix wall in periodic dimension");
     if ((wallwhich[m] == ZLO || wallwhich[m] == ZHI) && domain->zperiodic)
-      error->all("Cannot use fix wall in periodic dimension");
+      error->all(FLERR,"Cannot use fix wall in periodic dimension");
   }
 
   for (int m = 0; m < nwall; m++)
     if ((wallwhich[m] == ZLO || wallwhich[m] == ZHI) && domain->dimension == 2)
-      error->all("Cannot use fix wall zlo/zhi for a 2d simulation");
+      error->all(FLERR,"Cannot use fix wall zlo/zhi for a 2d simulation");
   
   // scale coord for CONSTANT walls
 
@@ -127,7 +127,7 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) :
 
   if (flag) {
     if (scaleflag && domain->lattice == NULL)
-      error->all("Use of fix wall with undefined lattice");
+      error->all(FLERR,"Use of fix wall with undefined lattice");
 
     double xscale,yscale,zscale;
     if (scaleflag) {
@@ -186,9 +186,9 @@ void FixWall::init()
     if (wallstyle[m] != VARIABLE) continue;
     varindex[m] = input->variable->find(varstr[m]);
     if (varindex[m] < 0)
-      error->all("Variable name for fix wall does not exist");
+      error->all(FLERR,"Variable name for fix wall does not exist");
     if (!input->variable->equalstyle(varindex[m]))
-      error->all("Variable for fix wall is invalid style");
+      error->all(FLERR,"Variable for fix wall is invalid style");
   }
 
   // setup coefficients
diff --git a/src/fix_wall_harmonic.cpp b/src/fix_wall_harmonic.cpp
index 4d0660a0f4ab1334b20dbdc1a6a6476ba6ac7f6d..e7eb85b54cfe308903d449698ac90583a23e6721 100644
--- a/src/fix_wall_harmonic.cpp
+++ b/src/fix_wall_harmonic.cpp
@@ -61,5 +61,5 @@ void FixWallHarmonic::wall_particle(int m, int which, double coord)
       ewall[m+1] += fwall;
     }
 
-  if (onflag) error->one("Particle on or inside fix wall surface");
+  if (onflag) error->one(FLERR,"Particle on or inside fix wall surface");
 }
diff --git a/src/fix_wall_lj126.cpp b/src/fix_wall_lj126.cpp
index 132cea9c0bfbafc58436e23ae3b6f89626e88bd4..47b0eba6f3e40d84b6755acd82f781e8b3caec3e 100644
--- a/src/fix_wall_lj126.cpp
+++ b/src/fix_wall_lj126.cpp
@@ -77,5 +77,5 @@ void FixWallLJ126::wall_particle(int m, int which, double coord)
       ewall[m+1] += fwall;
     }
 
-  if (onflag) error->one("Particle on or inside fix wall surface");
+  if (onflag) error->one(FLERR,"Particle on or inside fix wall surface");
 }
diff --git a/src/fix_wall_lj93.cpp b/src/fix_wall_lj93.cpp
index e106ec5e6aa5a1b21da87a1520774d4ec2384f10..0f8f9dff1990700820a943d5a71d84d3481db694 100644
--- a/src/fix_wall_lj93.cpp
+++ b/src/fix_wall_lj93.cpp
@@ -80,5 +80,5 @@ void FixWallLJ93::wall_particle(int m, int which, double coord)
       ewall[m+1] += fwall;
     }
 
-  if (onflag) error->one("Particle on or inside fix wall surface");
+  if (onflag) error->one(FLERR,"Particle on or inside fix wall surface");
 }
diff --git a/src/fix_wall_reflect.cpp b/src/fix_wall_reflect.cpp
index fa74faf48a0611343a85e054a6ad4401994e2153..2251fd2662ce6713f0fc24e375061b5388eb1798 100644
--- a/src/fix_wall_reflect.cpp
+++ b/src/fix_wall_reflect.cpp
@@ -34,7 +34,7 @@ enum{NONE,EDGE,CONSTANT,VARIABLE};
 FixWallReflect::FixWallReflect(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 4) error->all("Illegal fix wall/reflect command");
+  if (narg < 4) error->all(FLERR,"Illegal fix wall/reflect command");
 
   // parse args
 
@@ -46,7 +46,7 @@ FixWallReflect::FixWallReflect(LAMMPS *lmp, int narg, char **arg) :
     if ((strcmp(arg[iarg],"xlo") == 0) || (strcmp(arg[iarg],"xhi") == 0) ||
 	(strcmp(arg[iarg],"ylo") == 0) || (strcmp(arg[iarg],"yhi") == 0) ||
 	(strcmp(arg[iarg],"zlo") == 0) || (strcmp(arg[iarg],"zhi") == 0)) {
-      if (iarg+2 > narg) error->all("Illegal fix wall/reflect command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal fix wall/reflect command");
 
       int newwall;
       if (strcmp(arg[iarg],"xlo") == 0) newwall = XLO;
@@ -58,7 +58,7 @@ FixWallReflect::FixWallReflect(LAMMPS *lmp, int narg, char **arg) :
 
       for (int m = 0; m < nwall; m++)
 	if (newwall == wallwhich[m])
-	  error->all("Wall defined twice in fix wall/reflect command");
+	  error->all(FLERR,"Wall defined twice in fix wall/reflect command");
 
       wallwhich[nwall] = newwall;
       if (strcmp(arg[iarg+1],"EDGE") == 0) {
@@ -81,30 +81,30 @@ FixWallReflect::FixWallReflect(LAMMPS *lmp, int narg, char **arg) :
       iarg += 2;
 
     } else if (strcmp(arg[iarg],"units") == 0) {
-      if (iarg+2 > narg) error->all("Illegal wall/reflect command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal wall/reflect command");
       if (strcmp(arg[iarg+1],"box") == 0) scaleflag = 0;
       else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1;
-      else error->all("Illegal fix wall/reflect command");
+      else error->all(FLERR,"Illegal fix wall/reflect command");
       iarg += 2;
-    } else error->all("Illegal fix wall/reflect command");
+    } else error->all(FLERR,"Illegal fix wall/reflect command");
   }
 
   // error check
 
-  if (nwall == 0) error->all("Illegal fix wall command");
+  if (nwall == 0) error->all(FLERR,"Illegal fix wall command");
 
   for (int m = 0; m < nwall; m++) {
     if ((wallwhich[m] == XLO || wallwhich[m] == XHI) && domain->xperiodic)
-      error->all("Cannot use fix wall/reflect in periodic dimension");
+      error->all(FLERR,"Cannot use fix wall/reflect in periodic dimension");
     if ((wallwhich[m] == YLO || wallwhich[m] == YHI) && domain->yperiodic)
-      error->all("Cannot use fix wall/reflect in periodic dimension");
+      error->all(FLERR,"Cannot use fix wall/reflect in periodic dimension");
     if ((wallwhich[m] == ZLO || wallwhich[m] == ZHI) && domain->zperiodic)
-      error->all("Cannot use fix wall/reflect in periodic dimension");
+      error->all(FLERR,"Cannot use fix wall/reflect in periodic dimension");
   }
 
   for (int m = 0; m < nwall; m++)
     if ((wallwhich[m] == ZLO || wallwhich[m] == ZHI) && domain->dimension == 2)
-      error->all("Cannot use fix wall/reflect zlo/zhi for a 2d simulation");
+      error->all(FLERR,"Cannot use fix wall/reflect zlo/zhi for a 2d simulation");
 
   // scale coord for CONSTANT walls
 
@@ -114,7 +114,7 @@ FixWallReflect::FixWallReflect(LAMMPS *lmp, int narg, char **arg) :
 
   if (flag) {
     if (scaleflag && domain->lattice == NULL)
-      error->all("Use of fix wall with undefined lattice");
+      error->all(FLERR,"Use of fix wall with undefined lattice");
 
     double xscale,yscale,zscale;
     if (scaleflag) {
@@ -166,9 +166,9 @@ void FixWallReflect::init()
     if (wallstyle[m] != VARIABLE) continue;
     varindex[m] = input->variable->find(varstr[m]);
     if (varindex[m] < 0)
-      error->all("Variable name for fix wall/reflect does not exist");
+      error->all(FLERR,"Variable name for fix wall/reflect does not exist");
     if (!input->variable->equalstyle(varindex[m]))
-      error->all("Variable for fix wall/reflect is invalid style");
+      error->all(FLERR,"Variable for fix wall/reflect is invalid style");
   }
 
   int nrigid = 0;
@@ -176,7 +176,7 @@ void FixWallReflect::init()
     if (modify->fix[i]->rigid_flag) nrigid++;
 
   if (nrigid && comm->me == 0) 
-    error->warning("Should not allow rigid bodies to bounce off "
+    error->warning(FLERR,"Should not allow rigid bodies to bounce off "
 		   "relecting walls");
 }
 
diff --git a/src/fix_wall_region.cpp b/src/fix_wall_region.cpp
index c3e77cb5fe8b1cd0f725b1bd7d7776a4b0031ea8..151e20259de373355f128d4f9c630aeb098a1378 100644
--- a/src/fix_wall_region.cpp
+++ b/src/fix_wall_region.cpp
@@ -34,7 +34,7 @@ enum{LJ93,LJ126,COLLOID,HARMONIC};
 FixWallRegion::FixWallRegion(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg != 8) error->all("Illegal fix wall/region command");
+  if (narg != 8) error->all(FLERR,"Illegal fix wall/region command");
 
   scalar_flag = 1;
   vector_flag = 1;
@@ -47,7 +47,7 @@ FixWallRegion::FixWallRegion(LAMMPS *lmp, int narg, char **arg) :
 
   iregion = domain->find_region(arg[3]);
   if (iregion == -1)
-    error->all("Region ID for fix wall/region does not exist");
+    error->all(FLERR,"Region ID for fix wall/region does not exist");
   int n = strlen(arg[3]) + 1;
   idregion = new char[n];
   strcpy(idregion,arg[3]);
@@ -56,13 +56,13 @@ FixWallRegion::FixWallRegion(LAMMPS *lmp, int narg, char **arg) :
   else if (strcmp(arg[4],"lj126") == 0) style = LJ126;
   else if (strcmp(arg[4],"colloid") == 0) style = COLLOID;
   else if (strcmp(arg[4],"harmonic") == 0) style = HARMONIC;
-  else error->all("Illegal fix wall/region command");
+  else error->all(FLERR,"Illegal fix wall/region command");
 
   epsilon = atof(arg[5]);
   sigma = atof(arg[6]);
   cutoff = atof(arg[7]);
 
-  if (cutoff <= 0.0) error->all("Fix wall/region cutoff <= 0.0");
+  if (cutoff <= 0.0) error->all(FLERR,"Fix wall/region cutoff <= 0.0");
 
   eflag = 0;
   ewall[0] = ewall[1] = ewall[2] = ewall[3] = 0.0;
@@ -95,14 +95,14 @@ void FixWallRegion::init()
 
   iregion = domain->find_region(idregion);
   if (iregion == -1)
-    error->all("Region ID for fix wall/region does not exist");
+    error->all(FLERR,"Region ID for fix wall/region does not exist");
 
   // error checks for style COLLOID
   // insure all particles in group are extended particles
 
   if (style == COLLOID) {
     if (!atom->sphere_flag) 
-      error->all("Fix wall/region colloid requires atom style sphere");
+      error->all(FLERR,"Fix wall/region colloid requires atom style sphere");
 
     double *radius = atom->radius;
     int *mask = atom->mask;
@@ -116,7 +116,7 @@ void FixWallRegion::init()
     int flagall;
     MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
     if (flagall) 
-      error->all("Fix wall/region colloid requires extended particles");
+      error->all(FLERR,"Fix wall/region colloid requires extended particles");
   }
 
   // setup coefficients for each style
@@ -231,7 +231,7 @@ void FixWallRegion::post_force(int vflag)
       }
     }
 
-  if (onflag) error->one("Particle on or inside surface of region "
+  if (onflag) error->one(FLERR,"Particle on or inside surface of region "
 			 "used in fix wall/region");
 }
 
diff --git a/src/force.cpp b/src/force.cpp
index 2282b9a67677dd9e5635b580208f6a6124eed2bf..71511fc78fe0d9f745ce5ba2287046df573373ec 100644
--- a/src/force.cpp
+++ b/src/force.cpp
@@ -38,9 +38,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 Force::Force(LAMMPS *lmp) : Pointers(lmp)
@@ -168,7 +165,7 @@ Pair *Force::new_pair(const char *style, char *suffix, int &sflag)
 #include "style_pair.h"
 #undef PAIR_CLASS
 
-  else error->all("Invalid pair style");
+  else error->all(FLERR,"Invalid pair style");
 
   return NULL;
 }
@@ -247,7 +244,7 @@ Bond *Force::new_bond(const char *style)
 #include "style_bond.h"
 #undef BOND_CLASS
 
-  else error->all("Invalid bond style");
+  else error->all(FLERR,"Invalid bond style");
   return NULL;
 }
 
@@ -295,7 +292,7 @@ Angle *Force::new_angle(const char *style)
 #include "style_angle.h"
 #undef ANGLE_CLASS
 
-  else error->all("Invalid angle style");
+  else error->all(FLERR,"Invalid angle style");
   return NULL;
 }
 
@@ -328,7 +325,7 @@ Dihedral *Force::new_dihedral(const char *style)
 #include "style_dihedral.h"
 #undef DIHEDRAL_CLASS
 
-  else error->all("Invalid dihedral style");
+  else error->all(FLERR,"Invalid dihedral style");
   return NULL;
 }
 
@@ -361,7 +358,7 @@ Improper *Force::new_improper(const char *style)
 #include "style_improper.h"
 #undef IMPROPER_CLASS
 
-  else error->all("Invalid improper style");
+  else error->all(FLERR,"Invalid improper style");
   return NULL;
 }
 
@@ -382,7 +379,7 @@ void Force::create_kspace(int narg, char **arg)
 #include "style_kspace.h"
 #undef KSPACE_CLASS
 
-  else error->all("Invalid kspace style");
+  else error->all(FLERR,"Invalid kspace style");
 
   int n = strlen(arg[0]) + 1;
   kspace_style = new char[n];
@@ -395,12 +392,12 @@ void Force::create_kspace(int narg, char **arg)
 
 void Force::set_special(int narg, char **arg)
 {
-  if (narg == 0) error->all("Illegal special_bonds command");
+  if (narg == 0) error->all(FLERR,"Illegal special_bonds command");
 
   int iarg = 0;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"amber") == 0) {
-      if (iarg+1 > narg) error->all("Illegal special_bonds command");
+      if (iarg+1 > narg) error->all(FLERR,"Illegal special_bonds command");
       special_lj[1] = 0.0;
       special_lj[2] = 0.0;
       special_lj[3] = 0.5;
@@ -409,7 +406,7 @@ void Force::set_special(int narg, char **arg)
       special_coul[3] = 5.0/6.0;
       iarg += 1;
     } else if (strcmp(arg[iarg],"charmm") == 0) {
-      if (iarg+1 > narg) error->all("Illegal special_bonds command");
+      if (iarg+1 > narg) error->all(FLERR,"Illegal special_bonds command");
       special_lj[1] = 0.0;
       special_lj[2] = 0.0;
       special_lj[3] = 0.0;
@@ -418,7 +415,7 @@ void Force::set_special(int narg, char **arg)
       special_coul[3] = 0.0;
       iarg += 1;
     } else if (strcmp(arg[iarg],"dreiding") == 0) {
-      if (iarg+1 > narg) error->all("Illegal special_bonds command");
+      if (iarg+1 > narg) error->all(FLERR,"Illegal special_bonds command");
       special_lj[1] = 0.0;
       special_lj[2] = 0.0;
       special_lj[3] = 1.0;
@@ -427,7 +424,7 @@ void Force::set_special(int narg, char **arg)
       special_coul[3] = 1.0;
       iarg += 1;
     } else if (strcmp(arg[iarg],"fene") == 0) {
-      if (iarg+1 > narg) error->all("Illegal special_bonds command");
+      if (iarg+1 > narg) error->all(FLERR,"Illegal special_bonds command");
       special_lj[1] = 0.0;
       special_lj[2] = 1.0;
       special_lj[3] = 1.0;
@@ -436,48 +433,48 @@ void Force::set_special(int narg, char **arg)
       special_coul[3] = 1.0;
       iarg += 1;
     } else if (strcmp(arg[iarg],"lj/coul") == 0) {
-      if (iarg+4 > narg) error->all("Illegal special_bonds command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal special_bonds command");
       special_lj[1] = special_coul[1] = atof(arg[iarg+1]);
       special_lj[2] = special_coul[2] = atof(arg[iarg+2]);
       special_lj[3] = special_coul[3] = atof(arg[iarg+3]);
       iarg += 4;
     } else if (strcmp(arg[iarg],"lj") == 0) {
-      if (iarg+4 > narg) error->all("Illegal special_bonds command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal special_bonds command");
       special_lj[1] = atof(arg[iarg+1]);
       special_lj[2] = atof(arg[iarg+2]);
       special_lj[3] = atof(arg[iarg+3]);
       iarg += 4;
     } else if (strcmp(arg[iarg],"coul") == 0) {
-      if (iarg+4 > narg) error->all("Illegal special_bonds command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal special_bonds command");
       special_coul[1] = atof(arg[iarg+1]);
       special_coul[2] = atof(arg[iarg+2]);
       special_coul[3] = atof(arg[iarg+3]);
       iarg += 4;
     } else if (strcmp(arg[iarg],"angle") == 0) {
-      if (iarg+2 > narg) error->all("Illegal special_bonds command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal special_bonds command");
       if (strcmp(arg[iarg+1],"no") == 0) special_angle = 0;
       else if (strcmp(arg[iarg+1],"yes") == 0) special_angle = 1;
-      else error->all("Illegal special_bonds command");
+      else error->all(FLERR,"Illegal special_bonds command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"dihedral") == 0) {
-      if (iarg+2 > narg) error->all("Illegal special_bonds command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal special_bonds command");
       if (strcmp(arg[iarg+1],"no") == 0) special_dihedral = 0;
       else if (strcmp(arg[iarg+1],"yes") == 0) special_dihedral = 1;
-      else error->all("Illegal special_bonds command");
+      else error->all(FLERR,"Illegal special_bonds command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"extra") == 0) {
-      if (iarg+2 > narg) error->all("Illegal special_bonds command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal special_bonds command");
       special_extra = atoi(arg[iarg+1]);
       iarg += 2;
-    } else error->all("Illegal special_bonds command");
+    } else error->all(FLERR,"Illegal special_bonds command");
   }
 
   for (int i = 1; i <= 3; i++)
     if (special_lj[i] < 0.0 || special_lj[i] > 1.0 ||
 	special_coul[i] < 0.0 || special_coul[i] > 1.0)
-      error->all("Illegal special_bonds command");
+      error->all(FLERR,"Illegal special_bonds command");
 
-  if (special_extra < 0) error->all("Illegal special_bonds command");
+  if (special_extra < 0) error->all(FLERR,"Illegal special_bonds command");
 }
 
 /* ----------------------------------------------------------------------
@@ -524,7 +521,7 @@ double Force::numeric(char *str)
     if (isdigit(str[i])) continue;
     if (str[i] == '-' || str[i] == '+' || str[i] == '.') continue;
     if (str[i] == 'e' || str[i] == 'E') continue;
-    error->all("Expected floating point parameter in "
+    error->all(FLERR,"Expected floating point parameter in "
 	       "input script or data file");
   }
 
@@ -542,7 +539,7 @@ int Force::inumeric(char *str)
   int n = strlen(str);
   for (int i = 0; i < n; i++) {
     if (isdigit(str[i]) || str[i] == '-' || str[i] == '+') continue;
-    error->all("Expected integer parameter in input script or data file");
+    error->all(FLERR,"Expected integer parameter in input script or data file");
   }
 
   return atoi(str);
diff --git a/src/group.cpp b/src/group.cpp
index 7ab12b35f35b7ad39fe201f62413336f6e2affe7..5d6073bae0fe89d64f9ba674fc3908986a4a7c49 100644
--- a/src/group.cpp
+++ b/src/group.cpp
@@ -38,9 +38,6 @@ enum{LT,LE,GT,GE,EQ,NEQ,BETWEEN};
 
 #define BIG 1.0e20
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ----------------------------------------------------------------------
    initialize group memory
 ------------------------------------------------------------------------- */
@@ -87,27 +84,27 @@ void Group::assign(int narg, char **arg)
   int i;
 
   if (domain->box_exist == 0) 
-    error->all("Group command before simulation box is defined");
-  if (narg < 2) error->all("Illegal group command");
+    error->all(FLERR,"Group command before simulation box is defined");
+  if (narg < 2) error->all(FLERR,"Illegal group command");
 
   // delete the group if not being used elsewhere
   // clear mask of each atom assigned to this group
 
   if (strcmp(arg[1],"delete") == 0) {
     int igroup = find(arg[0]);
-    if (igroup == -1) error->all("Could not find group delete group ID");
-    if (igroup == 0) error->all("Cannot delete group all");
+    if (igroup == -1) error->all(FLERR,"Could not find group delete group ID");
+    if (igroup == 0) error->all(FLERR,"Cannot delete group all");
     for (i = 0; i < modify->nfix; i++)
       if (modify->fix[i]->igroup == igroup)
-	error->all("Cannot delete group currently used by a fix");
+	error->all(FLERR,"Cannot delete group currently used by a fix");
     for (i = 0; i < modify->ncompute; i++)
       if (modify->compute[i]->igroup == igroup)
-	error->all("Cannot delete group currently used by a compute");
+	error->all(FLERR,"Cannot delete group currently used by a compute");
     for (i = 0; i < output->ndump; i++)
       if (output->dump[i]->igroup == igroup)
-	error->all("Cannot delete group currently used by a dump");
+	error->all(FLERR,"Cannot delete group currently used by a dump");
     if (atom->firstgroupname && strcmp(arg[0],atom->firstgroupname) == 0)
-      error->all("Cannot delete group currently used by atom_modify first");
+      error->all(FLERR,"Cannot delete group currently used by atom_modify first");
 
     int *mask = atom->mask;
     int nlocal = atom->nlocal;
@@ -127,7 +124,7 @@ void Group::assign(int narg, char **arg)
   int igroup = find(arg[0]);
 
   if (igroup == -1) {
-    if (ngroup == MAX_GROUP) error->all("Too many groups");
+    if (ngroup == MAX_GROUP) error->all(FLERR,"Too many groups");
     igroup = find_unused();
     int n = strlen(arg[0]) + 1;
     names[igroup] = new char[n];
@@ -146,10 +143,10 @@ void Group::assign(int narg, char **arg)
 
   if (strcmp(arg[1],"region") == 0) {
 
-    if (narg != 3) error->all("Illegal group command");
+    if (narg != 3) error->all(FLERR,"Illegal group command");
     
     int iregion = domain->find_region(arg[2]);
-    if (iregion == -1) error->all("Group region ID does not exist");
+    if (iregion == -1) error->all(FLERR,"Group region ID does not exist");
     domain->init();
 
     for (i = 0; i < nlocal; i++)
@@ -163,13 +160,13 @@ void Group::assign(int narg, char **arg)
 	      strcmp(arg[2],"<=") == 0 || strcmp(arg[2],">=") == 0 || 
 	      strcmp(arg[2],"<>") == 0)) {
 
-    if (narg < 4 || narg > 5) error->all("Illegal group command");
+    if (narg < 4 || narg > 5) error->all(FLERR,"Illegal group command");
     int category,condition,bound1,bound2;
 
     if (strcmp(arg[1],"type") == 0) category = TYPE;
     else if (strcmp(arg[1],"molecule") == 0) category = MOLECULE;
     else if (strcmp(arg[1],"id") == 0) category = ID;
-    else error->all("Illegal group command");
+    else error->all(FLERR,"Illegal group command");
     
     if (strcmp(arg[2],"<") == 0) condition = LT;
     else if (strcmp(arg[2],"<=") == 0) condition = LE;
@@ -178,13 +175,13 @@ void Group::assign(int narg, char **arg)
     else if (strcmp(arg[2],"==") == 0) condition = EQ;
     else if (strcmp(arg[2],"!=") == 0) condition = NEQ;
     else if (strcmp(arg[2],"<>") == 0) condition = BETWEEN;
-    else error->all("Illegal group command");
+    else error->all(FLERR,"Illegal group command");
 
     bound1 = atoi(arg[3]);
     bound2 = -1;
 
     if (condition == BETWEEN) {
-      if (narg != 5) error->all("Illegal group command");
+      if (narg != 5) error->all(FLERR,"Illegal group command");
       bound2 = atoi(arg[4]);
     }
 
@@ -217,7 +214,7 @@ void Group::assign(int narg, char **arg)
   } else if (strcmp(arg[1],"type") == 0 || strcmp(arg[1],"molecule") == 0 ||
 	     strcmp(arg[1],"id") == 0) {
 
-    if (narg < 3) error->all("Illegal group command");
+    if (narg < 3) error->all(FLERR,"Illegal group command");
 
     int length = narg-2;
     int *list = new int[length];
@@ -226,7 +223,7 @@ void Group::assign(int narg, char **arg)
     if (strcmp(arg[1],"type") == 0) category = TYPE;
     else if (strcmp(arg[1],"molecule") == 0) category = MOLECULE;
     else if (strcmp(arg[1],"id") == 0) category = ID;
-    else error->all("Illegal group command");
+    else error->all(FLERR,"Illegal group command");
     
     length = narg - 2;
     for (int iarg = 2; iarg < narg; iarg++) list[iarg-2] = atoi(arg[iarg]);
@@ -248,7 +245,7 @@ void Group::assign(int narg, char **arg)
 
   } else if (strcmp(arg[1],"subtract") == 0) {
 
-    if (narg < 4) error->all("Illegal group command");
+    if (narg < 4) error->all(FLERR,"Illegal group command");
     
     int length = narg-2;
     int *list = new int[length];
@@ -256,7 +253,7 @@ void Group::assign(int narg, char **arg)
     int jgroup;
     for (int iarg = 2; iarg < narg; iarg++) {
       jgroup = find(arg[iarg]);
-      if (jgroup == -1) error->all("Group ID does not exist");
+      if (jgroup == -1) error->all(FLERR,"Group ID does not exist");
       list[iarg-2] = jgroup;
     }
 
@@ -284,7 +281,7 @@ void Group::assign(int narg, char **arg)
 
   } else if (strcmp(arg[1],"union") == 0) {
 
-    if (narg < 3) error->all("Illegal group command");
+    if (narg < 3) error->all(FLERR,"Illegal group command");
     
     int length = narg-2;
     int *list = new int[length];
@@ -292,7 +289,7 @@ void Group::assign(int narg, char **arg)
     int jgroup;
     for (int iarg = 2; iarg < narg; iarg++) {
       jgroup = find(arg[iarg]);
-      if (jgroup == -1) error->all("Group ID does not exist");
+      if (jgroup == -1) error->all(FLERR,"Group ID does not exist");
       list[iarg-2] = jgroup;
     }
 
@@ -312,7 +309,7 @@ void Group::assign(int narg, char **arg)
 
   } else if (strcmp(arg[1],"intersect") == 0) {
 
-    if (narg < 4) error->all("Illegal group command");
+    if (narg < 4) error->all(FLERR,"Illegal group command");
     
     int length = narg-2;
     int *list = new int[length];
@@ -320,7 +317,7 @@ void Group::assign(int narg, char **arg)
     int jgroup;
     for (int iarg = 2; iarg < narg; iarg++) {
       jgroup = find(arg[iarg]);
-      if (jgroup == -1) error->all("Group ID does not exist");
+      if (jgroup == -1) error->all(FLERR,"Group ID does not exist");
       list[iarg-2] = jgroup;
     }
 
@@ -341,7 +338,7 @@ void Group::assign(int narg, char **arg)
 
   // not a valid group style
 
-  } else error->all("Illegal group command");
+  } else error->all(FLERR,"Illegal group command");
 
   // print stats for changed group
 
@@ -374,7 +371,7 @@ void Group::create(char *name, int *flag)
   int igroup = find(name);
 
   if (igroup == -1) {
-    if (ngroup == MAX_GROUP) error->all("Too many groups");
+    if (ngroup == MAX_GROUP) error->all(FLERR,"Too many groups");
     igroup = find_unused();
     int n = strlen(name) + 1;
     names[igroup] = new char[n];
diff --git a/src/improper.cpp b/src/improper.cpp
index 7b82590d0a4cbb66fc76795214d84e22fff960b7..3c65e8c89c64fa9fc2db2d026570c6f4599b2ba0 100644
--- a/src/improper.cpp
+++ b/src/improper.cpp
@@ -48,9 +48,9 @@ Improper::~Improper()
 
 void Improper::init()
 {
-  if (!allocated) error->all("Improper coeffs are not set");
+  if (!allocated) error->all(FLERR,"Improper coeffs are not set");
   for (int i = 1; i <= atom->nimpropertypes; i++)
-    if (setflag[i] == 0) error->all("All improper coeffs are not set");
+    if (setflag[i] == 0) error->all(FLERR,"All improper coeffs are not set");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/input.cpp b/src/input.cpp
index 05cb1f44127ecf4b111235b72901ca3ce0781377..bcabc023035b6e868f93b20d8f5f505e2e487e60 100644
--- a/src/input.cpp
+++ b/src/input.cpp
@@ -157,7 +157,7 @@ void Input::file()
 
     MPI_Bcast(&n,1,MPI_INT,0,world);
     if (n == 0) {
-      if (label_active) error->all("Label wasn't found in input script");
+      if (label_active) error->all(FLERR,"Label wasn't found in input script");
       if (me == 0) {
 	if (infile != stdin) fclose(infile);
 	nfile--;
@@ -175,7 +175,7 @@ void Input::file()
     if (n == MAXLINE) {
       char str[MAXLINE+32];
       sprintf(str,"Input line too long: %s",line);
-      error->all(str);
+      error->all(FLERR,str);
     }
 
     // echo the command unless scanning for label
@@ -200,7 +200,7 @@ void Input::file()
     if (execute_command()) {
       char str[MAXLINE];
       sprintf(str,"Unknown command: %s",line);
-      error->all(str);
+      error->all(FLERR,str);
     }
   }
 }
@@ -217,13 +217,13 @@ void Input::file(const char *filename)
 
   if (me == 0) {
     if (nfile > 1)
-      error->one("Another input script is already being processed");
+      error->one(FLERR,"Another input script is already being processed");
     if (infile != stdin) fclose(infile);
     infile = fopen(filename,"r");
     if (infile == NULL) {
       char str[128];
       sprintf(str,"Cannot open input script %s",filename);
-      error->one(str);
+      error->one(FLERR,str);
     }
     infiles[0] = infile;
   } else infile = NULL;
@@ -262,7 +262,7 @@ char *Input::one(const char *single)
   if (execute_command()) {
     char str[MAXLINE];
     sprintf(str,"Unknown command: %s",line);
-    error->all(str);
+    error->all(FLERR,str);
   }
 
   return command;
@@ -339,7 +339,7 @@ void Input::parse()
     narg++;
   }
 
-  if (quote) error->all("Unbalanced quotes in input line");
+  if (quote) error->all(FLERR,"Unbalanced quotes in input line");
 }
 
 /* ----------------------------------------------------------------------
@@ -367,7 +367,7 @@ void Input::substitute(char *str, int flag)
 	var = ptr+2;
 	int i = 0;
 	while (var[i] != '\0' && var[i] != '}') i++;
-	if (var[i] == '\0') error->one("Invalid variable name");
+	if (var[i] == '\0') error->one(FLERR,"Invalid variable name");
 	var[i] = '\0';
 	beyond = ptr + strlen(var) + 3;
       } else {
@@ -377,15 +377,15 @@ void Input::substitute(char *str, int flag)
 	beyond = ptr + strlen(var) + 1;
       }
       value = variable->retrieve(var);
-      if (value == NULL) error->one("Substitution for illegal variable");
+      if (value == NULL) error->one(FLERR,"Substitution for illegal variable");
 
       *ptr = '\0';
       strcpy(work,str);
       if (strlen(work)+strlen(value) >= MAXLINE)
-	error->one("Input line too long after variable substitution");
+	error->one(FLERR,"Input line too long after variable substitution");
       strcat(work,value);
       if (strlen(work)+strlen(beyond) >= MAXLINE)
-	error->one("Input line too long after variable substitution");
+	error->one(FLERR,"Input line too long after variable substitution");
       strcat(work,beyond);
       strcpy(str,work);
       ptr += strlen(value);
@@ -506,7 +506,7 @@ int Input::execute_command()
 
 void Input::clear()
 {
-  if (narg > 0) error->all("Illegal clear command");
+  if (narg > 0) error->all(FLERR,"Illegal clear command");
   lmp->destroy();
   lmp->create();
 }
@@ -515,7 +515,7 @@ void Input::clear()
 
 void Input::echo()
 {
-  if (narg != 1) error->all("Illegal echo command");
+  if (narg != 1) error->all(FLERR,"Illegal echo command");
 
   if (strcmp(arg[0],"none") == 0) {
     echo_screen = 0;
@@ -529,14 +529,14 @@ void Input::echo()
   } else if (strcmp(arg[0],"both") == 0) {
     echo_screen = 1;
     echo_log = 1;
-  } else error->all("Illegal echo command");
+  } else error->all(FLERR,"Illegal echo command");
 }
 
 /* ---------------------------------------------------------------------- */
 
 void Input::ifthenelse()
 {
-  if (narg < 3) error->all("Illegal if command");
+  if (narg < 3) error->all(FLERR,"Illegal if command");
 
   // substitute for variables in Boolean expression for "if"
   // in case expression was enclosed in quotes
@@ -552,7 +552,7 @@ void Input::ifthenelse()
 
   // bound "then" commands
 
-  if (strcmp(arg[1],"then") != 0) error->all("Illegal if command");
+  if (strcmp(arg[1],"then") != 0) error->all(FLERR,"Illegal if command");
 
   int first = 2;
   int iarg = first;
@@ -567,13 +567,13 @@ void Input::ifthenelse()
 
   if (btest != 0.0) {
     int ncommands = last-first + 1;
-    if (ncommands <= 0) error->all("Illegal if command");
+    if (ncommands <= 0) error->all(FLERR,"Illegal if command");
 
     char **commands = new char*[ncommands];
     ncommands = 0;
     for (int i = first; i <= last; i++) {
       int n = strlen(arg[i]) + 1;
-      if (n == 1) error->all("Illegal if command");
+      if (n == 1) error->all(FLERR,"Illegal if command");
       commands[ncommands] = new char[n];
       strcpy(commands[ncommands],arg[i]);
       ncommands++;
@@ -601,7 +601,7 @@ void Input::ifthenelse()
   // bound and execute "elif" or "else" commands
 
   while (1) {
-    if (iarg+2 > narg) error->all("Illegal if command");
+    if (iarg+2 > narg) error->all(FLERR,"Illegal if command");
     if (strcmp(arg[iarg],"elif") == 0) {
       strcpy(scopy,arg[iarg+1]);
       substitute(scopy,0);
@@ -621,13 +621,13 @@ void Input::ifthenelse()
     if (btest == 0.0) continue;
 
     int ncommands = last-first + 1;
-    if (ncommands <= 0) error->all("Illegal if command");
+    if (ncommands <= 0) error->all(FLERR,"Illegal if command");
 
     char **commands = new char*[ncommands];
     ncommands = 0;
     for (int i = first; i <= last; i++) {
       int n = strlen(arg[i]) + 1;
-      if (n == 1) error->all("Illegal if command");
+      if (n == 1) error->all(FLERR,"Illegal if command");
       commands[ncommands] = new char[n];
       strcpy(commands[ncommands],arg[i]);
       ncommands++;
@@ -651,7 +651,7 @@ void Input::ifthenelse()
 
 void Input::include()
 {
-  if (narg != 1) error->all("Illegal include command");
+  if (narg != 1) error->all(FLERR,"Illegal include command");
 
   if (me == 0) {
     if (nfile == maxfile) {
@@ -663,7 +663,7 @@ void Input::include()
     if (infile == NULL) {
       char str[128];
       sprintf(str,"Cannot open input script %s",arg[0]);
-      error->one(str);
+      error->one(FLERR,str);
     }
     infiles[nfile++] = infile;
   }
@@ -673,7 +673,7 @@ void Input::include()
 
 void Input::jump()
 {
-  if (narg < 1 || narg > 2) error->all("Illegal jump command");
+  if (narg < 1 || narg > 2) error->all(FLERR,"Illegal jump command");
 
   if (jump_skip) {
     jump_skip = 0;
@@ -688,7 +688,7 @@ void Input::jump()
       if (infile == NULL) {
 	char str[128];
 	sprintf(str,"Cannot open input script %s",arg[0]);
-	error->one(str);
+	error->one(FLERR,str);
       }
       infiles[nfile-1] = infile;
     }
@@ -707,7 +707,7 @@ void Input::jump()
 
 void Input::label()
 {
-  if (narg != 1) error->all("Illegal label command");
+  if (narg != 1) error->all(FLERR,"Illegal label command");
   if (label_active && strcmp(labelstr,arg[0]) == 0) label_active = 0;
 }
 
@@ -715,7 +715,7 @@ void Input::label()
 
 void Input::log()
 {
-  if (narg != 1) error->all("Illegal log command");
+  if (narg != 1) error->all(FLERR,"Illegal log command");
 
   if (me == 0) {
     if (logfile) fclose(logfile);
@@ -725,7 +725,7 @@ void Input::log()
       if (logfile == NULL) {
 	char str[128];
 	sprintf(str,"Cannot open logfile %s",arg[0]);
-	error->one(str);
+	error->one(FLERR,str);
       }
     }
     if (universe->nworlds == 1) universe->ulogfile = logfile;
@@ -743,7 +743,7 @@ void Input::next_command()
 
 void Input::print()
 {
-  if (narg != 1) error->all("Illegal print command");
+  if (narg != 1) error->all(FLERR,"Illegal print command");
 
   // substitute for $ variables (no printing) and print arg
 
@@ -758,14 +758,14 @@ void Input::print()
 
 void Input::shell()
 {
-  if (narg < 1) error->all("Illegal shell command");
+  if (narg < 1) error->all(FLERR,"Illegal shell command");
 
   if (strcmp(arg[0],"cd") == 0) {
-    if (narg != 2) error->all("Illegal shell command");
+    if (narg != 2) error->all(FLERR,"Illegal shell command");
     chdir(arg[1]);
 
   } else if (strcmp(arg[0],"mkdir") == 0) {
-    if (narg < 2) error->all("Illegal shell command");
+    if (narg < 2) error->all(FLERR,"Illegal shell command");
 #if !defined(WINDOWS) && !defined(__MINGW32_VERSION) 
     if (me == 0)
       for (int i = 1; i < narg; i++)
@@ -773,16 +773,16 @@ void Input::shell()
 #endif
 
   } else if (strcmp(arg[0],"mv") == 0) {
-    if (narg != 3) error->all("Illegal shell command");
+    if (narg != 3) error->all(FLERR,"Illegal shell command");
     if (me == 0) rename(arg[1],arg[2]);
 
   } else if (strcmp(arg[0],"rm") == 0) {
-    if (narg < 2) error->all("Illegal shell command");
+    if (narg < 2) error->all(FLERR,"Illegal shell command");
     if (me == 0)
       for (int i = 1; i < narg; i++) unlink(arg[i]);
 
   } else if (strcmp(arg[0],"rmdir") == 0) {
-    if (narg < 2) error->all("Illegal shell command");
+    if (narg < 2) error->all(FLERR,"Illegal shell command");
     if (me == 0)
       for (int i = 1; i < narg; i++) rmdir(arg[i]);
 
@@ -819,11 +819,11 @@ void Input::variable_command()
 void Input::angle_coeff()
 {
   if (domain->box_exist == 0)
-    error->all("Angle_coeff command before simulation box is defined");
+    error->all(FLERR,"Angle_coeff command before simulation box is defined");
   if (force->angle == NULL) 
-    error->all("Angle_coeff command before angle_style is defined");
+    error->all(FLERR,"Angle_coeff command before angle_style is defined");
   if (atom->avec->angles_allow == 0) 
-    error->all("Angle_coeff command when no angles allowed");
+    error->all(FLERR,"Angle_coeff command when no angles allowed");
   force->angle->coeff(narg,arg);
 }
 
@@ -831,9 +831,9 @@ void Input::angle_coeff()
 
 void Input::angle_style()
 {
-  if (narg < 1) error->all("Illegal angle_style command");
+  if (narg < 1) error->all(FLERR,"Illegal angle_style command");
   if (atom->avec->angles_allow == 0) 
-    error->all("Angle_style command when no angles allowed");
+    error->all(FLERR,"Angle_style command when no angles allowed");
   force->create_angle(arg[0]);
   if (force->angle) force->angle->settings(narg-1,&arg[1]);
 }
@@ -849,9 +849,9 @@ void Input::atom_modify()
 
 void Input::atom_style()
 {
-  if (narg < 1) error->all("Illegal atom_style command");
+  if (narg < 1) error->all(FLERR,"Illegal atom_style command");
   if (domain->box_exist) 
-    error->all("Atom_style command after simulation box is defined");
+    error->all(FLERR,"Atom_style command after simulation box is defined");
   atom->create_avec(arg[0],narg-1,&arg[1],lmp->suffix);
 }
 
@@ -860,11 +860,11 @@ void Input::atom_style()
 void Input::bond_coeff()
 {
   if (domain->box_exist == 0)
-    error->all("Bond_coeff command before simulation box is defined");
+    error->all(FLERR,"Bond_coeff command before simulation box is defined");
   if (force->bond == NULL) 
-    error->all("Bond_coeff command before bond_style is defined");
+    error->all(FLERR,"Bond_coeff command before bond_style is defined");
   if (atom->avec->bonds_allow == 0) 
-    error->all("Bond_coeff command when no bonds allowed");
+    error->all(FLERR,"Bond_coeff command when no bonds allowed");
   force->bond->coeff(narg,arg);
 }
 
@@ -872,9 +872,9 @@ void Input::bond_coeff()
 
 void Input::bond_style()
 {
-  if (narg < 1) error->all("Illegal bond_style command");
+  if (narg < 1) error->all(FLERR,"Illegal bond_style command");
   if (atom->avec->bonds_allow == 0) 
-    error->all("Bond_style command when no bonds allowed");
+    error->all(FLERR,"Bond_style command when no bonds allowed");
   force->create_bond(arg[0]);
   if (force->bond) force->bond->settings(narg-1,&arg[1]);
 }
@@ -884,7 +884,7 @@ void Input::bond_style()
 void Input::boundary()
 {
   if (domain->box_exist)
-    error->all("Boundary command after simulation box is defined");
+    error->all(FLERR,"Boundary command after simulation box is defined");
   domain->set_boundary(narg,arg);
 }
 
@@ -913,7 +913,7 @@ void Input::compute_modify()
 
 void Input::dielectric()
 {
-  if (narg != 1) error->all("Illegal dielectric command");
+  if (narg != 1) error->all(FLERR,"Illegal dielectric command");
   force->dielectric = atof(arg[0]);
 }
 
@@ -922,11 +922,11 @@ void Input::dielectric()
 void Input::dihedral_coeff()
 {
   if (domain->box_exist == 0)
-    error->all("Dihedral_coeff command before simulation box is defined");
+    error->all(FLERR,"Dihedral_coeff command before simulation box is defined");
   if (force->dihedral == NULL) 
-    error->all("Dihedral_coeff command before dihedral_style is defined");
+    error->all(FLERR,"Dihedral_coeff command before dihedral_style is defined");
   if (atom->avec->dihedrals_allow == 0) 
-    error->all("Dihedral_coeff command when no dihedrals allowed");
+    error->all(FLERR,"Dihedral_coeff command when no dihedrals allowed");
   force->dihedral->coeff(narg,arg);
 }
 
@@ -934,9 +934,9 @@ void Input::dihedral_coeff()
 
 void Input::dihedral_style()
 {
-  if (narg < 1) error->all("Illegal dihedral_style command");
+  if (narg < 1) error->all(FLERR,"Illegal dihedral_style command");
   if (atom->avec->dihedrals_allow == 0) 
-    error->all("Dihedral_style command when no dihedrals allowed");
+    error->all(FLERR,"Dihedral_style command when no dihedrals allowed");
   force->create_dihedral(arg[0]);
   if (force->dihedral) force->dihedral->settings(narg-1,&arg[1]);
 }
@@ -945,12 +945,12 @@ void Input::dihedral_style()
 
 void Input::dimension()
 {
-  if (narg != 1) error->all("Illegal dimension command");
+  if (narg != 1) error->all(FLERR,"Illegal dimension command");
   if (domain->box_exist) 
-    error->all("Dimension command after simulation box is defined");
+    error->all(FLERR,"Dimension command after simulation box is defined");
   domain->dimension = atoi(arg[0]);
   if (domain->dimension != 2 && domain->dimension != 3)
-    error->all("Illegal dimension command");
+    error->all(FLERR,"Illegal dimension command");
 
   // must reset default extra_dof of all computes
   // since some were created before dimension command is encountered
@@ -999,11 +999,11 @@ void Input::group_command()
 void Input::improper_coeff()
 {
   if (domain->box_exist == 0)
-    error->all("Improper_coeff command before simulation box is defined");
+    error->all(FLERR,"Improper_coeff command before simulation box is defined");
   if (force->improper == NULL) 
-    error->all("Improper_coeff command before improper_style is defined");
+    error->all(FLERR,"Improper_coeff command before improper_style is defined");
   if (atom->avec->impropers_allow == 0) 
-    error->all("Improper_coeff command when no impropers allowed");
+    error->all(FLERR,"Improper_coeff command when no impropers allowed");
   force->improper->coeff(narg,arg);
 }
 
@@ -1011,9 +1011,9 @@ void Input::improper_coeff()
 
 void Input::improper_style()
 {
-  if (narg < 1) error->all("Illegal improper_style command");
+  if (narg < 1) error->all(FLERR,"Illegal improper_style command");
   if (atom->avec->impropers_allow == 0) 
-    error->all("Improper_style command when no impropers allowed");
+    error->all(FLERR,"Improper_style command when no impropers allowed");
   force->create_improper(arg[0]);
   if (force->improper) force->improper->settings(narg-1,&arg[1]);
 }
@@ -1022,7 +1022,7 @@ void Input::improper_style()
 
 void Input::kspace_modify()
 {
-  if (force->kspace == NULL) error->all("KSpace style has not yet been set");
+  if (force->kspace == NULL) error->all(FLERR,"KSpace style has not yet been set");
   force->kspace->modify_params(narg,arg);
 }
 
@@ -1044,9 +1044,9 @@ void Input::lattice()
 
 void Input::mass()
 {
-  if (narg != 2) error->all("Illegal mass command");
+  if (narg != 2) error->all(FLERR,"Illegal mass command");
   if (domain->box_exist == 0)
-    error->all("Mass command before simulation box is defined");
+    error->all(FLERR,"Mass command before simulation box is defined");
   atom->set_mass(narg,arg);
 }
 
@@ -1062,7 +1062,7 @@ void Input::min_modify()
 void Input::min_style()
 {
   if (domain->box_exist == 0)
-    error->all("Min_style command before simulation box is defined");
+    error->all(FLERR,"Min_style command before simulation box is defined");
   update->create_minimize(narg,arg);
 }
 
@@ -1089,25 +1089,25 @@ void Input::newton()
   if (narg == 1) {
     if (strcmp(arg[0],"off") == 0) newton_pair = newton_bond = 0;
     else if (strcmp(arg[0],"on") == 0) newton_pair = newton_bond = 1;
-    else error->all("Illegal newton command");
+    else error->all(FLERR,"Illegal newton command");
   } else if (narg == 2) {
     if (strcmp(arg[0],"off") == 0) newton_pair = 0;
     else if (strcmp(arg[0],"on") == 0) newton_pair= 1;
-    else error->all("Illegal newton command");
+    else error->all(FLERR,"Illegal newton command");
     if (strcmp(arg[1],"off") == 0) newton_bond = 0;
     else if (strcmp(arg[1],"on") == 0) newton_bond = 1;
-    else error->all("Illegal newton command");
-  } else error->all("Illegal newton command");
+    else error->all(FLERR,"Illegal newton command");
+  } else error->all(FLERR,"Illegal newton command");
 
   force->newton_pair = newton_pair;
 
   if (newton_bond == 0) {
     if (domain->box_exist && force->newton_bond == 1) 
-      error->all("Newton bond change after simulation box is defined");
+      error->all(FLERR,"Newton bond change after simulation box is defined");
     force->newton_bond = 0;
   } else {
     if (domain->box_exist && force->newton_bond == 0) 
-      error->all("Newton bond change after simulation box is defined");
+      error->all(FLERR,"Newton bond change after simulation box is defined");
     force->newton_bond = 1;
   }
 
@@ -1120,12 +1120,12 @@ void Input::newton()
 void Input::package()
 {
   if (domain->box_exist) 
-    error->all("Package command after simulation box is defined");
-  if (narg < 1) error->all("Illegal package command");
+    error->all(FLERR,"Package command after simulation box is defined");
+  if (narg < 1) error->all(FLERR,"Illegal package command");
 
   if (strcmp(arg[0],"cuda") == 0) {
     if (!lmp->cuda)
-      error->all("Package cuda command without USER-CUDA installed");
+      error->all(FLERR,"Package cuda command without USER-CUDA installed");
     lmp->cuda->accelerator(narg-1,&arg[1]);
 
   } else if (strcmp(arg[0],"gpu") == 0) {
@@ -1142,9 +1142,9 @@ void Input::package()
   } else if (strcmp(arg[0],"omp") == 0) {
 
 #ifdef _OPENMP
-    if (narg != 2) error->all("Illegal package command");
+    if (narg != 2) error->all(FLERR,"Illegal package command");
     comm->nthreads = atoi(arg[1]);
-    if (comm->nthreads < 1) error->all("Illegal package command");
+    if (comm->nthreads < 1) error->all(FLERR,"Illegal package command");
 
     omp_set_num_threads(comm->nthreads);
     if (me == 0) {
@@ -1156,10 +1156,10 @@ void Input::package()
 		comm->nthreads);
     }
 #else
-    error->all("Cannot use package omp command with no OpenMP support");
+    error->all(FLERR,"Cannot use package omp command with no OpenMP support");
 #endif
 
-  } else error->all("Illegal package command");
+  } else error->all(FLERR,"Illegal package command");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -1167,9 +1167,9 @@ void Input::package()
 void Input::pair_coeff()
 {
   if (domain->box_exist == 0)
-    error->all("Pair_coeff command before simulation box is defined");
+    error->all(FLERR,"Pair_coeff command before simulation box is defined");
   if (force->pair == NULL) 
-    error->all("Pair_coeff command before pair_style is defined");
+    error->all(FLERR,"Pair_coeff command before pair_style is defined");
   force->pair->coeff(narg,arg);
 }
 
@@ -1178,7 +1178,7 @@ void Input::pair_coeff()
 void Input::pair_modify()
 {
   if (force->pair == NULL) 
-    error->all("Pair_modify command before pair_style is defined");
+    error->all(FLERR,"Pair_modify command before pair_style is defined");
   force->pair->modify_params(narg,arg);
 }
 
@@ -1189,7 +1189,7 @@ void Input::pair_modify()
 
 void Input::pair_style()
 {
-  if (narg < 1) error->all("Illegal pair_style command");
+  if (narg < 1) error->all(FLERR,"Illegal pair_style command");
   if (force->pair && strcmp(arg[0],force->pair_style) == 0) {
     force->pair->settings(narg-1,&arg[1]);
     return;
@@ -1203,7 +1203,7 @@ void Input::pair_style()
 void Input::pair_write()
 {
   if (force->pair == NULL) 
-    error->all("Pair_write command before pair_style is defined");
+    error->all(FLERR,"Pair_write command before pair_style is defined");
   force->pair->write_file(narg,arg);
 }
 
@@ -1211,9 +1211,9 @@ void Input::pair_write()
 
 void Input::processors()
 {
-  if (narg != 3) error->all("Illegal processors command");
+  if (narg != 3) error->all(FLERR,"Illegal processors command");
   if (domain->box_exist)
-    error->all("Processors command after simulation box is defined");
+    error->all(FLERR,"Processors command after simulation box is defined");
 
   if (strcmp(arg[0],"*") == 0) comm->user_procgrid[0] = 0;
   else comm->user_procgrid[0] = atoi(arg[0]);
@@ -1223,7 +1223,7 @@ void Input::processors()
   else comm->user_procgrid[2] = atoi(arg[2]);
 
   if (comm->user_procgrid[0] < 0 || comm->user_procgrid[1] < 0 ||
-      comm->user_procgrid[2] < 0) error->all("Illegal processors command");
+      comm->user_procgrid[2] < 0) error->all(FLERR,"Illegal processors command");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -1252,7 +1252,7 @@ void Input::restart()
 void Input::run_style()
 {
   if (domain->box_exist == 0)
-    error->all("Run_style command before simulation box is defined");
+    error->all(FLERR,"Run_style command before simulation box is defined");
   update->create_integrate(narg,arg,lmp->suffix);
 }
 
@@ -1291,7 +1291,7 @@ void Input::special_bonds()
 
 void Input::suffix()
 {
-  if (narg != 1) error->all("Illegal suffix command");
+  if (narg != 1) error->all(FLERR,"Illegal suffix command");
   
   if (strcmp(arg[0],"off") == 0) lmp->suffix_enable = 0;
   else if (strcmp(arg[0],"on") == 0) lmp->suffix_enable = 1;
@@ -1308,7 +1308,7 @@ void Input::suffix()
 
 void Input::thermo()
 {
-  if (narg != 1) error->all("Illegal thermo command");
+  if (narg != 1) error->all(FLERR,"Illegal thermo command");
   output->thermo_every = atoi(arg[0]);
 }
 
@@ -1330,7 +1330,7 @@ void Input::thermo_style()
 
 void Input::timestep()
 {
-  if (narg != 1) error->all("Illegal timestep command");
+  if (narg != 1) error->all(FLERR,"Illegal timestep command");
   update->dt = atof(arg[0]);
 }
 
@@ -1338,7 +1338,7 @@ void Input::timestep()
 
 void Input::uncompute()
 {
-  if (narg != 1) error->all("Illegal uncompute command");
+  if (narg != 1) error->all(FLERR,"Illegal uncompute command");
   modify->delete_compute(arg[0]);
 }
 
@@ -1346,7 +1346,7 @@ void Input::uncompute()
 
 void Input::undump()
 {
-  if (narg != 1) error->all("Illegal undump command");
+  if (narg != 1) error->all(FLERR,"Illegal undump command");
   output->delete_dump(arg[0]);
 }
 
@@ -1354,7 +1354,7 @@ void Input::undump()
 
 void Input::unfix()
 {
-  if (narg != 1) error->all("Illegal unfix command");
+  if (narg != 1) error->all(FLERR,"Illegal unfix command");
   modify->delete_fix(arg[0]);
 }
 
@@ -1362,8 +1362,8 @@ void Input::unfix()
 
 void Input::units()
 {
-  if (narg != 1) error->all("Illegal units command");
+  if (narg != 1) error->all(FLERR,"Illegal units command");
   if (domain->box_exist) 
-    error->all("Units command after simulation box is defined");
+    error->all(FLERR,"Units command after simulation box is defined");
   update->set_units(arg[0]);
 }
diff --git a/src/irregular.cpp b/src/irregular.cpp
index d9abe11b88704570dd8acc1087f710a74eb4be12..fe801ae45e3feae5e0249537b83a640c016b2fba 100644
--- a/src/irregular.cpp
+++ b/src/irregular.cpp
@@ -28,9 +28,6 @@ using namespace LAMMPS_NS;
 #define BUFMIN 1000
 #define BUFEXTRA 1000
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 Irregular::Irregular(LAMMPS *lmp) : Pointers(lmp)
diff --git a/src/kspace.cpp b/src/kspace.cpp
index c0613140d3fbf8ca9eff3bd81b57f2e5bc80936e..116535f8eed71560d70454e71c40f0a8e2dc80dd 100644
--- a/src/kspace.cpp
+++ b/src/kspace.cpp
@@ -40,7 +40,7 @@ void KSpace::modify_params(int narg, char **arg)
   int iarg = 0;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"mesh") == 0) {
-      if (iarg+4 > narg) error->all("Illegal kspace_modify command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal kspace_modify command");
       nx_pppm = atoi(arg[iarg+1]);
       ny_pppm = atoi(arg[iarg+2]);
       nz_pppm = atoi(arg[iarg+3]);
@@ -48,26 +48,26 @@ void KSpace::modify_params(int narg, char **arg)
       else gridflag = 1;
       iarg += 4;
     } else if (strcmp(arg[iarg],"order") == 0) {
-      if (iarg+2 > narg) error->all("Illegal kspace_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command");
       order = atoi(arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"gewald") == 0) {
-      if (iarg+2 > narg) error->all("Illegal kspace_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command");
       g_ewald = atof(arg[iarg+1]);
       if (g_ewald == 0.0) gewaldflag = 0;
       else gewaldflag = 1;
       iarg += 2;
     } else if (strcmp(arg[iarg],"slab") == 0) {
-      if (iarg+2 > narg) error->all("Illegal kspace_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command");
       slab_volfactor = atof(arg[iarg+1]);
       iarg += 2;
       if (slab_volfactor <= 1.0)
-	error->all("Bad kspace_modify slab parameter");
+	error->all(FLERR,"Bad kspace_modify slab parameter");
       if (slab_volfactor < 2.0 && comm->me == 0) 
-	error->warning("Kspace_modify slab param < 2.0 may "
+	error->warning(FLERR,"Kspace_modify slab param < 2.0 may "
 		       "cause unphysical behavior");
       slabflag = 1;
-    } else error->all("Illegal kspace_modify command");
+    } else error->all(FLERR,"Illegal kspace_modify command");
   }
 }
 
diff --git a/src/lammps.cpp b/src/lammps.cpp
index e5342c1e3139ccfeb72248fb827de1cff552bd5f..09b6a487dee74b5322818b335fcb2b159b21758b 100644
--- a/src/lammps.cpp
+++ b/src/lammps.cpp
@@ -81,7 +81,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
     if (strcmp(arg[iarg],"-partition") == 0 || 
 	strcmp(arg[iarg],"-p") == 0) {
       universe->existflag = 1;
-      if (iarg+2 > narg) error->universe_all("Invalid command-line argument");
+      if (iarg+2 > narg) error->universe_all(FLERR,"Invalid command-line argument");
       iarg++;
       while (iarg < narg && arg[iarg][0] != '-') {
 	universe->add_world(arg[iarg]);
@@ -89,50 +89,50 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
       }
     } else if (strcmp(arg[iarg],"-in") == 0 || 
 	       strcmp(arg[iarg],"-i") == 0) {
-      if (iarg+2 > narg) error->universe_all("Invalid command-line argument");
+      if (iarg+2 > narg) error->universe_all(FLERR,"Invalid command-line argument");
       inflag = iarg + 1;
       iarg += 2;
     } else if (strcmp(arg[iarg],"-screen") == 0 || 
 	       strcmp(arg[iarg],"-sc") == 0) {
-      if (iarg+2 > narg) error->universe_all("Invalid command-line argument");
+      if (iarg+2 > narg) error->universe_all(FLERR,"Invalid command-line argument");
       screenflag = iarg + 1;
       iarg += 2;
     } else if (strcmp(arg[iarg],"-log") == 0 || 
 	       strcmp(arg[iarg],"-l") == 0) {
-      if (iarg+2 > narg) error->universe_all("Invalid command-line argument");
+      if (iarg+2 > narg) error->universe_all(FLERR,"Invalid command-line argument");
       logflag = iarg + 1;
       iarg += 2;
     } else if (strcmp(arg[iarg],"-var") == 0 || 
 	       strcmp(arg[iarg],"-v") == 0) {
-      if (iarg+3 > narg) error->universe_all("Invalid command-line argument");
+      if (iarg+3 > narg) error->universe_all(FLERR,"Invalid command-line argument");
       iarg += 2;
       while (iarg < narg && arg[iarg][0] != '-') iarg++;
     } else if (strcmp(arg[iarg],"-echo") == 0 || 
 	       strcmp(arg[iarg],"-e") == 0) {
-      if (iarg+2 > narg) error->universe_all("Invalid command-line argument");
+      if (iarg+2 > narg) error->universe_all(FLERR,"Invalid command-line argument");
       iarg += 2;
     } else if (strcmp(arg[iarg],"-pscreen") == 0 || 
 	       strcmp(arg[iarg],"-ps") == 0) {
       if (iarg+2 > narg) 
-       error->universe_all("Invalid command-line argument");
+       error->universe_all(FLERR,"Invalid command-line argument");
       partscreenflag = iarg + 1;
       iarg += 2;
     } else if (strcmp(arg[iarg],"-plog") == 0 || 
 	       strcmp(arg[iarg],"-pl") == 0) {
       if (iarg+2 > narg) 
-       error->universe_all("Invalid command-line argument");
+       error->universe_all(FLERR,"Invalid command-line argument");
       partlogflag = iarg + 1;
       iarg += 2;
     } else if (strcmp(arg[iarg],"-cuda") == 0 || 
 	       strcmp(arg[iarg],"-c") == 0) {
-      if (iarg+2 > narg) error->universe_all("Invalid command-line argument");
+      if (iarg+2 > narg) error->universe_all(FLERR,"Invalid command-line argument");
       if (strcmp(arg[iarg+1],"on") == 0) cudaflag = 1;
       else if (strcmp(arg[iarg+1],"off") == 0) cudaflag = 0;
-      else error->universe_all("Invalid command-line argument");
+      else error->universe_all(FLERR,"Invalid command-line argument");
       iarg += 2;
     } else if (strcmp(arg[iarg],"-suffix") == 0 || 
 	       strcmp(arg[iarg],"-sf") == 0) {
-      if (iarg+2 > narg) error->universe_all("Invalid command-line argument");
+      if (iarg+2 > narg) error->universe_all(FLERR,"Invalid command-line argument");
       delete [] suffix;
       int n = strlen(arg[iarg+1]) + 1;
       suffix = new char[n];
@@ -141,10 +141,10 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
       iarg += 2;
     } else if (strcmp(arg[iarg],"-help") == 0 || 
 	       strcmp(arg[iarg],"-h") == 0) {
-      if (iarg+1 > narg) error->universe_all("Invalid command-line argument");
+      if (iarg+1 > narg) error->universe_all(FLERR,"Invalid command-line argument");
       helpflag = 1;
       iarg += 1;
-    } else error->universe_all("Invalid command-line argument");
+    } else error->universe_all(FLERR,"Invalid command-line argument");
   }
 
   // if no partition command-line switch, universe is one world w/ all procs
@@ -154,22 +154,22 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
   // sum of procs in all worlds must equal total # of procs
 
   if (!universe->consistent())
-    error->universe_all("Processor partitions are inconsistent");
+    error->universe_all(FLERR,"Processor partitions are inconsistent");
 
   // universe cannot use stdin for input file
 
   if (universe->existflag && inflag == 0)
-    error->universe_all("Must use -in switch with multiple partitions");
+    error->universe_all(FLERR,"Must use -in switch with multiple partitions");
 
   // if no partition command-line switch, cannot use -pscreen option
 
   if (universe->existflag == 0 && partscreenflag)
-    error->universe_all("Can only use -pscreen with multiple partitions");
+    error->universe_all(FLERR,"Can only use -pscreen with multiple partitions");
 
   // if no partition command-line switch, cannot use -plog option
 
   if (universe->existflag == 0 && partlogflag)
-    error->universe_all("Can only use -plog with multiple partitions");
+    error->universe_all(FLERR,"Can only use -plog with multiple partitions");
 
   // set universe screen and logfile
 
@@ -181,18 +181,18 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
     else {
       universe->uscreen = fopen(arg[screenflag],"w");
       if (universe->uscreen == NULL) 
-	error->universe_one("Cannot open universe screen file");
+	error->universe_one(FLERR,"Cannot open universe screen file");
     }
     if (logflag == 0) {
       universe->ulogfile = fopen("log.lammps","w");
       if (universe->ulogfile == NULL) 
-	error->universe_one("Cannot open log.lammps");
+	error->universe_one(FLERR,"Cannot open log.lammps");
     } else if (strcmp(arg[logflag],"none") == 0)
       universe->ulogfile = NULL;
     else {
       universe->ulogfile = fopen(arg[logflag],"w");
       if (universe->ulogfile == NULL) 
-	error->universe_one("Cannot open universe log file");
+	error->universe_one(FLERR,"Cannot open universe log file");
     }
   }
 
@@ -219,7 +219,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
       if (infile == NULL) {
 	char str[128];
 	sprintf(str,"Cannot open input script %s",arg[inflag]);
-	error->one(str);
+	error->one(FLERR,str);
       }
     }
 
@@ -244,14 +244,14 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
          char str[32];
          sprintf(str,"screen.%d",universe->iworld);
          screen = fopen(str,"w");
-         if (screen == NULL) error->one("Cannot open screen file");
+         if (screen == NULL) error->one(FLERR,"Cannot open screen file");
        } else if (strcmp(arg[screenflag],"none") == 0)
          screen = NULL;
        else {
          char str[128];
          sprintf(str,"%s.%d",arg[screenflag],universe->iworld);
          screen = fopen(str,"w");
-         if (screen == NULL) error->one("Cannot open screen file");
+         if (screen == NULL) error->one(FLERR,"Cannot open screen file");
        }
       else if (strcmp(arg[partscreenflag],"none") == 0)
 	screen = NULL;
@@ -259,7 +259,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
 	char str[128];
 	sprintf(str,"%s.%d",arg[partscreenflag],universe->iworld);
 	screen = fopen(str,"w");
-	if (screen == NULL) error->one("Cannot open screen file");
+	if (screen == NULL) error->one(FLERR,"Cannot open screen file");
       } else screen = NULL;
     
     if (me == 0)
@@ -268,14 +268,14 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
          char str[32];
          sprintf(str,"log.lammps.%d",universe->iworld);
          logfile = fopen(str,"w");
-         if (logfile == NULL) error->one("Cannot open logfile");
+         if (logfile == NULL) error->one(FLERR,"Cannot open logfile");
        } else if (strcmp(arg[logflag],"none") == 0)
          logfile = NULL;
        else {
          char str[128];
          sprintf(str,"%s.%d",arg[logflag],universe->iworld);
          logfile = fopen(str,"w");
-         if (logfile == NULL) error->one("Cannot open logfile");
+         if (logfile == NULL) error->one(FLERR,"Cannot open logfile");
        }
       else if (strcmp(arg[partlogflag],"none") == 0)
 	logfile = NULL;
@@ -283,7 +283,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
 	char str[128];
 	sprintf(str,"%s.%d",arg[partlogflag],universe->iworld);
 	logfile = fopen(str,"w");
-	if (logfile == NULL) error->one("Cannot open logfile");
+	if (logfile == NULL) error->one(FLERR,"Cannot open logfile");
       } else logfile = NULL;
     
     if (me == 0) {
@@ -291,7 +291,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
       if (infile == NULL) {
 	char str[128];
 	sprintf(str,"Cannot open input script %s",arg[inflag]);
-	error->one(str);
+	error->one(FLERR,str);
       }
     } else infile = NULL;
     
@@ -325,34 +325,34 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
   // check datatype settings in lmptype.h
 
   if (sizeof(smallint) != sizeof(int))
-    error->all("Smallint setting in lmptype.h is invalid");
+    error->all(FLERR,"Smallint setting in lmptype.h is invalid");
   if (sizeof(tagint) < sizeof(smallint))
-    error->all("Tagint setting in lmptype.h is invalid");
+    error->all(FLERR,"Tagint setting in lmptype.h is invalid");
   if (sizeof(bigint) < sizeof(tagint))
-    error->all("Bigint setting in lmptype.h is invalid");
+    error->all(FLERR,"Bigint setting in lmptype.h is invalid");
 
   int mpisize;
   MPI_Type_size(MPI_LMP_TAGINT,&mpisize);
   if (mpisize != sizeof(tagint))
-      error->all("MPI_LMP_TAGINT and tagint in lmptype.h are not compatible");
+      error->all(FLERR,"MPI_LMP_TAGINT and tagint in lmptype.h are not compatible");
   MPI_Type_size(MPI_LMP_BIGINT,&mpisize);
   if (mpisize != sizeof(bigint))
-      error->all("MPI_LMP_BIGINT and bigint in lmptype.h are not compatible");
+      error->all(FLERR,"MPI_LMP_BIGINT and bigint in lmptype.h are not compatible");
 
 #ifdef LAMMPS_SMALLBIG
   if (sizeof(smallint) != 4 || sizeof(tagint) != 4 || sizeof(bigint) != 8)
-    error->all("Small, tag, big integers are not sized correctly");
+    error->all(FLERR,"Small, tag, big integers are not sized correctly");
 #endif
 #ifdef LAMMPS_BIGBIG
   if (sizeof(smallint) != 4 || sizeof(tagint) != 8 || sizeof(bigint) != 8)
-    error->all("Small, tag, big integers are not sized correctly");
+    error->all(FLERR,"Small, tag, big integers are not sized correctly");
 #endif
 #ifdef LAMMPS_SMALLSMALL
   if (sizeof(smallint) != 4 || sizeof(tagint) != 4 || sizeof(bigint) != 4)
-    error->all("Small, tag, big integers are not sized correctly");
+    error->all(FLERR,"Small, tag, big integers are not sized correctly");
 #endif
 
-  if (sizeof(tagint) == 8) error->all("64-bit atom IDs are not yet supported");
+  if (sizeof(tagint) == 8) error->all(FLERR,"64-bit atom IDs are not yet supported");
 
   // create CUDA class if USER-CUDA installed, unless explicitly switched off
   // instantiation creates dummy CUDA class if USER-CUDA is not installed
@@ -362,7 +362,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
   } else if (cudaflag == 1) {
     cuda = new Cuda(this);
     if (!cuda->cuda_exists)
-      error->all("Cannot use -cuda on without USER-CUDA installed");
+      error->all(FLERR,"Cannot use -cuda on without USER-CUDA installed");
   } else {
     cuda = new Cuda(this);
     if (!cuda->cuda_exists) {
@@ -373,7 +373,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
   
   int me;
   MPI_Comm_rank(world,&me);
-  if (cuda && me == 0) error->message("USER-CUDA mode is enabled");
+  if (cuda && me == 0) error->message(FLERR,"USER-CUDA mode is enabled");
 
   // allocate input class now that MPI is fully setup
 
diff --git a/src/lattice.cpp b/src/lattice.cpp
index 48e749834c310935cc371dcde42f015d52ed9183..196074deb8fbdbc028ea9039983356b778106cbd 100644
--- a/src/lattice.cpp
+++ b/src/lattice.cpp
@@ -23,8 +23,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
 #define BIG 1.0e30
 
 enum{NONE,SC,BCC,FCC,HCP,DIAMOND,SQ,SQ2,HEX,CUSTOM};
@@ -38,7 +36,7 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
 
   // parse style arg
 
-  if (narg < 1) error->all("Illegal lattice command");
+  if (narg < 1) error->all(FLERR,"Illegal lattice command");
 
   if (strcmp(arg[0],"none") == 0) style = NONE;
   else if (strcmp(arg[0],"sc") == 0) style = SC;
@@ -50,10 +48,10 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
   else if (strcmp(arg[0],"sq2") == 0) style = SQ2;
   else if (strcmp(arg[0],"hex") == 0) style = HEX;
   else if (strcmp(arg[0],"custom") == 0) style = CUSTOM;
-  else error->all("Illegal lattice command");
+  else error->all(FLERR,"Illegal lattice command");
 
   if (style == NONE) {
-    if (narg > 1) error->all("Illegal lattice command");
+    if (narg > 1) error->all(FLERR,"Illegal lattice command");
     return;
   }
 
@@ -64,18 +62,18 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
   if (dimension == 2) {
     if (style == SC || style == BCC || style == FCC || style == HCP ||
 	style == DIAMOND)
-      error->all("Lattice style incompatible with simulation dimension");
+      error->all(FLERR,"Lattice style incompatible with simulation dimension");
   }
   if (dimension == 3) {
     if (style == SQ || style == SQ2 || style == HEX)
-      error->all("Lattice style incompatible with simulation dimension");
+      error->all(FLERR,"Lattice style incompatible with simulation dimension");
   }
 
   // scale = conversion factor between lattice and box units
 
-  if (narg < 2) error->all("Illegal lattice command");
+  if (narg < 2) error->all(FLERR,"Illegal lattice command");
   scale = atof(arg[1]);
-  if (scale <= 0.0) error->all("Illegal lattice command");
+  if (scale <= 0.0) error->all(FLERR,"Illegal lattice command");
 
   // set basis atoms for each style
   // x,y,z = fractional coords within unit cell
@@ -140,23 +138,23 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
   int iarg = 2;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"origin") == 0) {
-      if (iarg+4 > narg) error->all("Illegal lattice command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal lattice command");
       origin[0] = atof(arg[iarg+1]);
       origin[1] = atof(arg[iarg+2]);
       origin[2] = atof(arg[iarg+3]);
       if (origin[0] < 0.0 || origin[0] >= 1.0 ||
 	  origin[1] < 0.0 || origin[1] >= 1.0 ||
 	  origin[2] < 0.0 || origin[2] >= 1.0)
-	error->all("Illegal lattice command");
+	error->all(FLERR,"Illegal lattice command");
       iarg += 4;
 
     } else if (strcmp(arg[iarg],"orient") == 0) {
-      if (iarg+5 > narg) error->all("Illegal lattice command");
+      if (iarg+5 > narg) error->all(FLERR,"Illegal lattice command");
       int dim;
       if (strcmp(arg[iarg+1],"x") == 0) dim = 0;
       else if (strcmp(arg[iarg+1],"y") == 0) dim = 1;
       else if (strcmp(arg[iarg+1],"z") == 0) dim = 2;
-      else error->all("Illegal lattice command");
+      else error->all(FLERR,"Illegal lattice command");
       int *orient;
       if (dim == 0) orient = orientx;
       else if (dim == 1) orient = orienty;
@@ -167,7 +165,7 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
       iarg += 5;
 
     } else if (strcmp(arg[iarg],"spacing") == 0) {
-      if (iarg+4 > narg) error->all("Illegal lattice command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal lattice command");
       spaceflag = 1;
       xlattice = atof(arg[iarg+1]);
       ylattice = atof(arg[iarg+2]);
@@ -175,67 +173,67 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
       iarg += 4;
 
     } else if (strcmp(arg[iarg],"a1") == 0) {
-      if (iarg+4 > narg) error->all("Illegal lattice command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal lattice command");
       if (style != CUSTOM) 
-	error->all("Invalid option in lattice command for non-custom style");
+	error->all(FLERR,"Invalid option in lattice command for non-custom style");
       a1[0] = atof(arg[iarg+1]);
       a1[1] = atof(arg[iarg+2]);
       a1[2] = atof(arg[iarg+3]);
       iarg += 4;
     } else if (strcmp(arg[iarg],"a2") == 0) {
-      if (iarg+4 > narg) error->all("Illegal lattice command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal lattice command");
       if (style != CUSTOM) 
-	error->all("Invalid option in lattice command for non-custom style");
+	error->all(FLERR,"Invalid option in lattice command for non-custom style");
       a2[0] = atof(arg[iarg+1]);
       a2[1] = atof(arg[iarg+2]);
       a2[2] = atof(arg[iarg+3]);
       iarg += 4;
     } else if (strcmp(arg[iarg],"a3") == 0) {
-      if (iarg+4 > narg) error->all("Illegal lattice command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal lattice command");
       if (style != CUSTOM) 
-	error->all("Invalid option in lattice command for non-custom style");
+	error->all(FLERR,"Invalid option in lattice command for non-custom style");
       a3[0] = atof(arg[iarg+1]);
       a3[1] = atof(arg[iarg+2]);
       a3[2] = atof(arg[iarg+3]);
       iarg += 4;
 
     } else if (strcmp(arg[iarg],"basis") == 0) {
-      if (iarg+4 > narg) error->all("Illegal lattice command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal lattice command");
       if (style != CUSTOM) 
-	error->all("Invalid option in lattice command for non-custom style");
+	error->all(FLERR,"Invalid option in lattice command for non-custom style");
       double x = atof(arg[iarg+1]);
       double y = atof(arg[iarg+2]);
       double z = atof(arg[iarg+3]);
       if (x < 0.0 || x >= 1.0 || y < 0.0 || y >= 1.0 || z < 0.0 || z >= 1.0)
-	error->all("Illegal lattice command");
+	error->all(FLERR,"Illegal lattice command");
       add_basis(x,y,z);
       iarg += 4;
-    } else error->all("Illegal lattice command");
+    } else error->all(FLERR,"Illegal lattice command");
   }
 
   // check settings for errors
 
-  if (nbasis == 0) error->all("No basis atoms in lattice");
+  if (nbasis == 0) error->all(FLERR,"No basis atoms in lattice");
   if (!orthogonal())
-    error->all("Lattice orient vectors are not orthogonal");
+    error->all(FLERR,"Lattice orient vectors are not orthogonal");
   if (!right_handed())
-    error->all("Lattice orient vectors are not right-handed");
+    error->all(FLERR,"Lattice orient vectors are not right-handed");
   if (collinear())
-    error->all("Lattice primitive vectors are collinear");
+    error->all(FLERR,"Lattice primitive vectors are collinear");
 
   if (dimension == 2) {
     if (origin[2] != 0.0)
-      error->all("Lattice settings are not compatible with 2d simulation");
+      error->all(FLERR,"Lattice settings are not compatible with 2d simulation");
     if (orientx[2] != 0 || orienty[2] != 0 || 
 	orientz[0] != 0 || orientz[1] != 0)
-      error->all("Lattice settings are not compatible with 2d simulation");
+      error->all(FLERR,"Lattice settings are not compatible with 2d simulation");
     if (a1[2] != 0.0 || a2[2] != 0.0 || a3[0] != 0.0 || a3[1] != 0.0)
-      error->all("Lattice settings are not compatible with 2d simulation");
+      error->all(FLERR,"Lattice settings are not compatible with 2d simulation");
   }
 
   if (spaceflag) {
     if (xlattice <= 0.0 || ylattice <= 0.0 || zlattice <= 0.0)
-      error->all("Lattice spacings are invalid");
+      error->all(FLERR,"Lattice spacings are invalid");
   }
 
   // reset scale for LJ units (input scale is rho*)
@@ -376,7 +374,7 @@ void Lattice::setup_transform()
     primitive[0][1]*primitive[1][0]*primitive[2][2] -
     primitive[0][2]*primitive[1][1]*primitive[2][0];
 
-  if (determinant == 0.0) error->all("Degenerate lattice primitive vectors");
+  if (determinant == 0.0) error->all(FLERR,"Degenerate lattice primitive vectors");
 
   priminv[0][0] = (primitive[1][1]*primitive[2][2] - 
 		   primitive[1][2]*primitive[2][1]) / determinant;
@@ -404,7 +402,7 @@ void Lattice::setup_transform()
   int lensq = orientx[0]*orientx[0] + orientx[1]*orientx[1] +
     orientx[2]*orientx[2];
   length = sqrt((double) lensq);
-  if (length == 0.0) error->all("Zero-length lattice orient vector");
+  if (length == 0.0) error->all(FLERR,"Zero-length lattice orient vector");
 
   rotaterow[0][0] = orientx[0] / length;
   rotaterow[0][1] = orientx[1] / length;
@@ -413,7 +411,7 @@ void Lattice::setup_transform()
   lensq = orienty[0]*orienty[0] + orienty[1]*orienty[1] +
     orienty[2]*orienty[2];
   length = sqrt((double) lensq);
-  if (length == 0.0) error->all("Zero-length lattice orient vector");
+  if (length == 0.0) error->all(FLERR,"Zero-length lattice orient vector");
   
   rotaterow[1][0] = orienty[0] / length;
   rotaterow[1][1] = orienty[1] / length;
@@ -422,7 +420,7 @@ void Lattice::setup_transform()
   lensq = orientz[0]*orientz[0] + orientz[1]*orientz[1] +
     orientz[2]*orientz[2];
   length = sqrt((double) lensq);
-  if (length == 0.0) error->all("Zero-length lattice orient vector");
+  if (length == 0.0) error->all(FLERR,"Zero-length lattice orient vector");
 
   rotaterow[2][0] = orientz[0] / length;
   rotaterow[2][1] = orientz[1] / length;
diff --git a/src/memory.cpp b/src/memory.cpp
index 6af16e68e0ab9c4a578f233052cce155180bc1d7..11e15f10e5e93f849411d8aac1b548a10af3ca5c 100644
--- a/src/memory.cpp
+++ b/src/memory.cpp
@@ -37,7 +37,7 @@ void *Memory::smalloc(bigint nbytes, const char *name)
     char str[128];
     sprintf(str,"Failed to allocate " BIGINT_FORMAT " bytes for array %s",
 	    nbytes,name);
-    error->one(str);
+    error->one(FLERR,str);
   }
   return ptr;
 }
@@ -58,7 +58,7 @@ void *Memory::srealloc(void *ptr, bigint nbytes, const char *name)
     char str[128];
     sprintf(str,"Failed to reallocate " BIGINT_FORMAT " bytes for array %s",
 	    nbytes,name);
-    error->one(str);
+    error->one(FLERR,str);
   }
   return ptr;
 }
@@ -81,5 +81,5 @@ void Memory::fail(const char *name)
 {
   char str[128];
   sprintf(str,"Cannot create/grow a vector/array of pointers for %s",name);
-  error->one(str);
+  error->one(FLERR,str);
 }
diff --git a/src/min.cpp b/src/min.cpp
index 55253f11e8579100abb26ff5034d7f1afbe87e68..bf83065261f530d18abffc98ad34a86911e7345f 100644
--- a/src/min.cpp
+++ b/src/min.cpp
@@ -47,9 +47,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 Min::Min(LAMMPS *lmp) : Pointers(lmp)
@@ -160,7 +157,7 @@ void Min::init()
   
   if (neigh_every != 1 || neigh_delay != 0 || neigh_dist_check != 1) {
     if (comm->me == 0) 
-      error->warning("Resetting reneighboring criteria during minimization");
+      error->warning(FLERR,"Resetting reneighboring criteria during minimization");
   }
 
   neighbor->every = 1;
@@ -191,7 +188,7 @@ void Min::setup()
   // compute for potential energy
 
   int id = modify->find_compute("thermo_pe");
-  if (id < 0) error->all("Minimization could not find thermo_pe compute");
+  if (id < 0) error->all(FLERR,"Minimization could not find thermo_pe compute");
   pe_compute = modify->compute[id];
 
   // style-specific setup does two tasks
@@ -230,9 +227,9 @@ void Min::setup()
   // remove these restriction eventually
 
   if (nextra_global && searchflag == 0)
-    error->all("Cannot use a damped dynamics min style with fix box/relax");
+    error->all(FLERR,"Cannot use a damped dynamics min style with fix box/relax");
   if (nextra_atom && searchflag == 0)
-    error->all("Cannot use a damped dynamics min style with per-atom DOF");
+    error->all(FLERR,"Cannot use a damped dynamics min style with per-atom DOF");
 
   // atoms may have migrated in comm->exchange()
 
@@ -584,21 +581,21 @@ int Min::request(Pair *pair, int peratom, double maxvalue)
 
 void Min::modify_params(int narg, char **arg)
 {
-  if (narg == 0) error->all("Illegal min_modify command");
+  if (narg == 0) error->all(FLERR,"Illegal min_modify command");
 
   int iarg = 0;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"dmax") == 0) {
-      if (iarg+2 > narg) error->all("Illegal min_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
       dmax = atof(arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"line") == 0) {
-      if (iarg+2 > narg) error->all("Illegal min_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
       if (strcmp(arg[iarg+1],"backtrack") == 0) linestyle = 0;
       else if (strcmp(arg[iarg+1],"quadratic") == 0) linestyle = 1;
-      else error->all("Illegal min_modify command");
+      else error->all(FLERR,"Illegal min_modify command");
       iarg += 2;
-    } else error->all("Illegal min_modify command");
+    } else error->all(FLERR,"Illegal min_modify command");
   }
 }
 
diff --git a/src/min_cg.cpp b/src/min_cg.cpp
index 9ef3c8c4a702dd47bd77ac5f77f090d99d4d7186..f2b1a666f54a25795e257a40cef634fcb2fc001e 100644
--- a/src/min_cg.cpp
+++ b/src/min_cg.cpp
@@ -31,9 +31,6 @@ using namespace LAMMPS_NS;
 
 enum{MAXITER,MAXEVAL,ETOL,FTOL,DOWNHILL,ZEROALPHA,ZEROFORCE,ZEROQUAD};
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 MinCG::MinCG(LAMMPS *lmp) : MinLineSearch(lmp) {}
diff --git a/src/min_fire.cpp b/src/min_fire.cpp
index 0c4e73dc262be344348f1f67c18ad2f8249fb83c..18081f17b5cbe3aa0064641eaaf61a42205dc919 100644
--- a/src/min_fire.cpp
+++ b/src/min_fire.cpp
@@ -31,9 +31,6 @@ using namespace LAMMPS_NS;
 
 enum{MAXITER,MAXEVAL,ETOL,FTOL,DOWNHILL,ZEROALPHA,ZEROFORCE,ZEROQUAD};
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 #define DELAYSTEP 5
 #define DT_GROW 1.1
 #define DT_SHRINK 0.5
diff --git a/src/min_hftn.cpp b/src/min_hftn.cpp
index 99c8cef3b65034d6edb24147d7ff5e7ca08fefbe..da92ade46db97e4311492d201f93e200f33d7837 100644
--- a/src/min_hftn.cpp
+++ b/src/min_hftn.cpp
@@ -28,9 +28,6 @@
 #include "update.h"
 #include "timer.h"
 
-#define MIN(A,B) (((A) < (B)) ? (A) : (B))
-#define MAX(A,B) (((A) > (B)) ? (A) : (B))
-
 using namespace LAMMPS_NS;
 
 /* ----------------------------------------------------------------------
diff --git a/src/min_linesearch.cpp b/src/min_linesearch.cpp
index f3ae5782a42a454cc47d126ae1267f77f1f87a9d..1736b066e22814c12f2b254cba47d3a3a09fb374 100644
--- a/src/min_linesearch.cpp
+++ b/src/min_linesearch.cpp
@@ -53,9 +53,6 @@ using namespace LAMMPS_NS;
 
 enum{MAXITER,MAXEVAL,ETOL,FTOL,DOWNHILL,ZEROALPHA,ZEROFORCE,ZEROQUAD};
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 MinLineSearch::MinLineSearch(LAMMPS *lmp) : Min(lmp)
diff --git a/src/min_quickmin.cpp b/src/min_quickmin.cpp
index 5ed10f863463360d27decf3d8cb6447145df1e56..fe9df160b5a29fb8d1ee619e6bee02c7f93e7a77 100644
--- a/src/min_quickmin.cpp
+++ b/src/min_quickmin.cpp
@@ -33,9 +33,6 @@ using namespace LAMMPS_NS;
 
 enum{MAXITER,MAXEVAL,ETOL,FTOL,DOWNHILL,ZEROALPHA,ZEROFORCE,ZEROQUAD};
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 #define DELAYSTEP 5
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/minimize.cpp b/src/minimize.cpp
index dcee996dc00d802ba7aa6258e7c42752bb87d742..f93fbf5385058cc3345beaae5d3e5426376e9278 100644
--- a/src/minimize.cpp
+++ b/src/minimize.cpp
@@ -31,10 +31,10 @@ Minimize::Minimize(LAMMPS *lmp) : Pointers(lmp) {}
 
 void Minimize::command(int narg, char **arg)
 {
-  if (narg != 4) error->all("Illegal minimize command");
+  if (narg != 4) error->all(FLERR,"Illegal minimize command");
 
   if (domain->box_exist == 0)
-    error->all("Minimize command before simulation box is defined");
+    error->all(FLERR,"Minimize command before simulation box is defined");
 
   update->etol = atof(arg[0]);
   update->ftol = atof(arg[1]);
@@ -42,13 +42,13 @@ void Minimize::command(int narg, char **arg)
   update->max_eval = atoi(arg[3]);
 
   if (update->etol < 0.0 || update->ftol < 0.0)
-    error->all("Illegal minimize command");
+    error->all(FLERR,"Illegal minimize command");
 
   update->whichflag = 2;
   update->beginstep = update->firststep = update->ntimestep;
   update->endstep = update->laststep = update->firststep + update->nsteps;
   if (update->laststep < 0 || update->laststep > MAXBIGINT)
-    error->all("Too many iterations");
+    error->all(FLERR,"Too many iterations");
 
   lmp->init();
   update->minimize->setup();
diff --git a/src/modify.cpp b/src/modify.cpp
index afad1579aa06a8fadb9eafae6661a13ec2cd3e36..c07416ac44332b0a4f213267b4364790b00439ba 100644
--- a/src/modify.cpp
+++ b/src/modify.cpp
@@ -53,9 +53,6 @@ using namespace LAMMPS_NS;
 #define MIN_ENERGY             131072
 #define POST_RUN               262144
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 #define BIG 1.0e20
 
 /* ---------------------------------------------------------------------- */
@@ -240,7 +237,7 @@ void Modify::init()
   int checkall;
   MPI_Allreduce(&check,&checkall,1,MPI_INT,MPI_SUM,world);
   if (comm->me == 0 && checkall)
-    error->warning("One or more atoms are time integrated more than once");
+    error->warning(FLERR,"One or more atoms are time integrated more than once");
 }
 
 /* ----------------------------------------------------------------------
@@ -595,13 +592,13 @@ int Modify::min_reset_ref()
 void Modify::add_fix(int narg, char **arg, char *suffix)
 {
   if (domain->box_exist == 0 && allow_early_fix == 0) 
-    error->all("Fix command before simulation box is defined");
-  if (narg < 3) error->all("Illegal fix command");
+    error->all(FLERR,"Fix command before simulation box is defined");
+  if (narg < 3) error->all(FLERR,"Illegal fix command");
 
   // check group ID
 
   int igroup = group->find(arg[1]);
-  if (igroup == -1) error->all("Could not find fix group ID");
+  if (igroup == -1) error->all(FLERR,"Could not find fix group ID");
 
   // if fix ID exists:
   //   set newflag = 0 so create new fix in same location in fix list
@@ -623,9 +620,9 @@ void Modify::add_fix(int narg, char **arg, char *suffix)
   if (ifix < nfix) {
     newflag = 0;
     if (strcmp(arg[2],fix[ifix]->style) != 0)
-      error->all("Replacing a fix, but new style != old style");
+      error->all(FLERR,"Replacing a fix, but new style != old style");
     if (fix[ifix]->igroup != igroup && comm->me == 0)
-      error->warning("Replacing a fix, but new group != old group");
+      error->warning(FLERR,"Replacing a fix, but new group != old group");
     delete fix[ifix];
     fix[ifix] = NULL;
   } else {
@@ -668,7 +665,7 @@ void Modify::add_fix(int narg, char **arg, char *suffix)
 #undef FixStyle
 #undef FIX_CLASS
 
-    else error->all("Invalid fix style");
+    else error->all(FLERR,"Invalid fix style");
   }
 
   // set fix mask values and increment nfix (if new)
@@ -714,14 +711,14 @@ void Modify::add_fix(int narg, char **arg, char *suffix)
 
 void Modify::modify_fix(int narg, char **arg)
 {
-  if (narg < 2) error->all("Illegal fix_modify command");
+  if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
 
   // lookup Fix ID
 
   int ifix;
   for (ifix = 0; ifix < nfix; ifix++)
     if (strcmp(arg[0],fix[ifix]->id) == 0) break;
-  if (ifix == nfix) error->all("Could not find fix_modify ID");
+  if (ifix == nfix) error->all(FLERR,"Could not find fix_modify ID");
   
   fix[ifix]->modify_params(narg-1,&arg[1]);
 }
@@ -734,7 +731,7 @@ void Modify::modify_fix(int narg, char **arg)
 void Modify::delete_fix(const char *id)
 {
   int ifix = find_fix(id);
-  if (ifix < 0) error->all("Could not find fix ID to delete");
+  if (ifix < 0) error->all(FLERR,"Could not find fix ID to delete");
   delete fix[ifix];
   atom->update_callback(ifix);
 
@@ -765,13 +762,13 @@ int Modify::find_fix(const char *id)
 
 void Modify::add_compute(int narg, char **arg, char *suffix)
 {
-  if (narg < 3) error->all("Illegal compute command");
+  if (narg < 3) error->all(FLERR,"Illegal compute command");
 
   // error check
 
   for (int icompute = 0; icompute < ncompute; icompute++)
     if (strcmp(arg[0],compute[icompute]->id) == 0)
-      error->all("Reuse of compute ID");
+      error->all(FLERR,"Reuse of compute ID");
 
   // extend Compute list if necessary
 
@@ -814,7 +811,7 @@ void Modify::add_compute(int narg, char **arg, char *suffix)
 #undef ComputeStyle
 #undef COMPUTE_CLASS
 
-    else error->all("Invalid compute style");
+    else error->all(FLERR,"Invalid compute style");
   }
 
   ncompute++;
@@ -826,14 +823,14 @@ void Modify::add_compute(int narg, char **arg, char *suffix)
 
 void Modify::modify_compute(int narg, char **arg)
 {
-  if (narg < 2) error->all("Illegal compute_modify command");
+  if (narg < 2) error->all(FLERR,"Illegal compute_modify command");
 
   // lookup Compute ID
 
   int icompute;
   for (icompute = 0; icompute < ncompute; icompute++)
     if (strcmp(arg[0],compute[icompute]->id) == 0) break;
-  if (icompute == ncompute) error->all("Could not find compute_modify ID");
+  if (icompute == ncompute) error->all(FLERR,"Could not find compute_modify ID");
   
   compute[icompute]->modify_params(narg-1,&arg[1]);
 }
@@ -845,7 +842,7 @@ void Modify::modify_compute(int narg, char **arg)
 void Modify::delete_compute(char *id)
 {
   int icompute = find_compute(id);
-  if (icompute < 0) error->all("Could not find compute ID to delete");
+  if (icompute < 0) error->all(FLERR,"Could not find compute ID to delete");
   delete compute[icompute];
 
   // move other Computes down in list one slot
diff --git a/src/neigh_bond.cpp b/src/neigh_bond.cpp
index b16598011e133ec96c6169c640b03cbc2f16fbcd..f9ff7f07e0037f7a1dae0766ff68793b50ab35cb 100644
--- a/src/neigh_bond.cpp
+++ b/src/neigh_bond.cpp
@@ -46,7 +46,7 @@ void Neighbor::bond_all()
 	sprintf(str,
 		"Bond atoms %d %d missing on proc %d at step " BIGINT_FORMAT,
 		tag[i],bond_atom[i][m],me,update->ntimestep);
-	error->one(str);
+	error->one(FLERR,str);
       }
       if (newton_bond || i < atom1) {
 	if (nbondlist == maxbond) {
@@ -85,7 +85,7 @@ void Neighbor::bond_partial()
 	sprintf(str,
 		"Bond atoms %d %d missing on proc %d at step " BIGINT_FORMAT,
 		tag[i],bond_atom[i][m],me,update->ntimestep);
-	error->one(str);
+	error->one(FLERR,str);
       }
       if (newton_bond || i < atom1) {
 	if (nbondlist == maxbond) {
@@ -128,7 +128,7 @@ void Neighbor::angle_all()
 		BIGINT_FORMAT,
 		angle_atom1[i][m],angle_atom2[i][m],angle_atom3[i][m],
 		me,update->ntimestep);
-	error->one(str);
+	error->one(FLERR,str);
       }
       if (newton_bond || (i <= atom1 && i <= atom2 && i <= atom3)) {
 	if (nanglelist == maxangle) {
@@ -173,7 +173,7 @@ void Neighbor::angle_partial()
 		BIGINT_FORMAT,
 		angle_atom1[i][m],angle_atom2[i][m],angle_atom3[i][m],
 		me,update->ntimestep);
-	error->one(str);
+	error->one(FLERR,str);
       }
       if (newton_bond || (i <= atom1 && i <= atom2 && i <= atom3)) {
 	if (nanglelist == maxangle) {
@@ -220,7 +220,7 @@ void Neighbor::dihedral_all()
 		dihedral_atom1[i][m],dihedral_atom2[i][m],
 		dihedral_atom3[i][m],dihedral_atom4[i][m],
 		me,update->ntimestep);
-	error->one(str);
+	error->one(FLERR,str);
       }
       if (newton_bond || 
 	  (i <= atom1 && i <= atom2 && i <= atom3 && i <= atom4)) {
@@ -270,7 +270,7 @@ void Neighbor::dihedral_partial()
 		dihedral_atom1[i][m],dihedral_atom2[i][m],
 		dihedral_atom3[i][m],dihedral_atom4[i][m],
 		me,update->ntimestep);
-	error->one(str);
+	error->one(FLERR,str);
       }
       if (newton_bond || 
 	  (i <= atom1 && i <= atom2 && i <= atom3 && i <= atom4)) {
@@ -319,7 +319,7 @@ void Neighbor::improper_all()
 		improper_atom1[i][m],improper_atom2[i][m],
 		improper_atom3[i][m],improper_atom4[i][m],
 		me,update->ntimestep);
-	error->one(str);
+	error->one(FLERR,str);
       }
       if (newton_bond || 
 	  (i <= atom1 && i <= atom2 && i <= atom3 && i <= atom4)) {
@@ -369,7 +369,7 @@ void Neighbor::improper_partial()
 		improper_atom1[i][m],improper_atom2[i][m],
 		improper_atom3[i][m],improper_atom4[i][m],
 		me,update->ntimestep);
-	error->one(str);
+	error->one(FLERR,str);
       }
       if (newton_bond || 
 	  (i <= atom1 && i <= atom2 && i <= atom3 && i <= atom4)) {
diff --git a/src/neigh_derive.cpp b/src/neigh_derive.cpp
index c3d3eb02454e23f262bf501ed55224af32e20c78..21e7c0c6c19ed8ddab3c503d8b4a14c2eee5490d 100644
--- a/src/neigh_derive.cpp
+++ b/src/neigh_derive.cpp
@@ -73,7 +73,7 @@ void Neighbor::half_from_full_no_newton(NeighList *list)
     numneigh[i] = n;
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
   }
 
   list->inum = inum;
@@ -151,7 +151,7 @@ void Neighbor::half_from_full_newton(NeighList *list)
     numneigh[i] = n;
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
   }
 
   list->inum = inum;
@@ -224,7 +224,7 @@ void Neighbor::skip_from(NeighList *list)
     numneigh[i] = n;
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
   }
 
   list->inum = inum;
@@ -326,7 +326,7 @@ void Neighbor::skip_from_granular(NeighList *list)
     firstshear[i] = shearptr;
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
   }
 
   list->inum = inum;
@@ -465,20 +465,20 @@ void Neighbor::skip_from_respa(NeighList *list)
     numneigh[i] = n;
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
 
     firstneigh_inner[i] = neighptr_inner;
     numneigh_inner[i] = n_inner;
     npnt_inner += n_inner;
     if (npnt_inner >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
 
     if (respamiddle) {
       firstneigh_middle[i] = neighptr_middle;
       numneigh_middle[i] = n_middle;
       npnt_middle += n_middle;
       if (npnt_middle >= pgsize)
-	error->one("Neighbor list overflow, boost neigh_modify one or page");
+	error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
     }
   }
 
diff --git a/src/neigh_full.cpp b/src/neigh_full.cpp
index c667ab6160de11faeb9ae144e5a9bd5b351cd570..b4b7fd0aeb91a5aee67c94722b1c1b79e304acf5 100644
--- a/src/neigh_full.cpp
+++ b/src/neigh_full.cpp
@@ -99,7 +99,7 @@ void Neighbor::full_nsq(NeighList *list)
     numneigh[i] = n;
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
   }
 
   list->inum = inum;
@@ -201,7 +201,7 @@ void Neighbor::full_nsq_ghost(NeighList *list)
     numneigh[i] = n;
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
   }
 
   list->inum = atom->nlocal;
@@ -295,7 +295,7 @@ void Neighbor::full_bin(NeighList *list)
     numneigh[i] = n;
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
   }
 
   list->inum = inum;
@@ -423,7 +423,7 @@ void Neighbor::full_bin_ghost(NeighList *list)
     numneigh[i] = n;
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
   }
 
   list->inum = atom->nlocal;
@@ -525,7 +525,7 @@ void Neighbor::full_multi(NeighList *list)
     numneigh[i] = n;
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
   }
 
   list->inum = inum;
diff --git a/src/neigh_gran.cpp b/src/neigh_gran.cpp
index ce75b16afcb2211358aa9a301ca1a691832e43aa..7e7c282f5c1bc5248e4e0aa7237b9907b65ba923 100644
--- a/src/neigh_gran.cpp
+++ b/src/neigh_gran.cpp
@@ -157,7 +157,7 @@ void Neighbor::granular_nsq_no_newton(NeighList *list)
     }
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
   }
 
   list->inum = inum;
@@ -255,7 +255,7 @@ void Neighbor::granular_nsq_newton(NeighList *list)
     numneigh[i] = n;
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
   }
 
   list->inum = inum;
@@ -409,7 +409,7 @@ void Neighbor::granular_bin_no_newton(NeighList *list)
     }
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
   }
 
   list->inum = inum;
@@ -519,7 +519,7 @@ void Neighbor::granular_bin_newton(NeighList *list)
     numneigh[i] = n;
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
   }
 
   list->inum = inum;
@@ -617,7 +617,7 @@ void Neighbor::granular_bin_newton_tri(NeighList *list)
     numneigh[i] = n;
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
   }
 
   list->inum = inum;
diff --git a/src/neigh_half_bin.cpp b/src/neigh_half_bin.cpp
index e776b82030dfdb5cb74190e0310cf787efe12c67..e1487897f770089b0c05aeb54c46462ab197143f 100644
--- a/src/neigh_half_bin.cpp
+++ b/src/neigh_half_bin.cpp
@@ -109,7 +109,7 @@ void Neighbor::half_bin_no_newton(NeighList *list)
     numneigh[i] = n;
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
   }
 
   list->inum = inum;
@@ -228,7 +228,7 @@ void Neighbor::half_bin_newton(NeighList *list)
     numneigh[i] = n;
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
   }
 
   list->inum = inum;
@@ -331,7 +331,7 @@ void Neighbor::half_bin_newton_tri(NeighList *list)
     numneigh[i] = n;
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
   }
 
   list->inum = inum;
diff --git a/src/neigh_half_multi.cpp b/src/neigh_half_multi.cpp
index d0a8efcd2b2cfdcba26777bec479c013182ab797..04e25931be899aa9aa9ce48096de0cf9b26d648f 100644
--- a/src/neigh_half_multi.cpp
+++ b/src/neigh_half_multi.cpp
@@ -117,7 +117,7 @@ void Neighbor::half_multi_no_newton(NeighList *list)
     numneigh[i] = n;
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
   }
 
   list->inum = inum;
@@ -246,7 +246,7 @@ void Neighbor::half_multi_newton(NeighList *list)
     numneigh[i] = n;
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
   }
 
   list->inum = inum;
@@ -359,7 +359,7 @@ void Neighbor::half_multi_newton_tri(NeighList *list)
     numneigh[i] = n;
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
   }
 
   list->inum = inum;
diff --git a/src/neigh_half_nsq.cpp b/src/neigh_half_nsq.cpp
index 1df4865984ca3c041ffd94ce6c5c8b3d80b2bf1e..32792a678f2ae5489b9e9c2e0904604781942ff2 100644
--- a/src/neigh_half_nsq.cpp
+++ b/src/neigh_half_nsq.cpp
@@ -99,7 +99,7 @@ void Neighbor::half_nsq_no_newton(NeighList *list)
     numneigh[i] = n;
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
   }
 
   list->inum = inum;
@@ -203,7 +203,7 @@ void Neighbor::half_nsq_newton(NeighList *list)
     numneigh[i] = n;
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
   }
 
   list->inum = inum;
diff --git a/src/neigh_respa.cpp b/src/neigh_respa.cpp
index a5190316ff5f1809fcdbd3553f22b673b01dfe2d..8e1e7b79e0abf4902aa8cc22037de88ca674f5ee 100644
--- a/src/neigh_respa.cpp
+++ b/src/neigh_respa.cpp
@@ -151,14 +151,14 @@ void Neighbor::respa_nsq_no_newton(NeighList *list)
     numneigh[i] = n;
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
 
     ilist_inner[inum] = i;
     firstneigh_inner[i] = neighptr_inner;
     numneigh_inner[i] = n_inner;
     npnt_inner += n_inner;
     if (npnt_inner >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
 
     if (respamiddle) {
       ilist_middle[inum] = i;
@@ -166,7 +166,7 @@ void Neighbor::respa_nsq_no_newton(NeighList *list)
       numneigh_middle[i] = n_middle;
       npnt_middle += n_middle;
       if (npnt_middle >= pgsize)
-	error->one("Neighbor list overflow, boost neigh_modify one or page");
+	error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
     }
 
     inum++;
@@ -328,14 +328,14 @@ void Neighbor::respa_nsq_newton(NeighList *list)
     numneigh[i] = n;
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
 
     ilist_inner[inum] = i;
     firstneigh_inner[i] = neighptr_inner;
     numneigh_inner[i] = n_inner;
     npnt_inner += n_inner;
     if (npnt_inner >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
 
     if (respamiddle) {
       ilist_middle[inum] = i;
@@ -343,7 +343,7 @@ void Neighbor::respa_nsq_newton(NeighList *list)
       numneigh_middle[i] = n_middle;
       npnt_middle += n_middle;
       if (npnt_middle >= pgsize)
-	error->one("Neighbor list overflow, boost neigh_modify one or page");
+	error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
     }
 
     inum++;
@@ -498,14 +498,14 @@ void Neighbor::respa_bin_no_newton(NeighList *list)
     numneigh[i] = n;
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
 
     ilist_inner[inum] = i;
     firstneigh_inner[i] = neighptr_inner;
     numneigh_inner[i] = n_inner;
     npnt_inner += n_inner;
     if (npnt_inner >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
 
     if (respamiddle) {
       ilist_middle[inum] = i;
@@ -513,7 +513,7 @@ void Neighbor::respa_bin_no_newton(NeighList *list)
       numneigh_middle[i] = n_middle;
       npnt_middle += n_middle;
       if (npnt_middle >= pgsize)
-	error->one("Neighbor list overflow, boost neigh_modify one or page");
+	error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
     }
 
     inum++;
@@ -703,14 +703,14 @@ void Neighbor::respa_bin_newton(NeighList *list)
     numneigh[i] = n;
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
 
     ilist_inner[inum] = i;
     firstneigh_inner[i] = neighptr_inner;
     numneigh_inner[i] = n_inner;
     npnt_inner += n_inner;
     if (npnt_inner >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
 
     if (respamiddle) {
       ilist_middle[inum] = i;
@@ -718,7 +718,7 @@ void Neighbor::respa_bin_newton(NeighList *list)
       numneigh_middle[i] = n_middle;
       npnt_middle += n_middle;
       if (npnt_middle >= pgsize)
-	error->one("Neighbor list overflow, boost neigh_modify one or page");
+	error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
     }
 
     inum++;
@@ -880,14 +880,14 @@ void Neighbor::respa_bin_newton_tri(NeighList *list)
     numneigh[i] = n;
     npnt += n;
     if (n > oneatom || npnt >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
 
     ilist_inner[inum] = i;
     firstneigh_inner[i] = neighptr_inner;
     numneigh_inner[i] = n_inner;
     npnt_inner += n_inner;
     if (npnt_inner >= pgsize)
-      error->one("Neighbor list overflow, boost neigh_modify one or page");
+      error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
 
     if (respamiddle) {
       ilist_middle[inum] = i;
@@ -895,7 +895,7 @@ void Neighbor::respa_bin_newton_tri(NeighList *list)
       numneigh_middle[i] = n_middle;
       npnt_middle += n_middle;
       if (npnt_middle >= pgsize)
-	error->one("Neighbor list overflow, boost neigh_modify one or page");
+	error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
     }
 
     inum++;
diff --git a/src/neighbor.cpp b/src/neighbor.cpp
index 141841d80d895bc145ed7a6a37ed413675e8e503..58f8ad94dd99df7475119dec529c566f20ee031d 100644
--- a/src/neighbor.cpp
+++ b/src/neighbor.cpp
@@ -49,9 +49,6 @@ using namespace LAMMPS_NS;
 #define BIG 1.0e20
 #define CUT2BIN_RATIO 100
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 enum{NSQ,BIN,MULTI};     // also in neigh_list.cpp
 
 //#define NEIGH_LIST_DEBUG 1
@@ -196,10 +193,10 @@ void Neighbor::init()
   // error check
 
   if (delay > 0 && (delay % every) != 0)
-    error->all("Neighbor delay must be 0 or multiple of every setting");
+    error->all(FLERR,"Neighbor delay must be 0 or multiple of every setting");
 
   if (pgsize < 10*oneatom)
-    error->all("Neighbor page size must be >= 10x the one atom setting");
+    error->all(FLERR,"Neighbor page size must be >= 10x the one atom setting");
 
   // ------------------------------------------------------------------
   // settings
@@ -382,7 +379,7 @@ void Neighbor::init()
     for (i = 0; i < nex_type; i++) {
       if (ex1_type[i] <= 0 || ex1_type[i] > n || 
 	  ex2_type[i] <= 0 || ex2_type[i] > n)
-	error->all("Invalid atom type in neighbor exclusion list");
+	error->all(FLERR,"Invalid atom type in neighbor exclusion list");
       ex_type[ex1_type[i]][ex2_type[i]] = 1;
       ex_type[ex2_type[i]][ex1_type[i]] = 1;
     }
@@ -857,16 +854,16 @@ void Neighbor::choose_build(int index, NeighRequest *rq)
     if (style == NSQ) {
       if (rq->ghost == 0) pb = &Neighbor::full_nsq;
       else if (includegroup) 
-	error->all("Neighbor include group not allowed with ghost neighbors");
+	error->all(FLERR,"Neighbor include group not allowed with ghost neighbors");
       else if (rq->ghost == 1) pb = &Neighbor::full_nsq_ghost;
     } else if (style == BIN) {
       if (rq->ghost == 0) pb = &Neighbor::full_bin;
       else if (includegroup) 
-	error->all("Neighbor include group not allowed with ghost neighbors");
+	error->all(FLERR,"Neighbor include group not allowed with ghost neighbors");
       else if (rq->ghost == 1) pb = &Neighbor::full_bin_ghost;
     } else if (style == MULTI) {
       if (rq->ghost == 0) pb = &Neighbor::full_multi;
-      else error->all("Neighbor multi not yet enabled for ghost neighbors");
+      else error->all(FLERR,"Neighbor multi not yet enabled for ghost neighbors");
     }
 
   } else if (rq->gran) {
@@ -878,7 +875,7 @@ void Neighbor::choose_build(int index, NeighRequest *rq)
       else if (triclinic == 0) pb = &Neighbor::granular_bin_newton;
       else if (triclinic == 1) pb = &Neighbor::granular_bin_newton_tri;
     } else if (style == MULTI)
-      error->all("Neighbor multi not yet enabled for granular");
+      error->all(FLERR,"Neighbor multi not yet enabled for granular");
 
   } else if (rq->respaouter) {
     if (style == NSQ) {
@@ -889,13 +886,13 @@ void Neighbor::choose_build(int index, NeighRequest *rq)
       else if (triclinic == 0) pb = &Neighbor::respa_bin_newton;
       else if (triclinic == 1) pb = &Neighbor::respa_bin_newton_tri;
     } else if (style == MULTI)
-      error->all("Neighbor multi not yet enabled for rRESPA");
+      error->all(FLERR,"Neighbor multi not yet enabled for rRESPA");
   }
 
   // general error check
 
   if (rq->ghost && !rq->full)
-    error->all("Neighbors of ghost atoms only allowed for full neighbor lists");
+    error->all(FLERR,"Neighbors of ghost atoms only allowed for full neighbor lists");
 
   pair_build[index] = pb;
 }
@@ -1181,7 +1178,7 @@ void Neighbor::build()
   // check that neighbor list with special bond flags will not overflow
 
   if (atom->nlocal+atom->nghost > NEIGHMASK)
-    error->one("Too many local+ghost atoms for neighbor list");
+    error->one(FLERR,"Too many local+ghost atoms for neighbor list");
 
   // invoke building of pair and molecular neighbor lists
   // only for pairwise lists with buildflag set
@@ -1224,7 +1221,7 @@ void Neighbor::build_one(int i)
   // check that neighbor list with special bond flags will not overflow
 
   if (atom->nlocal+atom->nghost > NEIGHMASK)
-    error->one("Too many local+ghost atoms for neighbor list");
+    error->one(FLERR,"Too many local+ghost atoms for neighbor list");
 
   // when occasional list built, LAMMPS can crash if atoms have moved too far
   // why is this?, give warning if this is the case
@@ -1235,7 +1232,7 @@ void Neighbor::build_one(int i)
   int flag = 0;
   if (dist_check && update->whichflag) flag = check_distance();
   if (flag && me == 0)
-    error->warning("Building an occasional neighobr list when "
+    error->warning(FLERR,"Building an occasional neighobr list when "
 		   "atoms may have moved too far");
 
   (this->*pair_build[i])(lists[i]);
@@ -1313,7 +1310,7 @@ void Neighbor::setup_bins()
 
   if (bbox[0]*binsizeinv > MAXSMALLINT || bbox[1]*binsizeinv > MAXSMALLINT ||
       bbox[2]*binsizeinv > MAXSMALLINT)
-    error->all("Domain too large for neighbor bins");
+    error->all(FLERR,"Domain too large for neighbor bins");
 
   // create actual bins
   // always have one bin even if cutoff > bbox
@@ -1345,7 +1342,7 @@ void Neighbor::setup_bins()
   if (binsize_optimal*bininvx > CUT2BIN_RATIO || 
       binsize_optimal*bininvy > CUT2BIN_RATIO || 
       binsize_optimal*bininvz > CUT2BIN_RATIO)
-    error->all("Cannot use neighbor bins - box size << cutoff");
+    error->all(FLERR,"Cannot use neighbor bins - box size << cutoff");
   
   // mbinlo/hi = lowest and highest global bins my ghost atoms could be in
   // coord = lowest and highest values of coords for my ghost atoms
@@ -1395,7 +1392,7 @@ void Neighbor::setup_bins()
   // memory for bin ptrs
 
   bigint bbin = mbinx*mbiny*mbinz;
-  if (bbin > MAXSMALLINT) error->one("Too many neighbor bins");
+  if (bbin > MAXSMALLINT) error->one(FLERR,"Too many neighbor bins");
   mbins = bbin;
   if (mbins > maxhead) {
     maxhead = mbins;
@@ -1455,15 +1452,15 @@ double Neighbor::bin_distance(int i, int j, int k)
 
 void Neighbor::set(int narg, char **arg)
 {
-  if (narg != 2) error->all("Illegal neighbor command");
+  if (narg != 2) error->all(FLERR,"Illegal neighbor command");
 
   skin = atof(arg[0]);
-  if (skin < 0.0) error->all("Illegal neighbor command");
+  if (skin < 0.0) error->all(FLERR,"Illegal neighbor command");
 
   if (strcmp(arg[1],"nsq") == 0) style = NSQ;
   else if (strcmp(arg[1],"bin") == 0) style = BIN;
   else if (strcmp(arg[1],"multi") == 0) style = MULTI;
-  else error->all("Illegal neighbor command");
+  else error->all(FLERR,"Illegal neighbor command");
 }
 
 /* ----------------------------------------------------------------------
@@ -1475,55 +1472,55 @@ void Neighbor::modify_params(int narg, char **arg)
   int iarg = 0;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"every") == 0) {
-      if (iarg+2 > narg) error->all("Illegal neigh_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command");
       every = atoi(arg[iarg+1]);
-      if (every <= 0) error->all("Illegal neigh_modify command");
+      if (every <= 0) error->all(FLERR,"Illegal neigh_modify command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"delay") == 0) {
-      if (iarg+2 > narg) error->all("Illegal neigh_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command");
       delay = atoi(arg[iarg+1]);
-      if (delay < 0) error->all("Illegal neigh_modify command");
+      if (delay < 0) error->all(FLERR,"Illegal neigh_modify command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"check") == 0) {
-      if (iarg+2 > narg) error->all("Illegal neigh_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command");
       if (strcmp(arg[iarg+1],"yes") == 0) dist_check = 1;
       else if (strcmp(arg[iarg+1],"no") == 0) dist_check = 0;
-      else error->all("Illegal neigh_modify command");
+      else error->all(FLERR,"Illegal neigh_modify command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"once") == 0) {
-      if (iarg+2 > narg) error->all("Illegal neigh_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command");
       if (strcmp(arg[iarg+1],"yes") == 0) build_once = 1;
       else if (strcmp(arg[iarg+1],"no") == 0) build_once = 0;
-      else error->all("Illegal neigh_modify command");
+      else error->all(FLERR,"Illegal neigh_modify command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"page") == 0) {
-      if (iarg+2 > narg) error->all("Illegal neigh_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command");
       pgsize = atoi(arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"one") == 0) {
-      if (iarg+2 > narg) error->all("Illegal neigh_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command");
       oneatom = atoi(arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"binsize") == 0) {
-      if (iarg+2 > narg) error->all("Illegal neigh_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command");
       binsize_user = atof(arg[iarg+1]);
       if (binsize_user <= 0.0) binsizeflag = 0;
       else binsizeflag = 1;
       iarg += 2;
     } else if (strcmp(arg[iarg],"include") == 0) {
-      if (iarg+2 > narg) error->all("Illegal neigh_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command");
       includegroup = group->find(arg[iarg+1]);
       if (includegroup < 0)
-	error->all("Invalid group ID in neigh_modify command");
+	error->all(FLERR,"Invalid group ID in neigh_modify command");
       if (includegroup && (atom->firstgroupname == NULL ||
 			    strcmp(arg[iarg+1],atom->firstgroupname) != 0))
-	error->all("Neigh_modify include group != atom_modify first group");
+	error->all(FLERR,"Neigh_modify include group != atom_modify first group");
       iarg += 2;
     } else if (strcmp(arg[iarg],"exclude") == 0) {
-      if (iarg+2 > narg) error->all("Illegal neigh_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command");
 
       if (strcmp(arg[iarg+1],"type") == 0) {
-	if (iarg+4 > narg) error->all("Illegal neigh_modify command");
+	if (iarg+4 > narg) error->all(FLERR,"Illegal neigh_modify command");
 	if (nex_type == maxex_type) {
 	  maxex_type += EXDELTA;
 	  memory->grow(ex1_type,maxex_type,"neigh:ex1_type");
@@ -1535,7 +1532,7 @@ void Neighbor::modify_params(int narg, char **arg)
 	iarg += 4;
 
       } else if (strcmp(arg[iarg+1],"group") == 0) {
-	if (iarg+4 > narg) error->all("Illegal neigh_modify command");
+	if (iarg+4 > narg) error->all(FLERR,"Illegal neigh_modify command");
 	if (nex_group == maxex_group) {
 	  maxex_group += EXDELTA;
 	  memory->grow(ex1_group,maxex_group,"neigh:ex1_group");
@@ -1544,16 +1541,16 @@ void Neighbor::modify_params(int narg, char **arg)
 	ex1_group[nex_group] = group->find(arg[iarg+2]);
 	ex2_group[nex_group] = group->find(arg[iarg+3]);
 	if (ex1_group[nex_group] == -1 || ex2_group[nex_group] == -1)
-	  error->all("Invalid group ID in neigh_modify command");
+	  error->all(FLERR,"Invalid group ID in neigh_modify command");
 	nex_group++;
 	iarg += 4;
 
       } else if (strcmp(arg[iarg+1],"molecule") == 0) {
-	if (iarg+3 > narg) error->all("Illegal neigh_modify command");
+	if (iarg+3 > narg) error->all(FLERR,"Illegal neigh_modify command");
 	if (atom->molecule_flag == 0) {
 	  char *str = (char *)
 	    "Neigh_modify exclude molecule requires atom attribute molecule";
-	  error->all(str);
+	  error->all(FLERR,str);
 	}
 	if (nex_mol == maxex_mol) {
 	  maxex_mol += EXDELTA;
@@ -1561,16 +1558,16 @@ void Neighbor::modify_params(int narg, char **arg)
 	}
 	ex_mol_group[nex_mol] = group->find(arg[iarg+2]);
 	if (ex_mol_group[nex_mol] == -1)
-	  error->all("Invalid group ID in neigh_modify command");
+	  error->all(FLERR,"Invalid group ID in neigh_modify command");
 	nex_mol++;
 	iarg += 3;
 
       } else if (strcmp(arg[iarg+1],"none") == 0) {
 	nex_type = nex_group = nex_mol = 0;
 	iarg += 2;
-      } else error->all("Illegal neigh_modify command");
+      } else error->all(FLERR,"Illegal neigh_modify command");
 
-    } else error->all("Illegal neigh_modify command");
+    } else error->all(FLERR,"Illegal neigh_modify command");
   }
 }
 
diff --git a/src/output.cpp b/src/output.cpp
index de7ed5baa64a946a7e7ade469217d0e27f809a65..50a7cc008b432a8ad2a8045ac76a54b799ad8311 100644
--- a/src/output.cpp
+++ b/src/output.cpp
@@ -125,9 +125,9 @@ void Output::init()
   else if (var_thermo) {
     ivar_thermo = input->variable->find(var_thermo);
     if (ivar_thermo < 0)
-      error->all("Variable name for thermo every does not exist");
+      error->all(FLERR,"Variable name for thermo every does not exist");
     if (!input->variable->equalstyle(ivar_thermo))
-      error->all("Variable for thermo every is invalid style");
+      error->all(FLERR,"Variable for thermo every is invalid style");
   }
 
   for (int i = 0; i < ndump; i++) dump[i]->init();
@@ -135,9 +135,9 @@ void Output::init()
     if (every_dump[i] == 0) {
       ivar_dump[i] = input->variable->find(var_dump[i]);
       if (ivar_dump[i] < 0)
-	error->all("Variable name for dump every does not exist");
+	error->all(FLERR,"Variable name for dump every does not exist");
       if (!input->variable->equalstyle(ivar_dump[i]))
-	error->all("Variable for dump every is invalid style");
+	error->all(FLERR,"Variable for dump every is invalid style");
     }
 }
 
@@ -180,7 +180,7 @@ void Output::setup(int flag)
 	int nextdump = static_cast<int> 
 	  (input->variable->compute_equal(ivar_dump[idump]));
 	if (nextdump <= ntimestep)
-	  error->all("Dump every variable returned a bad timestep");
+	  error->all(FLERR,"Dump every variable returned a bad timestep");
 	next_dump[idump] = nextdump;
       }
       if (dump[idump]->clearstep) {
@@ -223,7 +223,7 @@ void Output::setup(int flag)
     next_thermo = static_cast<int> 
       (input->variable->compute_equal(ivar_thermo));
     if (next_thermo <= ntimestep)
-      error->all("Thermo every variable returned a bad timestep");
+      error->all(FLERR,"Thermo every variable returned a bad timestep");
   } else next_thermo = update->laststep;
 
   modify->addstep_compute(next_thermo);
@@ -260,7 +260,7 @@ void Output::write(bigint ntimestep)
 	  int nextdump = static_cast<int> 
 	    (input->variable->compute_equal(ivar_dump[idump]));
 	  if (nextdump <= ntimestep)
-	    error->all("Dump every variable returned a bad timestep");
+	    error->all(FLERR,"Dump every variable returned a bad timestep");
 	  next_dump[idump] = nextdump;
 	}
         if (dump[idump]->clearstep) modify->addstep_compute(next_dump[idump]);
@@ -309,7 +309,7 @@ void Output::write(bigint ntimestep)
       next_thermo = static_cast<int> 
 	(input->variable->compute_equal(ivar_thermo));
       if (next_thermo <= ntimestep)
-	error->all("Thermo every variable returned a bad timestep");
+	error->all(FLERR,"Thermo every variable returned a bad timestep");
     } else next_thermo = update->laststep;
     next_thermo = MYMIN(next_thermo,update->laststep);
     modify->addstep_compute(next_thermo);
@@ -364,15 +364,15 @@ void Output::write_restart(bigint ntimestep)
 
 void Output::add_dump(int narg, char **arg)
 {
-  if (narg < 5) error->all("Illegal dump command");
+  if (narg < 5) error->all(FLERR,"Illegal dump command");
 
   // error checks
 
   for (int idump = 0; idump < ndump; idump++)
-    if (strcmp(arg[0],dump[idump]->id) == 0) error->all("Reuse of dump ID");
+    if (strcmp(arg[0],dump[idump]->id) == 0) error->all(FLERR,"Reuse of dump ID");
   int igroup = group->find(arg[1]);
-  if (igroup == -1) error->all("Could not find dump group ID");
-  if (atoi(arg[3]) <= 0) error->all("Invalid dump frequency");
+  if (igroup == -1) error->all(FLERR,"Could not find dump group ID");
+  if (atoi(arg[3]) <= 0) error->all(FLERR,"Invalid dump frequency");
 
   // extend Dump list if necessary
 
@@ -398,10 +398,10 @@ void Output::add_dump(int narg, char **arg)
 #include "style_dump.h"
 #undef DUMP_CLASS
 
-  else error->all("Invalid dump style");
+  else error->all(FLERR,"Invalid dump style");
 
   every_dump[ndump] = atoi(arg[3]);
-  if (every_dump[ndump] <= 0) error->all("Illegal dump command");
+  if (every_dump[ndump] <= 0) error->all(FLERR,"Illegal dump command");
   last_dump[ndump] = -1;
   var_dump[ndump] = NULL;
   ndump++;
@@ -413,14 +413,14 @@ void Output::add_dump(int narg, char **arg)
 
 void Output::modify_dump(int narg, char **arg)
 {
-  if (narg < 1) error->all("Illegal dump_modify command");
+  if (narg < 1) error->all(FLERR,"Illegal dump_modify command");
 
   // find which dump it is
 
   int idump;
   for (idump = 0; idump < ndump; idump++)
     if (strcmp(arg[0],dump[idump]->id) == 0) break;
-  if (idump == ndump) error->all("Cound not find dump_modify ID");
+  if (idump == ndump) error->all(FLERR,"Cound not find dump_modify ID");
 
   dump[idump]->modify_params(narg-1,&arg[1]);
 }
@@ -436,7 +436,7 @@ void Output::delete_dump(char *id)
   int idump;
   for (idump = 0; idump < ndump; idump++)
     if (strcmp(id,dump[idump]->id) == 0) break;
-  if (idump == ndump) error->all("Could not find undump ID");
+  if (idump == ndump) error->all(FLERR,"Could not find undump ID");
 
   delete dump[idump];
   delete [] var_dump[idump];
@@ -460,17 +460,17 @@ void Output::delete_dump(char *id)
 
 void Output::create_thermo(int narg, char **arg)
 {
-  if (narg < 1) error->all("Illegal thermo_style command");
+  if (narg < 1) error->all(FLERR,"Illegal thermo_style command");
 
   // don't allow this so that dipole style can safely allocate inertia vector
 
   if (domain->box_exist == 0) 
-    error->all("Thermo_style command before simulation box is defined");
+    error->all(FLERR,"Thermo_style command before simulation box is defined");
 
   // warn if previous thermo had been modified via thermo_modify command
 
   if (thermo->modified && comm->me == 0)
-    error->warning("New thermo_style command, "
+    error->warning(FLERR,"New thermo_style command, "
 		   "previous thermo_modify settings will be lost");
 
   // set thermo = NULL in case new Thermo throws an error
@@ -487,7 +487,7 @@ void Output::create_thermo(int narg, char **arg)
 
 void Output::create_restart(int narg, char **arg)
 {
-  if (narg < 1) error->all("Illegal restart command");
+  if (narg < 1) error->all(FLERR,"Illegal restart command");
 
   if (restart) delete restart;
   delete [] restart1;
@@ -498,7 +498,7 @@ void Output::create_restart(int narg, char **arg)
 
   restart_every = atoi(arg[0]);
   if (restart_every == 0) {
-    if (narg != 1) error->all("Illegal restart command");
+    if (narg != 1) error->all(FLERR,"Illegal restart command");
     return;
   }
 
@@ -517,7 +517,7 @@ void Output::create_restart(int narg, char **arg)
     n = strlen(arg[2]) + 1;
     restart2 = new char[n];
     strcpy(restart2,arg[2]);
-  } else error->all("Illegal restart command");
+  } else error->all(FLERR,"Illegal restart command");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/pair.cpp b/src/pair.cpp
index 0357188ff9064054f5072a4abab0b44eeae05c51..9374ac003bdf64a485013b468976f4c00c5157fa 100644
--- a/src/pair.cpp
+++ b/src/pair.cpp
@@ -36,9 +36,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 enum{GEOMETRIC,ARITHMETIC,SIXTHPOWER};
 enum{R,RSQ,BMP};
 
@@ -92,40 +89,40 @@ Pair::~Pair()
 
 void Pair::modify_params(int narg, char **arg)
 {
-  if (narg == 0) error->all("Illegal pair_modify command");
+  if (narg == 0) error->all(FLERR,"Illegal pair_modify command");
 
   int iarg = 0;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"mix") == 0) {
-      if (iarg+2 > narg) error->all("Illegal pair_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal pair_modify command");
       if (strcmp(arg[iarg+1],"geometric") == 0) mix_flag = GEOMETRIC;
       else if (strcmp(arg[iarg+1],"arithmetic") == 0) mix_flag = ARITHMETIC;
       else if (strcmp(arg[iarg+1],"sixthpower") == 0) mix_flag = SIXTHPOWER;
-      else error->all("Illegal pair_modify command");
+      else error->all(FLERR,"Illegal pair_modify command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"shift") == 0) {
-      if (iarg+2 > narg) error->all("Illegal pair_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal pair_modify command");
       if (strcmp(arg[iarg+1],"yes") == 0) offset_flag = 1;
       else if (strcmp(arg[iarg+1],"no") == 0) offset_flag = 0;
-      else error->all("Illegal pair_modify command");
+      else error->all(FLERR,"Illegal pair_modify command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"table") == 0) {
-      if (iarg+2 > narg) error->all("Illegal pair_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal pair_modify command");
       ncoultablebits = atoi(arg[iarg+1]);
       if (ncoultablebits > sizeof(float)*CHAR_BIT) 
-        error->all("Too many total bits for bitmapped lookup table");
+        error->all(FLERR,"Too many total bits for bitmapped lookup table");
       iarg += 2;
     } else if (strcmp(arg[iarg],"tabinner") == 0) {
-      if (iarg+2 > narg) error->all("Illegal pair_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal pair_modify command");
       tabinner = atof(arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"tail") == 0) {
-      if (iarg+2 > narg) error->all("Illegal pair_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal pair_modify command");
       if (strcmp(arg[iarg+1],"yes") == 0) tail_flag = 1;
       else if (strcmp(arg[iarg+1],"no") == 0) tail_flag = 0;
-      else error->all("Illegal pair_modify command");
+      else error->all(FLERR,"Illegal pair_modify command");
       iarg += 2;
-    } else error->all("Illegal pair_modify command");
+    } else error->all(FLERR,"Illegal pair_modify command");
   }
 }
 
@@ -136,19 +133,19 @@ void Pair::init()
   int i,j;
 
   if (offset_flag && tail_flag)
-    error->all("Cannot have both pair_modify shift and tail set to yes");
+    error->all(FLERR,"Cannot have both pair_modify shift and tail set to yes");
   if (tail_flag && domain->dimension == 2)
-    error->all("Cannot use pair tail corrections with 2d simulations");
+    error->all(FLERR,"Cannot use pair tail corrections with 2d simulations");
   if (tail_flag && domain->nonperiodic && comm->me == 0)
-    error->warning("Using pair tail corrections with nonperiodic system");
+    error->warning(FLERR,"Using pair tail corrections with nonperiodic system");
 
-  if (!allocated) error->all("All pair coeffs are not set");
+  if (!allocated) error->all(FLERR,"All pair coeffs are not set");
 
   // I,I coeffs must be set
   // init_one() will check if I,J is set explicitly or inferred by mixing
 
   for (i = 1; i <= atom->ntypes; i++)
-    if (setflag[i][i] == 0) error->all("All pair coeffs are not set");
+    if (setflag[i][i] == 0) error->all(FLERR,"All pair coeffs are not set");
 
   // style-specific initialization
 
@@ -959,15 +956,15 @@ void Pair::virial_fdotr_compute()
 
 void Pair::write_file(int narg, char **arg)
 {
-  if (narg < 8) error->all("Illegal pair_write command");
-  if (single_enable == 0) error->all("Pair style does not support pair_write");
+  if (narg < 8) error->all(FLERR,"Illegal pair_write command");
+  if (single_enable == 0) error->all(FLERR,"Pair style does not support pair_write");
 
   // parse arguments
 
   int itype = atoi(arg[0]);
   int jtype = atoi(arg[1]);
   if (itype < 1 || itype > atom->ntypes || jtype < 1 || jtype > atom->ntypes)
-    error->all("Invalid atom types in pair_write command");
+    error->all(FLERR,"Invalid atom types in pair_write command");
 
   int n = atoi(arg[2]);
 
@@ -975,12 +972,12 @@ void Pair::write_file(int narg, char **arg)
   if (strcmp(arg[3],"r") == 0) style = R;
   else if (strcmp(arg[3],"rsq") == 0) style = RSQ;
   else if (strcmp(arg[3],"bitmap") == 0) style = BMP;
-  else error->all("Invalid style in pair_write command");
+  else error->all(FLERR,"Invalid style in pair_write command");
 
   double inner = atof(arg[4]);
   double outer = atof(arg[5]);
   if (inner <= 0.0 || inner >= outer)
-    error->all("Invalid cutoffs in pair_write command");
+    error->all(FLERR,"Invalid cutoffs in pair_write command");
 
   // open file in append mode
   // print header in format used by pair_style table
@@ -990,7 +987,7 @@ void Pair::write_file(int narg, char **arg)
   FILE *fp;
   if (me == 0) {
     fp = fopen(arg[6],"a");
-    if (fp == NULL) error->one("Cannot open pair_write file");
+    if (fp == NULL) error->one(FLERR,"Cannot open pair_write file");
     fprintf(fp,"# Pair potential %s for atom types %d %d: i,r,energy,force\n",
 	    force->pair_style,itype,jtype);
     if (style == R) 
@@ -1084,12 +1081,12 @@ void Pair::init_bitmap(double inner, double outer, int ntablebits,
              int &masklo, int &maskhi, int &nmask, int &nshiftbits)
 {
   if (sizeof(int) != sizeof(float))
-    error->all("Bitmapped lookup tables require int/float be same size");
+    error->all(FLERR,"Bitmapped lookup tables require int/float be same size");
   
   if (ntablebits > sizeof(float)*CHAR_BIT) 
-    error->all("Too many total bits for bitmapped lookup table");
+    error->all(FLERR,"Too many total bits for bitmapped lookup table");
           
-  if (inner >= outer) error->warning("Table inner cutoff >= outer cutoff");
+  if (inner >= outer) error->warning(FLERR,"Table inner cutoff >= outer cutoff");
     
   int nlowermin = 1;
   while (!((pow(double(2),nlowermin) <= inner*inner) && 
@@ -1110,10 +1107,10 @@ void Pair::init_bitmap(double inner, double outer, int ntablebits,
   int nmantbits = ntablebits - nexpbits;
 
   if (nexpbits > sizeof(float)*CHAR_BIT - FLT_MANT_DIG) 
-    error->all("Too many exponent bits for lookup table");
+    error->all(FLERR,"Too many exponent bits for lookup table");
   if (nmantbits+1 > FLT_MANT_DIG)
-    error->all("Too many mantissa bits for lookup table");
-  if (nmantbits < 3) error->all("Too few bits for lookup table");
+    error->all(FLERR,"Too many mantissa bits for lookup table");
+  if (nmantbits < 3) error->all(FLERR,"Too few bits for lookup table");
 
   nshiftbits = FLT_MANT_DIG - (nmantbits+1);
 
diff --git a/src/pair_born.cpp b/src/pair_born.cpp
index 926a3194e7548ec0e1365a4995b4cf1f90281efa..406b95a0ccf0fd3deece3d8b1454b21781dab8a6 100644
--- a/src/pair_born.cpp
+++ b/src/pair_born.cpp
@@ -29,9 +29,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairBorn::PairBorn(LAMMPS *lmp) : Pair(lmp) {}
@@ -174,7 +171,7 @@ void PairBorn::allocate()
 
 void PairBorn::settings(int narg, char **arg)
 {
-  if (narg != 1) error->all("Illegal pair_style command");
+  if (narg != 1) error->all(FLERR,"Illegal pair_style command");
 
   cut_global = atof(arg[0]);
 
@@ -194,7 +191,7 @@ void PairBorn::settings(int narg, char **arg)
 
 void PairBorn::coeff(int narg, char **arg)
 {
-  if (narg < 7 || narg > 8) error->all("Incorrect args for pair coefficients");
+  if (narg < 7 || narg > 8) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -204,7 +201,7 @@ void PairBorn::coeff(int narg, char **arg)
   double a_one = force->numeric(arg[2]);
   double rho_one = force->numeric(arg[3]);
   double sigma_one = force->numeric(arg[4]);
-  if (rho_one <= 0) error->all("Incorrect args for pair coefficients");
+  if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients");
   double c_one = force->numeric(arg[5]);
   double d_one = force->numeric(arg[6]);
 
@@ -225,7 +222,7 @@ void PairBorn::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -234,7 +231,7 @@ void PairBorn::coeff(int narg, char **arg)
 
 double PairBorn::init_one(int i, int j)
 {
-  if (setflag[i][j] == 0) error->all("All pair coeffs are not set");
+  if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
 
   rhoinv[i][j] = 1.0/rho[i][j];
   born1[i][j] = a[i][j]/rho[i][j];
diff --git a/src/pair_buck.cpp b/src/pair_buck.cpp
index 02add611429c22669ef40e554c38cbeef5a14382..0490f80eea083e14f341d36a908093c42b14b29e 100644
--- a/src/pair_buck.cpp
+++ b/src/pair_buck.cpp
@@ -25,9 +25,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairBuck::PairBuck(LAMMPS *lmp) : Pair(lmp) {}
@@ -163,7 +160,7 @@ void PairBuck::allocate()
 
 void PairBuck::settings(int narg, char **arg)
 {
-  if (narg != 1) error->all("Illegal pair_style command");
+  if (narg != 1) error->all(FLERR,"Illegal pair_style command");
 
   cut_global = force->numeric(arg[0]);
 
@@ -183,7 +180,7 @@ void PairBuck::settings(int narg, char **arg)
 
 void PairBuck::coeff(int narg, char **arg)
 {
-  if (narg < 5 || narg > 6) error->all("Incorrect args for pair coefficients");
+  if (narg < 5 || narg > 6) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -192,7 +189,7 @@ void PairBuck::coeff(int narg, char **arg)
 
   double a_one = force->numeric(arg[2]);
   double rho_one = force->numeric(arg[3]);
-  if (rho_one <= 0) error->all("Incorrect args for pair coefficients");
+  if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients");
   double c_one = force->numeric(arg[4]);
 
   double cut_one = cut_global;
@@ -210,7 +207,7 @@ void PairBuck::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -219,7 +216,7 @@ void PairBuck::coeff(int narg, char **arg)
 
 double PairBuck::init_one(int i, int j)
 {
-  if (setflag[i][j] == 0) error->all("All pair coeffs are not set");
+  if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
 
   rhoinv[i][j] = 1.0/rho[i][j];
   buck1[i][j] = a[i][j]/rho[i][j];
diff --git a/src/pair_buck_coul_cut.cpp b/src/pair_buck_coul_cut.cpp
index fc405c2da5996ba621db03084652b2159ee7d19a..66a187ae1ae22b821fd602c91db8b832f9224949 100644
--- a/src/pair_buck_coul_cut.cpp
+++ b/src/pair_buck_coul_cut.cpp
@@ -29,9 +29,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairBuckCoulCut::PairBuckCoulCut(LAMMPS *lmp) : Pair(lmp) {}
@@ -192,7 +189,7 @@ void PairBuckCoulCut::allocate()
 
 void PairBuckCoulCut::settings(int narg, char **arg)
 {
-  if (narg < 1 || narg > 2) error->all("Illegal pair_style command");
+  if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command");
 
   cut_lj_global = force->numeric(arg[0]);
   if (narg == 1) cut_coul_global = cut_lj_global;
@@ -217,7 +214,7 @@ void PairBuckCoulCut::settings(int narg, char **arg)
 
 void PairBuckCoulCut::coeff(int narg, char **arg)
 {
-  if (narg < 5 || narg > 7) error->all("Incorrect args for pair coefficients");
+  if (narg < 5 || narg > 7) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -226,7 +223,7 @@ void PairBuckCoulCut::coeff(int narg, char **arg)
 
   double a_one = force->numeric(arg[2]);
   double rho_one = force->numeric(arg[3]);
-  if (rho_one <= 0) error->all("Incorrect args for pair coefficients");
+  if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients");
   double c_one = force->numeric(arg[4]);
 
   double cut_lj_one = cut_lj_global;
@@ -247,7 +244,7 @@ void PairBuckCoulCut::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -257,7 +254,7 @@ void PairBuckCoulCut::coeff(int narg, char **arg)
 void PairBuckCoulCut::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style buck/coul/cut requires atom attribute q");
+    error->all(FLERR,"Pair style buck/coul/cut requires atom attribute q");
 
   neighbor->request(this);
 }
@@ -268,7 +265,7 @@ void PairBuckCoulCut::init_style()
 
 double PairBuckCoulCut::init_one(int i, int j)
 {
-  if (setflag[i][j] == 0) error->all("All pair coeffs are not set");
+  if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
 
   double cut = MAX(cut_lj[i][j],cut_coul[i][j]);
   cut_ljsq[i][j] = cut_lj[i][j] * cut_lj[i][j];
diff --git a/src/pair_coul_cut.cpp b/src/pair_coul_cut.cpp
index 16a5224324028340a3bfd24c08842cbb854af02d..fbe2bfdfc240ef8d37598b1ef002fdaa848befa3 100644
--- a/src/pair_coul_cut.cpp
+++ b/src/pair_coul_cut.cpp
@@ -26,9 +26,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairCoulCut::PairCoulCut(LAMMPS *lmp) : Pair(lmp) {}
@@ -149,7 +146,7 @@ void PairCoulCut::allocate()
 
 void PairCoulCut::settings(int narg, char **arg)
 {
-  if (narg != 1) error->all("Illegal pair_style command");
+  if (narg != 1) error->all(FLERR,"Illegal pair_style command");
 
   cut_global = force->numeric(arg[0]);
 
@@ -169,7 +166,7 @@ void PairCoulCut::settings(int narg, char **arg)
 
 void PairCoulCut::coeff(int narg, char **arg)
 {
-  if (narg < 2 || narg > 3) error->all("Incorrect args for pair coefficients");
+  if (narg < 2 || narg > 3) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -189,7 +186,7 @@ void PairCoulCut::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 
@@ -200,7 +197,7 @@ void PairCoulCut::coeff(int narg, char **arg)
 void PairCoulCut::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style coul/cut requires atom attribute q");
+    error->all(FLERR,"Pair style coul/cut requires atom attribute q");
 
   neighbor->request(this);
 }
diff --git a/src/pair_coul_debye.cpp b/src/pair_coul_debye.cpp
index 4527919f80452fac77725f39d667c6f3357a0d70..2606a1f3cb09594dd735b89b9ae3669235a359f8 100644
--- a/src/pair_coul_debye.cpp
+++ b/src/pair_coul_debye.cpp
@@ -26,9 +26,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairCoulDebye::PairCoulDebye(LAMMPS *lmp) : PairCoulCut(lmp) {}
@@ -117,7 +114,7 @@ void PairCoulDebye::compute(int eflag, int vflag)
 
 void PairCoulDebye::settings(int narg, char **arg)
 {
-  if (narg != 2) error->all("Illegal pair_style command");
+  if (narg != 2) error->all(FLERR,"Illegal pair_style command");
 
   kappa = force->numeric(arg[0]);
   cut_global = force->numeric(arg[1]);
diff --git a/src/pair_dpd.cpp b/src/pair_dpd.cpp
index 2ffb078bb0280cb53948c72029e8f20ccb38fc59..5c701a89e19288abf0360e687dafff3a0a9b8163 100644
--- a/src/pair_dpd.cpp
+++ b/src/pair_dpd.cpp
@@ -32,9 +32,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define EPSILON 1.0e-10
 
 /* ---------------------------------------------------------------------- */
@@ -188,7 +185,7 @@ void PairDPD::allocate()
 
 void PairDPD::settings(int narg, char **arg)
 {
-  if (narg != 3) error->all("Illegal pair_style command");
+  if (narg != 3) error->all(FLERR,"Illegal pair_style command");
 
   temperature = force->numeric(arg[0]);
   cut_global = force->numeric(arg[1]);
@@ -196,7 +193,7 @@ void PairDPD::settings(int narg, char **arg)
 
   // initialize Marsaglia RNG with processor-unique seed
 
-  if (seed <= 0) error->all("Illegal pair_style command");
+  if (seed <= 0) error->all(FLERR,"Illegal pair_style command");
   delete random;
   random = new RanMars(lmp,seed + comm->me);
 
@@ -216,7 +213,7 @@ void PairDPD::settings(int narg, char **arg)
 
 void PairDPD::coeff(int narg, char **arg)
 {
-  if (narg < 4 || narg > 5) error->all("Incorrect args for pair coefficients");
+  if (narg < 4 || narg > 5) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -240,7 +237,7 @@ void PairDPD::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -250,12 +247,12 @@ void PairDPD::coeff(int narg, char **arg)
 void PairDPD::init_style()
 {
   if (comm->ghost_velocity == 0)
-    error->all("Pair dpd requires ghost atoms store velocity");
+    error->all(FLERR,"Pair dpd requires ghost atoms store velocity");
 
   // if newton off, forces between atoms ij will be double computed
   // using different random numbers
 
-  if (force->newton_pair == 0 && comm->me == 0) error->warning(
+  if (force->newton_pair == 0 && comm->me == 0) error->warning(FLERR,
       "Pair dpd needs newton pair on for momentum conservation");
 
   neighbor->request(this);
@@ -267,7 +264,7 @@ void PairDPD::init_style()
 
 double PairDPD::init_one(int i, int j)
 {
-  if (setflag[i][j] == 0) error->all("All pair coeffs are not set");
+  if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
 
   sigma[i][j] = sqrt(2.0*force->boltz*temperature*gamma[i][j]);
      
diff --git a/src/pair_dpd_tstat.cpp b/src/pair_dpd_tstat.cpp
index cab7a99fab9f00518de28e42f7b631abfee529cb..4151ecc5b17bc524cd215fc65f324c317aee0927 100644
--- a/src/pair_dpd_tstat.cpp
+++ b/src/pair_dpd_tstat.cpp
@@ -23,9 +23,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define EPSILON 1.0e-10
 
 /* ---------------------------------------------------------------------- */
@@ -141,7 +138,7 @@ void PairDPDTstat::compute(int eflag, int vflag)
 
 void PairDPDTstat::settings(int narg, char **arg)
 {
-  if (narg != 4) error->all("Illegal pair_style command");
+  if (narg != 4) error->all(FLERR,"Illegal pair_style command");
 
   t_start = force->numeric(arg[0]);
   t_stop = force->numeric(arg[1]);
@@ -152,7 +149,7 @@ void PairDPDTstat::settings(int narg, char **arg)
 
   // initialize Marsaglia RNG with processor-unique seed
 
-  if (seed <= 0) error->all("Illegal pair_style command");
+  if (seed <= 0) error->all(FLERR,"Illegal pair_style command");
   delete random;
   random = new RanMars(lmp,seed + comm->me);
 
@@ -172,7 +169,7 @@ void PairDPDTstat::settings(int narg, char **arg)
 
 void PairDPDTstat::coeff(int narg, char **arg)
 {
-  if (narg < 3 || narg > 4) error->all("Incorrect args for pair coefficients");
+  if (narg < 3 || narg > 4) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -196,7 +193,7 @@ void PairDPDTstat::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/pair_gauss.cpp b/src/pair_gauss.cpp
index 646a29cdbc3e8bb42d311681143988e1816a6ba2..4649cdb0e23a879fb0372d117187a1e9fa442975 100644
--- a/src/pair_gauss.cpp
+++ b/src/pair_gauss.cpp
@@ -30,9 +30,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define EPSILON 1.0e-10
 
 /* ---------------------------------------------------------------------- */
@@ -169,7 +166,7 @@ void PairGauss::allocate()
 
 void PairGauss::settings(int narg, char **arg)
 { 
-  if (narg != 1) error->all("Illegal pair_style command");
+  if (narg != 1) error->all(FLERR,"Illegal pair_style command");
   
   cut_global = atof(arg[0]);
 
@@ -189,7 +186,7 @@ void PairGauss::settings(int narg, char **arg)
 
 void PairGauss::coeff(int narg, char **arg)
 {
-  if (narg < 4 || narg > 5) error->all("Incorrect args for pair coefficients");
+  if (narg < 4 || narg > 5) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo, ihi, jlo, jhi;
@@ -213,7 +210,7 @@ void PairGauss::coeff(int narg, char **arg)
     }
   }
  
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -222,7 +219,7 @@ void PairGauss::coeff(int narg, char **arg)
 
 double PairGauss::init_one(int i, int j)
 {
-  if (setflag[i][j] == 0) error->all("All pair coeffs are not set");
+  if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
   
   if (offset_flag) offset[i][j] = a[i][j]*exp(-b[i][j]*cut[i][j]*cut[i][j]);
   else offset[i][j] = 0.0;
diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp
index a57bf33721d057dc7f511ad054c35a1824edc4b5..97939fef304c0203fd2c0a8b9b1531a10b6d3717 100644
--- a/src/pair_hybrid.cpp
+++ b/src/pair_hybrid.cpp
@@ -27,9 +27,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairHybrid::PairHybrid(LAMMPS *lmp) : Pair(lmp)
@@ -177,7 +174,7 @@ void PairHybrid::settings(int narg, char **arg)
 {
   int i,m,istyle;
 
-  if (narg < 1) error->all("Illegal pair_style command");
+  if (narg < 1) error->all(FLERR,"Illegal pair_style command");
 
   // delete old lists, since cannot just change settings
 
@@ -236,11 +233,11 @@ void PairHybrid::settings(int narg, char **arg)
   while (i < narg) {
     for (m = 0; m < nstyles; m++)
       if (strcmp(arg[i],keywords[m]) == 0) 
-	error->all("Pair style hybrid cannot use same pair style twice");
+	error->all(FLERR,"Pair style hybrid cannot use same pair style twice");
     if (strcmp(arg[i],"hybrid") == 0) 
-      error->all("Pair style hybrid cannot have hybrid as an argument");
+      error->all(FLERR,"Pair style hybrid cannot have hybrid as an argument");
     if (strcmp(arg[i],"none") == 0) 
-      error->all("Pair style hybrid cannot have none as an argument");
+      error->all(FLERR,"Pair style hybrid cannot have none as an argument");
     styles[nstyles] = force->new_pair(arg[i],NULL,dummy);
     keywords[nstyles] = new char[strlen(arg[i])+1];
     strcpy(keywords[nstyles],arg[i]);
@@ -283,7 +280,7 @@ void PairHybrid::settings(int narg, char **arg)
 
 void PairHybrid::coeff(int narg, char **arg)
 {
-  if (narg < 3) error->all("Incorrect args for pair coefficients");
+  if (narg < 3) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -300,7 +297,7 @@ void PairHybrid::coeff(int narg, char **arg)
   int none = 0;
   if (m == nstyles) {
     if (strcmp(arg[2],"none") == 0) none = 1;
-    else error->all("Pair coeff for hybrid has invalid style");
+    else error->all(FLERR,"Pair coeff for hybrid has invalid style");
   }
 
   // move 1st/2nd args to 2nd/3rd args
@@ -346,7 +343,7 @@ void PairHybrid::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -367,7 +364,7 @@ void PairHybrid::init_style()
       for (jtype = itype; jtype <= ntypes; jtype++)
 	for (m = 0; m < nmap[itype][jtype]; m++)
 	  if (map[itype][jtype][m] == istyle) used = 1;
-    if (used == 0) error->all("Pair hybrid sub-style is not used");
+    if (used == 0) error->all(FLERR,"Pair hybrid sub-style is not used");
   }
 
   // each sub-style makes its neighbor list request(s)
@@ -455,7 +452,7 @@ double PairHybrid::init_one(int i, int j)
 
   if (setflag[i][j] == 0) {
     if (nmap[i][i] != 1 || nmap[j][j] != 1 || map[i][i][0] != map[j][j][0])
-      error->one("All pair coeffs are not set");
+      error->one(FLERR,"All pair coeffs are not set");
     nmap[i][j] = 1;
     map[i][j][0] = map[i][i][0];
   }
@@ -601,7 +598,7 @@ double PairHybrid::single(int i, int j, int itype, int jtype,
 			  double &fforce)
 {
   if (nmap[itype][jtype] == 0)
-    error->one("Invoked pair single on pair style none");
+    error->one(FLERR,"Invoked pair single on pair style none");
 
   double fone;
   fforce = 0.0;
@@ -610,7 +607,7 @@ double PairHybrid::single(int i, int j, int itype, int jtype,
   for (int m = 0; m < nmap[itype][jtype]; m++) {
     if (rsq < styles[map[itype][jtype][m]]->cutsq[itype][jtype]) {
       if (styles[map[itype][jtype][m]]->single_enable == 0)
-	error->all("Pair hybrid sub-style does not support single call");
+	error->all(FLERR,"Pair hybrid sub-style does not support single call");
       esum += styles[map[itype][jtype][m]]->
 	single(i,j,itype,jtype,rsq,factor_coul,factor_lj,fone);
       fforce += fone;
@@ -663,7 +660,7 @@ void *PairHybrid::extract(char *str, int &dim)
       double *p_newvalue = (double *) ptr;
       double newvalue = *p_newvalue;
       if (cutptr && newvalue != cutvalue)
-	error->all("Coulomb cutoffs of pair hybrid sub-styles do not match");
+	error->all(FLERR,"Coulomb cutoffs of pair hybrid sub-styles do not match");
       cutptr = ptr;
       cutvalue = newvalue;
     } else if (ptr) return ptr;
diff --git a/src/pair_hybrid_overlay.cpp b/src/pair_hybrid_overlay.cpp
index f6b73bffb338fc625c060c4ef1433103c6223813..4d3e14af3d7a2334ed430eb9b604ff1f11b0ac87 100644
--- a/src/pair_hybrid_overlay.cpp
+++ b/src/pair_hybrid_overlay.cpp
@@ -21,9 +21,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairHybridOverlay::PairHybridOverlay(LAMMPS *lmp) : PairHybrid(lmp) {}
@@ -34,7 +31,7 @@ PairHybridOverlay::PairHybridOverlay(LAMMPS *lmp) : PairHybrid(lmp) {}
 
 void PairHybridOverlay::coeff(int narg, char **arg)
 {
-  if (narg < 3) error->all("Incorrect args for pair coefficients");
+  if (narg < 3) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -51,7 +48,7 @@ void PairHybridOverlay::coeff(int narg, char **arg)
   int none = 0;
   if (m == nstyles) {
     if (strcmp(arg[2],"none") == 0) none = 1;
-    else error->all("Pair coeff for hybrid has invalid style");
+    else error->all(FLERR,"Pair coeff for hybrid has invalid style");
   }
 
   // move 1st/2nd args to 2nd/3rd args
@@ -88,7 +85,7 @@ void PairHybridOverlay::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/pair_lj96_cut.cpp b/src/pair_lj96_cut.cpp
index 758ef0ab580bf17134cdbf5d202d711f8c8f2e41..76f808dd034d85209476663cc980aa47e29264d0 100644
--- a/src/pair_lj96_cut.cpp
+++ b/src/pair_lj96_cut.cpp
@@ -34,9 +34,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairLJ96Cut::PairLJ96Cut(LAMMPS *lmp) : Pair(lmp)
@@ -433,7 +430,7 @@ void PairLJ96Cut::allocate()
 
 void PairLJ96Cut::settings(int narg, char **arg)
 {
-  if (narg != 1) error->all("Illegal pair_style command");
+  if (narg != 1) error->all(FLERR,"Illegal pair_style command");
 
   cut_global = force->numeric(arg[0]);
 
@@ -453,7 +450,7 @@ void PairLJ96Cut::settings(int narg, char **arg)
 
 void PairLJ96Cut::coeff(int narg, char **arg)
 {
-  if (narg < 4 || narg > 5) error->all("Incorrect args for pair coefficients");
+  if (narg < 4 || narg > 5) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -477,7 +474,7 @@ void PairLJ96Cut::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -575,7 +572,7 @@ double PairLJ96Cut::init_one(int i, int j)
   // check interior rRESPA cutoff
 
   if (cut_respa && cut[i][j] < cut_respa[3])
-    error->all("Pair cutoff < Respa interior cutoff");
+    error->all(FLERR,"Pair cutoff < Respa interior cutoff");
 
   // compute I,J contribution to long-range tail correction
   // count total # of atoms of type I and J via Allreduce
diff --git a/src/pair_lj_cubic.cpp b/src/pair_lj_cubic.cpp
index 545e0ab29b1435178ce843c28f53234bfe245c4c..df06f7deda78470b9abc935d8df95968ea1d4298 100644
--- a/src/pair_lj_cubic.cpp
+++ b/src/pair_lj_cubic.cpp
@@ -32,9 +32,6 @@
 using namespace LAMMPS_NS;
 using namespace PairLJCubicConstants;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairLJCubic::PairLJCubic(LAMMPS *lmp) : Pair(lmp) {}
@@ -180,7 +177,7 @@ void PairLJCubic::allocate()
 
 void PairLJCubic::settings(int narg, char **arg)
 {
-  if (narg != 0) error->all("Illegal pair_style command");
+  if (narg != 0) error->all(FLERR,"Illegal pair_style command");
 
   // reset cutoffs that have been explicitly set
 
@@ -199,7 +196,7 @@ void PairLJCubic::settings(int narg, char **arg)
 void PairLJCubic::coeff(int narg, char **arg)
 {
   if (narg != 4)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -222,7 +219,7 @@ void PairLJCubic::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/pair_lj_cut.cpp b/src/pair_lj_cut.cpp
index 5af7e1c89b3bdd6899827fd79aa660eea41beb19..671d6420cf2fb464687cf7b063dce0c0fb36f7ae 100644
--- a/src/pair_lj_cut.cpp
+++ b/src/pair_lj_cut.cpp
@@ -34,9 +34,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairLJCut::PairLJCut(LAMMPS *lmp) : Pair(lmp)
@@ -427,7 +424,7 @@ void PairLJCut::allocate()
 
 void PairLJCut::settings(int narg, char **arg)
 {
-  if (narg != 1) error->all("Illegal pair_style command");
+  if (narg != 1) error->all(FLERR,"Illegal pair_style command");
 
   cut_global = force->numeric(arg[0]);
 
@@ -447,7 +444,7 @@ void PairLJCut::settings(int narg, char **arg)
 
 void PairLJCut::coeff(int narg, char **arg)
 {
-  if (narg < 4 || narg > 5) error->all("Incorrect args for pair coefficients");
+  if (narg < 4 || narg > 5) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -471,7 +468,7 @@ void PairLJCut::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -569,7 +566,7 @@ double PairLJCut::init_one(int i, int j)
   // check interior rRESPA cutoff
 
   if (cut_respa && cut[i][j] < cut_respa[3])
-    error->all("Pair cutoff < Respa interior cutoff");
+    error->all(FLERR,"Pair cutoff < Respa interior cutoff");
 
   // compute I,J contribution to long-range tail correction
   // count total # of atoms of type I and J via Allreduce
diff --git a/src/pair_lj_cut_coul_cut.cpp b/src/pair_lj_cut_coul_cut.cpp
index efd0344823a3904c410e5e98ccdb2b6fe8eddde6..1d311d4b72b1fce58240a2d213f305da313b657b 100644
--- a/src/pair_lj_cut_coul_cut.cpp
+++ b/src/pair_lj_cut_coul_cut.cpp
@@ -26,9 +26,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairLJCutCoulCut::PairLJCutCoulCut(LAMMPS *lmp) : Pair(lmp) {}
@@ -185,7 +182,7 @@ void PairLJCutCoulCut::allocate()
 
 void PairLJCutCoulCut::settings(int narg, char **arg)
 {
-  if (narg < 1 || narg > 2) error->all("Illegal pair_style command");
+  if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command");
 
   cut_lj_global = force->numeric(arg[0]);
   if (narg == 1) cut_coul_global = cut_lj_global;
@@ -210,7 +207,7 @@ void PairLJCutCoulCut::settings(int narg, char **arg)
 
 void PairLJCutCoulCut::coeff(int narg, char **arg)
 {
-  if (narg < 4 || narg > 6) error->all("Incorrect args for pair coefficients");
+  if (narg < 4 || narg > 6) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -237,7 +234,7 @@ void PairLJCutCoulCut::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -247,7 +244,7 @@ void PairLJCutCoulCut::coeff(int narg, char **arg)
 void PairLJCutCoulCut::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style lj/cut/coul/cut requires atom attribute q");
+    error->all(FLERR,"Pair style lj/cut/coul/cut requires atom attribute q");
 
   neighbor->request(this);
 }
diff --git a/src/pair_lj_cut_coul_debye.cpp b/src/pair_lj_cut_coul_debye.cpp
index 1954d0d1f2b9333080e668aad0497fd3ab157c59..023d86654273b8f24e37b4ef017c50ca7084a7ab 100644
--- a/src/pair_lj_cut_coul_debye.cpp
+++ b/src/pair_lj_cut_coul_debye.cpp
@@ -131,7 +131,7 @@ void PairLJCutCoulDebye::compute(int eflag, int vflag)
 
 void PairLJCutCoulDebye::settings(int narg, char **arg)
 {
-  if (narg < 2 || narg > 3) error->all("Illegal pair_style command");
+  if (narg < 2 || narg > 3) error->all(FLERR,"Illegal pair_style command");
 
   kappa = force->numeric(arg[0]);
   cut_lj_global = force->numeric(arg[1]);
diff --git a/src/pair_lj_expand.cpp b/src/pair_lj_expand.cpp
index 1f5e659da7361ddad126111db25c3d793511e743..57110ac81c397014dbecdb9a00b5b2dfa743a54a 100644
--- a/src/pair_lj_expand.cpp
+++ b/src/pair_lj_expand.cpp
@@ -24,9 +24,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairLJExpand::PairLJExpand(LAMMPS *lmp) : Pair(lmp) {}
@@ -165,7 +162,7 @@ void PairLJExpand::allocate()
 
 void PairLJExpand::settings(int narg, char **arg)
 {
-  if (narg != 1) error->all("Illegal pair_style command");
+  if (narg != 1) error->all(FLERR,"Illegal pair_style command");
 
   cut_global = force->numeric(arg[0]);
 
@@ -185,7 +182,7 @@ void PairLJExpand::settings(int narg, char **arg)
 
 void PairLJExpand::coeff(int narg, char **arg)
 {
-  if (narg < 5 || narg > 6) error->all("Incorrect args for pair coefficients");
+  if (narg < 5 || narg > 6) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -211,7 +208,7 @@ void PairLJExpand::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/pair_lj_gromacs.cpp b/src/pair_lj_gromacs.cpp
index 462c1f2f236ac5ab334960ad5d492b262b1fe997..5b43ff2acce5f81e201fabfc5aca68fc60ecc2ff 100644
--- a/src/pair_lj_gromacs.cpp
+++ b/src/pair_lj_gromacs.cpp
@@ -30,9 +30,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairLJGromacs::PairLJGromacs(LAMMPS *lmp) : Pair(lmp) {}
@@ -189,13 +186,13 @@ void PairLJGromacs::allocate()
 
 void PairLJGromacs::settings(int narg, char **arg)
 {
-  if (narg != 2) error->all("Illegal pair_style command");
+  if (narg != 2) error->all(FLERR,"Illegal pair_style command");
 
   cut_inner_global = force->numeric(arg[0]);
   cut_global = force->numeric(arg[1]);
 
   if (cut_inner_global <= 0.0 || cut_inner_global > cut_global)
-    error->all("Illegal pair_style command");
+    error->all(FLERR,"Illegal pair_style command");
 
   // reset cutoffs that have been explicitly set
 
@@ -217,7 +214,7 @@ void PairLJGromacs::settings(int narg, char **arg)
 void PairLJGromacs::coeff(int narg, char **arg)
 {
   if (narg != 4 && narg != 6)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -235,7 +232,7 @@ void PairLJGromacs::coeff(int narg, char **arg)
   }
 
   if (cut_inner_one <= 0.0 || cut_inner_one > cut_one)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   int count = 0;
   for (int i = ilo; i <= ihi; i++) {
@@ -249,7 +246,7 @@ void PairLJGromacs::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/pair_lj_gromacs_coul_gromacs.cpp b/src/pair_lj_gromacs_coul_gromacs.cpp
index e60cf82291bca9ca249443e549315fac108ede01..af681aeab0210ba96e279b8ba9aacad558df5161 100644
--- a/src/pair_lj_gromacs_coul_gromacs.cpp
+++ b/src/pair_lj_gromacs_coul_gromacs.cpp
@@ -30,9 +30,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairLJGromacsCoulGromacs::PairLJGromacsCoulGromacs(LAMMPS *lmp) : Pair(lmp) {}
@@ -217,7 +214,7 @@ void PairLJGromacsCoulGromacs::allocate()
 void PairLJGromacsCoulGromacs::settings(int narg, char **arg)
 {
   if (narg != 2 && narg != 4) 
-    error->all("Illegal pair_style command");
+    error->all(FLERR,"Illegal pair_style command");
 
   cut_lj_inner = force->numeric(arg[0]);
   cut_lj = force->numeric(arg[1]);
@@ -230,9 +227,9 @@ void PairLJGromacsCoulGromacs::settings(int narg, char **arg)
   }
 
   if (cut_lj_inner <= 0.0 || cut_coul_inner < 0.0)
-    error->all("Illegal pair_style command");
+    error->all(FLERR,"Illegal pair_style command");
   if (cut_lj_inner > cut_lj || cut_coul_inner > cut_coul)
-    error->all("Illegal pair_style command");
+    error->all(FLERR,"Illegal pair_style command");
 }
 
 /* ----------------------------------------------------------------------
@@ -241,7 +238,7 @@ void PairLJGromacsCoulGromacs::settings(int narg, char **arg)
 
 void PairLJGromacsCoulGromacs::coeff(int narg, char **arg)
 {
-  if (narg != 4) error->all("Incorrect args for pair coefficients");
+  if (narg != 4) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -261,7 +258,7 @@ void PairLJGromacsCoulGromacs::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
@@ -271,7 +268,7 @@ void PairLJGromacsCoulGromacs::coeff(int narg, char **arg)
 void PairLJGromacsCoulGromacs::init_style()
 {
   if (!atom->q_flag)
-    error->all("Pair style lj/gromacs/coul/gromacs requires atom attribute q");
+    error->all(FLERR,"Pair style lj/gromacs/coul/gromacs requires atom attribute q");
 
   neighbor->request(this);
 
diff --git a/src/pair_lj_smooth.cpp b/src/pair_lj_smooth.cpp
index af85406dab82cca858b115759a298d548ef4acd6..de1276991cacce9efd17f2424b9c41ffda43ee29 100644
--- a/src/pair_lj_smooth.cpp
+++ b/src/pair_lj_smooth.cpp
@@ -28,9 +28,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairLJSmooth::PairLJSmooth(LAMMPS *lmp) : Pair(lmp) {}
@@ -193,13 +190,13 @@ void PairLJSmooth::allocate()
 
 void PairLJSmooth::settings(int narg, char **arg)
 {
-  if (narg != 2) error->all("Illegal pair_style command");
+  if (narg != 2) error->all(FLERR,"Illegal pair_style command");
 
   cut_inner_global = force->numeric(arg[0]);
   cut_global = force->numeric(arg[1]);
 
   if (cut_inner_global <= 0.0 || cut_inner_global > cut_global)
-    error->all("Illegal pair_style command");
+    error->all(FLERR,"Illegal pair_style command");
 
   // reset cutoffs that have been explicitly set
 
@@ -221,7 +218,7 @@ void PairLJSmooth::settings(int narg, char **arg)
 void PairLJSmooth::coeff(int narg, char **arg)
 {
   if (narg != 4 && narg != 6)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -239,7 +236,7 @@ void PairLJSmooth::coeff(int narg, char **arg)
   }
 
   if (cut_inner_one <= 0.0 || cut_inner_one > cut_one)
-    error->all("Incorrect args for pair coefficients");
+    error->all(FLERR,"Incorrect args for pair coefficients");
 
   int count = 0;
   for (int i = ilo; i <= ihi; i++) {
@@ -253,7 +250,7 @@ void PairLJSmooth::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/pair_morse.cpp b/src/pair_morse.cpp
index 0817fd3fb5fe9717fac31f075e09418ed252230e..d05235a978d3d6488e8c756e55cd14be86a64ee5 100644
--- a/src/pair_morse.cpp
+++ b/src/pair_morse.cpp
@@ -24,9 +24,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairMorse::PairMorse(LAMMPS *lmp) : Pair(lmp) {}
@@ -155,7 +152,7 @@ void PairMorse::allocate()
 
 void PairMorse::settings(int narg, char **arg)
 {
-  if (narg != 1) error->all("Illegal pair_style command");
+  if (narg != 1) error->all(FLERR,"Illegal pair_style command");
 
   cut_global = force->numeric(arg[0]);
 
@@ -175,7 +172,7 @@ void PairMorse::settings(int narg, char **arg)
 
 void PairMorse::coeff(int narg, char **arg)
 {
-  if (narg < 5 || narg > 6) error->all("Incorrect args for pair coefficients");
+  if (narg < 5 || narg > 6) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -201,7 +198,7 @@ void PairMorse::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 
@@ -211,7 +208,7 @@ void PairMorse::coeff(int narg, char **arg)
 
 double PairMorse::init_one(int i, int j)
 {
-  if (setflag[i][j] == 0) error->all("All pair coeffs are not set");
+  if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
 
   morse1[i][j] = 2.0*d0[i][j]*alpha[i][j];
      
diff --git a/src/pair_soft.cpp b/src/pair_soft.cpp
index 758a3f041a910b712473ac7dfd3e0b69e103a82e..ce25f4a782f14fa5a47b297d8e713385d266d181 100644
--- a/src/pair_soft.cpp
+++ b/src/pair_soft.cpp
@@ -26,9 +26,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairSoft::PairSoft(LAMMPS *lmp) : Pair(lmp)
@@ -150,7 +147,7 @@ void PairSoft::allocate()
 
 void PairSoft::settings(int narg, char **arg)
 {
-  if (narg != 1) error->all("Illegal pair_style command");
+  if (narg != 1) error->all(FLERR,"Illegal pair_style command");
 
   cut_global = force->numeric(arg[0]);
 
@@ -170,7 +167,7 @@ void PairSoft::settings(int narg, char **arg)
 
 void PairSoft::coeff(int narg, char **arg)
 {
-  if (narg < 3 || narg > 4) error->all("Incorrect args for pair coefficients");
+  if (narg < 3 || narg > 4) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -192,7 +189,7 @@ void PairSoft::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/pair_table.cpp b/src/pair_table.cpp
index 64e737933d22e3a08473ca1ef2784a3ee9952a16..40530b16389762f8d653502ca8826838cdb774c9 100644
--- a/src/pair_table.cpp
+++ b/src/pair_table.cpp
@@ -29,9 +29,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define LOOKUP 0
 #define LINEAR 1
 #define SPLINE 2
@@ -119,24 +116,24 @@ void PairTable::compute(int eflag, int vflag)
       if (rsq < cutsq[itype][jtype]) {
 	tb = &tables[tabindex[itype][jtype]];
 	if (rsq < tb->innersq)
-	  error->one("Pair distance < table inner cutoff");
+	  error->one(FLERR,"Pair distance < table inner cutoff");
  
 	if (tabstyle == LOOKUP) {
 	  itable = static_cast<int> ((rsq - tb->innersq) * tb->invdelta);
 	  if (itable >= tlm1)
-	    error->one("Pair distance > table outer cutoff");
+	    error->one(FLERR,"Pair distance > table outer cutoff");
 	  fpair = factor_lj * tb->f[itable];
 	} else if (tabstyle == LINEAR) {
 	  itable = static_cast<int> ((rsq - tb->innersq) * tb->invdelta);
 	  if (itable >= tlm1)
-	    error->one("Pair distance > table outer cutoff");
+	    error->one(FLERR,"Pair distance > table outer cutoff");
 	  fraction = (rsq - tb->rsq[itable]) * tb->invdelta;
 	  value = tb->f[itable] + fraction*tb->df[itable];
 	  fpair = factor_lj * value;
 	} else if (tabstyle == SPLINE) {
 	  itable = static_cast<int> ((rsq - tb->innersq) * tb->invdelta);
 	  if (itable >= tlm1)
-	    error->one("Pair distance > table outer cutoff");
+	    error->one(FLERR,"Pair distance > table outer cutoff");
 	  b = (rsq - tb->rsq[itable]) * tb->invdelta;
 	  a = 1.0 - b;
 	  value = a * tb->f[itable] + b * tb->f[itable+1] + 
@@ -206,7 +203,7 @@ void PairTable::allocate()
 
 void PairTable::settings(int narg, char **arg)
 {
-  if (narg != 2) error->all("Illegal pair_style command");
+  if (narg != 2) error->all(FLERR,"Illegal pair_style command");
 
   // new settings
 
@@ -214,10 +211,10 @@ void PairTable::settings(int narg, char **arg)
   else if (strcmp(arg[0],"linear") == 0) tabstyle = LINEAR;
   else if (strcmp(arg[0],"spline") == 0) tabstyle = SPLINE;
   else if (strcmp(arg[0],"bitmap") == 0) tabstyle = BITMAP;
-  else error->all("Unknown table style in pair_style command");
+  else error->all(FLERR,"Unknown table style in pair_style command");
 
   tablength = force->inumeric(arg[1]);
-  if (tablength < 2) error->all("Illegal number of pair table entries");
+  if (tablength < 2) error->all(FLERR,"Illegal number of pair table entries");
 
   // delete old tables, since cannot just change settings
 
@@ -241,7 +238,7 @@ void PairTable::settings(int narg, char **arg)
 
 void PairTable::coeff(int narg, char **arg)
 {
-  if (narg != 4 && narg != 5) error->all("Illegal pair_coeff command");
+  if (narg != 4 && narg != 5) error->all(FLERR,"Illegal pair_coeff command");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -267,7 +264,7 @@ void PairTable::coeff(int narg, char **arg)
   // insure cutoff is within table
   // for BITMAP tables, file values can be in non-ascending order
 
-  if (tb->ninput <= 1) error->one("Invalid pair table length");
+  if (tb->ninput <= 1) error->one(FLERR,"Invalid pair table length");
   double rlo,rhi;
   if (tb->rflag == 0) {
     rlo = tb->rfile[0];
@@ -276,8 +273,8 @@ void PairTable::coeff(int narg, char **arg)
     rlo = tb->rlo;
     rhi = tb->rhi;
   }
-  if (tb->cut <= rlo || tb->cut > rhi) error->all("Invalid pair table cutoff");
-  if (rlo <= 0.0) error->all("Invalid pair table cutoff");
+  if (tb->cut <= rlo || tb->cut > rhi) error->all(FLERR,"Invalid pair table cutoff");
+  if (rlo <= 0.0) error->all(FLERR,"Invalid pair table cutoff");
 
   // match = 1 if don't need to spline read-in tables
   // this is only the case if r values needed by final tables
@@ -290,7 +287,7 @@ void PairTable::coeff(int narg, char **arg)
   if (tabstyle == BITMAP && tb->ninput == 1 << tablength && 
       tb->rflag == BMP && tb->rhi == tb->cut) tb->match = 1;
   if (tb->rflag == BMP && tb->match == 0)
-    error->all("Bitmapped table in file does not match requested table");
+    error->all(FLERR,"Bitmapped table in file does not match requested table");
 
   // spline read-in values and compute r,e,f vectors within table
 
@@ -308,7 +305,7 @@ void PairTable::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Illegal pair_coeff command");
+  if (count == 0) error->all(FLERR,"Illegal pair_coeff command");
   ntables++;
 }
 
@@ -318,7 +315,7 @@ void PairTable::coeff(int narg, char **arg)
 
 double PairTable::init_one(int i, int j)
 {
-  if (setflag[i][j] == 0) error->all("All pair coeffs are not set");
+  if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
 
   tabindex[j][i] = tabindex[i][j];
 
@@ -342,14 +339,14 @@ void PairTable::read_table(Table *tb, char *file, char *keyword)
   if (fp == NULL) {
     char str[128];
     sprintf(str,"Cannot open file %s",file);
-    error->one(str);
+    error->one(FLERR,str);
   }
 
   // loop until section found with matching keyword
 
   while (1) {
     if (fgets(line,MAXLINE,fp) == NULL)
-      error->one("Did not find keyword in table file");
+      error->one(FLERR,"Did not find keyword in table file");
     if (strspn(line," \t\n\r") == strlen(line)) continue;  // blank line
     if (line[0] == '#') continue;                          // comment
     if (strstr(line,keyword) == line) break;               // matching keyword
@@ -375,7 +372,7 @@ void PairTable::read_table(Table *tb, char *file, char *keyword)
   if (tb->rflag == BMP) {
     while (1 << tb->ntablebits < tb->ninput) tb->ntablebits++;
     if (1 << tb->ntablebits != tb->ninput)
-      error->one("Bitmapped table is incorrect length in table file");
+      error->one(FLERR,"Bitmapped table is incorrect length in table file");
     init_bitmap(tb->rlo,tb->rhi,tb->ntablebits,masklo,maskhi,nmask,nshiftbits);
   }
 
@@ -509,12 +506,12 @@ void PairTable::param_extract(Table *tb, char *line)
       tb->fphi = atof(word);
     } else {
       printf("WORD: %s\n",word);
-      error->one("Invalid keyword in pair table parameters");
+      error->one(FLERR,"Invalid keyword in pair table parameters");
     }
     word = strtok(NULL," \t\n\r\f");
   }
 
-  if (tb->ninput == 0) error->one("Pair table parameters did not set N");
+  if (tb->ninput == 0) error->one(FLERR,"Pair table parameters did not set N");
 }
 
 /* ----------------------------------------------------------------------
@@ -901,21 +898,21 @@ double PairTable::single(int i, int j, int itype, int jtype, double rsq,
   int tlm1 = tablength - 1;
 
   Table *tb = &tables[tabindex[itype][jtype]];
-  if (rsq < tb->innersq) error->one("Pair distance < table inner cutoff");
+  if (rsq < tb->innersq) error->one(FLERR,"Pair distance < table inner cutoff");
 
   if (tabstyle == LOOKUP) {
     itable = static_cast<int> ((rsq-tb->innersq) * tb->invdelta);
-    if (itable >= tlm1) error->one("Pair distance > table outer cutoff");
+    if (itable >= tlm1) error->one(FLERR,"Pair distance > table outer cutoff");
     fforce = factor_lj * tb->f[itable];
   } else if (tabstyle == LINEAR) {
     itable = static_cast<int> ((rsq-tb->innersq) * tb->invdelta);
-    if (itable >= tlm1) error->one("Pair distance > table outer cutoff");
+    if (itable >= tlm1) error->one(FLERR,"Pair distance > table outer cutoff");
     fraction = (rsq - tb->rsq[itable]) * tb->invdelta;
     value = tb->f[itable] + fraction*tb->df[itable];
     fforce = factor_lj * value;
   } else if (tabstyle == SPLINE) {
     itable = static_cast<int> ((rsq-tb->innersq) * tb->invdelta);
-    if (itable >= tlm1) error->one("Pair distance > table outer cutoff");
+    if (itable >= tlm1) error->one(FLERR,"Pair distance > table outer cutoff");
     b = (rsq - tb->rsq[itable]) * tb->invdelta;
     a = 1.0 - b;
     value = a * tb->f[itable] + b * tb->f[itable+1] + 
@@ -952,12 +949,12 @@ double PairTable::single(int i, int j, int itype, int jtype, double rsq,
 void *PairTable::extract(char *str, int &dim)
 {
   if (strcmp(str,"cut_coul") != 0) return NULL;
-  if (ntables == 0) error->all("All pair coeffs are not set");
+  if (ntables == 0) error->all(FLERR,"All pair coeffs are not set");
 
   double cut_coul = tables[0].cut;
   for (int m = 1; m < ntables; m++)
     if (tables[m].cut != cut_coul)
-      error->all("Pair table cutoffs must all be equal to use with KSpace");
+      error->all(FLERR,"Pair table cutoffs must all be equal to use with KSpace");
   dim = 0;
   return &tables[0].cut;
 }
diff --git a/src/pair_yukawa.cpp b/src/pair_yukawa.cpp
index 85359921db31eb29b7c32a9f6c1f158a146c4e45..0e544c116e9447e79b832116ac283883e614f258 100644
--- a/src/pair_yukawa.cpp
+++ b/src/pair_yukawa.cpp
@@ -23,9 +23,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 PairYukawa::PairYukawa(LAMMPS *lmp) : Pair(lmp) {}
@@ -152,7 +149,7 @@ void PairYukawa::allocate()
 
 void PairYukawa::settings(int narg, char **arg)
 {
-  if (narg != 2) error->all("Illegal pair_style command");
+  if (narg != 2) error->all(FLERR,"Illegal pair_style command");
 
   kappa = force->numeric(arg[0]);
   cut_global = force->numeric(arg[1]);
@@ -173,7 +170,7 @@ void PairYukawa::settings(int narg, char **arg)
 
 void PairYukawa::coeff(int narg, char **arg)
 {
-  if (narg < 3 || narg > 4) error->all("Incorrect args for pair coefficients");
+  if (narg < 3 || narg > 4) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -195,7 +192,7 @@ void PairYukawa::coeff(int narg, char **arg)
     }
   }
 
-  if (count == 0) error->all("Incorrect args for pair coefficients");
+  if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/pointers.h b/src/pointers.h
index f2f2215b8bb62dc132034406ec4e66826fd74cff..d00665c97366614a326d0438ebb37c59d628cb70 100644
--- a/src/pointers.h
+++ b/src/pointers.h
@@ -27,6 +27,13 @@
 
 namespace LAMMPS_NS {
 
+// universal defines inside namespace
+
+#define FLERR __FILE__,__LINE__
+
+#define MIN(A,B) ((A) < (B)) ? (A) : (B)
+#define MAX(A,B) ((A) > (B)) ? (A) : (B)
+
 class Pointers {
  public:
   Pointers(LAMMPS *ptr) : 
diff --git a/src/random_mars.cpp b/src/random_mars.cpp
index 966f3a6717556307ce2173520d41c41f013b5daa..2430eabd562d4f2338467ee4cbf0ca9b27c6975c 100644
--- a/src/random_mars.cpp
+++ b/src/random_mars.cpp
@@ -27,7 +27,7 @@ RanMars::RanMars(LAMMPS *lmp, int seed) : Pointers(lmp)
   double s,t;
 
   if (seed <= 0 || seed > 900000000)
-    error->all("Invalid seed for Marsaglia random # generator");
+    error->all(FLERR,"Invalid seed for Marsaglia random # generator");
 
   save = 0;
   u = new double[97+1];
diff --git a/src/random_park.cpp b/src/random_park.cpp
index cbfa0d109ecbefc8dd46ffef3adfb7a6b901cc50..456020ff2532c281eb3e057224af3c67789061aa 100644
--- a/src/random_park.cpp
+++ b/src/random_park.cpp
@@ -40,7 +40,7 @@ using namespace LAMMPS_NS;
 
 RanPark::RanPark(LAMMPS *lmp, int seed_init) : Pointers(lmp)
 {
-  if (seed_init <= 0) error->all("Invalid seed for Park random # generator");
+  if (seed_init <= 0) error->all(FLERR,"Invalid seed for Park random # generator");
   seed = seed_init;
   save = 0;
 }
@@ -89,7 +89,7 @@ double RanPark::gaussian()
 
 void RanPark::reset(int seed_init)
 {
-  if (seed_init <= 0) error->all("Invalid seed for Park random # generator");
+  if (seed_init <= 0) error->all(FLERR,"Invalid seed for Park random # generator");
   seed = seed_init;
   save = 0;
 }
diff --git a/src/read_data.cpp b/src/read_data.cpp
index e7b14b84d86243ba7154ec4f63e1a40962c8584b..a5a5e47ccba00d63f1f891e6a7370b717ee786cd 100644
--- a/src/read_data.cpp
+++ b/src/read_data.cpp
@@ -44,9 +44,6 @@ using namespace LAMMPS_NS;
                            // customize for new sections
 #define NSECTIONS 21       // change when add to header::section_keywords
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 ReadData::ReadData(LAMMPS *lmp) : Pointers(lmp)
@@ -79,12 +76,12 @@ ReadData::~ReadData()
 
 void ReadData::command(int narg, char **arg)
 {
-  if (narg != 1) error->all("Illegal read_data command");
+  if (narg != 1) error->all(FLERR,"Illegal read_data command");
 
   if (domain->box_exist) 
-    error->all("Cannot read_data after simulation box is defined");
+    error->all(FLERR,"Cannot read_data after simulation box is defined");
   if (domain->dimension == 2 && domain->zperiodic == 0)
-    error->all("Cannot run 2d simulation with nonperiodic Z dimension");
+    error->all(FLERR,"Cannot run 2d simulation with nonperiodic Z dimension");
 
   // scan data file to determine max topology needed per atom 
   // allocate initial topology arrays
@@ -147,122 +144,122 @@ void ReadData::command(int narg, char **arg)
       atoms();
       atomflag = 1;
     } else if (strcmp(keyword,"Velocities") == 0) {
-      if (atomflag == 0) error->all("Must read Atoms before Velocities");
+      if (atomflag == 0) error->all(FLERR,"Must read Atoms before Velocities");
       velocities();
 
     } else if (strcmp(keyword,"Ellipsoids") == 0) {
       if (!avec_ellipsoid) 
-	error->all("Invalid data file section: Ellipsoids");
-      if (atomflag == 0) error->all("Must read Atoms before Ellipsoids");
+	error->all(FLERR,"Invalid data file section: Ellipsoids");
+      if (atomflag == 0) error->all(FLERR,"Must read Atoms before Ellipsoids");
       ellipsoids();
 
     } else if (strcmp(keyword,"Bonds") == 0) {
       if (atom->avec->bonds_allow == 0) 
-	error->all("Invalid data file section: Bonds");
-      if (atomflag == 0) error->all("Must read Atoms before Bonds");
+	error->all(FLERR,"Invalid data file section: Bonds");
+      if (atomflag == 0) error->all(FLERR,"Must read Atoms before Bonds");
       bonds();
     } else if (strcmp(keyword,"Angles") == 0) {
       if (atom->avec->angles_allow == 0)
-	error->all("Invalid data file section: Angles");
-      if (atomflag == 0) error->all("Must read Atoms before Angles");
+	error->all(FLERR,"Invalid data file section: Angles");
+      if (atomflag == 0) error->all(FLERR,"Must read Atoms before Angles");
       angles();
     } else if (strcmp(keyword,"Dihedrals") == 0) {
       if (atom->avec->dihedrals_allow == 0)
-	error->all("Invalid data file section: Dihedrals");
-      if (atomflag == 0) error->all("Must read Atoms before Dihedrals");
+	error->all(FLERR,"Invalid data file section: Dihedrals");
+      if (atomflag == 0) error->all(FLERR,"Must read Atoms before Dihedrals");
       dihedrals();
     } else if (strcmp(keyword,"Impropers") == 0) {
       if (atom->avec->impropers_allow == 0) 
-	error->all("Invalid data file section: Impropers");
-      if (atomflag == 0) error->all("Must read Atoms before Impropers");
+	error->all(FLERR,"Invalid data file section: Impropers");
+      if (atomflag == 0) error->all(FLERR,"Must read Atoms before Impropers");
       impropers();
 
     } else if (strcmp(keyword,"Masses") == 0) {
       mass();
     } else if (strcmp(keyword,"Pair Coeffs") == 0) {
       if (force->pair == NULL) 
-	error->all("Must define pair_style before Pair Coeffs");
+	error->all(FLERR,"Must define pair_style before Pair Coeffs");
       paircoeffs();
     } else if (strcmp(keyword,"Bond Coeffs") == 0) {
       if (atom->avec->bonds_allow == 0) 
-	error->all("Invalid data file section: Bond Coeffs");
+	error->all(FLERR,"Invalid data file section: Bond Coeffs");
       if (force->bond == NULL) 
-	error->all("Must define bond_style before Bond Coeffs");
+	error->all(FLERR,"Must define bond_style before Bond Coeffs");
       bondcoeffs();
     } else if (strcmp(keyword,"Angle Coeffs") == 0) {
       if (atom->avec->angles_allow == 0) 
-	error->all("Invalid data file section: Angle Coeffs");
+	error->all(FLERR,"Invalid data file section: Angle Coeffs");
       if (force->angle == NULL) 
-	error->all("Must define angle_style before Angle Coeffs");
+	error->all(FLERR,"Must define angle_style before Angle Coeffs");
       anglecoeffs(0);
     } else if (strcmp(keyword,"Dihedral Coeffs") == 0) {
       if (atom->avec->dihedrals_allow == 0) 
-	error->all("Invalid data file section: Dihedral Coeffs");
+	error->all(FLERR,"Invalid data file section: Dihedral Coeffs");
       if (force->dihedral == NULL) 
-	error->all("Must define dihedral_style before Dihedral Coeffs");
+	error->all(FLERR,"Must define dihedral_style before Dihedral Coeffs");
       dihedralcoeffs(0);
     } else if (strcmp(keyword,"Improper Coeffs") == 0) {
       if (atom->avec->impropers_allow == 0) 
-	error->all("Invalid data file section: Improper Coeffs");
+	error->all(FLERR,"Invalid data file section: Improper Coeffs");
       if (force->improper == NULL) 
-	error->all("Must define improper_style before Improper Coeffs");
+	error->all(FLERR,"Must define improper_style before Improper Coeffs");
       impropercoeffs(0);
 
     } else if (strcmp(keyword,"BondBond Coeffs") == 0) {
       if (atom->avec->angles_allow == 0) 
-	error->all("Invalid data file section: BondBond Coeffs");
+	error->all(FLERR,"Invalid data file section: BondBond Coeffs");
       if (force->angle == NULL) 
-	error->all("Must define angle_style before BondBond Coeffs");
+	error->all(FLERR,"Must define angle_style before BondBond Coeffs");
       anglecoeffs(1);
     } else if (strcmp(keyword,"BondAngle Coeffs") == 0) {
       if (atom->avec->angles_allow == 0) 
-	error->all("Invalid data file section: BondAngle Coeffs");
+	error->all(FLERR,"Invalid data file section: BondAngle Coeffs");
       if (force->angle == NULL) 
-	error->all("Must define angle_style before BondAngle Coeffs");
+	error->all(FLERR,"Must define angle_style before BondAngle Coeffs");
       anglecoeffs(2);
 
     } else if (strcmp(keyword,"MiddleBondTorsion Coeffs") == 0) {
       if (atom->avec->dihedrals_allow == 0) 
-	error->all("Invalid data file section: MiddleBondTorsion Coeffs");
+	error->all(FLERR,"Invalid data file section: MiddleBondTorsion Coeffs");
       if (force->dihedral == NULL) 
-	error->all("Must define dihedral_style before MiddleBondTorsion Coeffs");
+	error->all(FLERR,"Must define dihedral_style before MiddleBondTorsion Coeffs");
       dihedralcoeffs(1);
     } else if (strcmp(keyword,"EndBondTorsion Coeffs") == 0) {
       if (atom->avec->dihedrals_allow == 0) 
-	error->all("Invalid data file section: EndBondTorsion Coeffs");
+	error->all(FLERR,"Invalid data file section: EndBondTorsion Coeffs");
       if (force->dihedral == NULL) 
-	error->all("Must define dihedral_style before EndBondTorsion Coeffs");
+	error->all(FLERR,"Must define dihedral_style before EndBondTorsion Coeffs");
       dihedralcoeffs(2);
     } else if (strcmp(keyword,"AngleTorsion Coeffs") == 0) {
       if (atom->avec->dihedrals_allow == 0) 
-	error->all("Invalid data file section: AngleTorsion Coeffs");
+	error->all(FLERR,"Invalid data file section: AngleTorsion Coeffs");
       if (force->dihedral == NULL) 
-	error->all("Must define dihedral_style before AngleTorsion Coeffs");
+	error->all(FLERR,"Must define dihedral_style before AngleTorsion Coeffs");
       dihedralcoeffs(3);
     } else if (strcmp(keyword,"AngleAngleTorsion Coeffs") == 0) {
       if (atom->avec->dihedrals_allow == 0) 
-	error->all("Invalid data file section: AngleAngleTorsion Coeffs");
+	error->all(FLERR,"Invalid data file section: AngleAngleTorsion Coeffs");
       if (force->dihedral == NULL) 
-	error->all("Must define dihedral_style before AngleAngleTorsion Coeffs");
+	error->all(FLERR,"Must define dihedral_style before AngleAngleTorsion Coeffs");
       dihedralcoeffs(4);
     } else if (strcmp(keyword,"BondBond13 Coeffs") == 0) {
       if (atom->avec->dihedrals_allow == 0) 
-	error->all("Invalid data file section: BondBond13 Coeffs");
+	error->all(FLERR,"Invalid data file section: BondBond13 Coeffs");
       if (force->dihedral == NULL) 
-	error->all("Must define dihedral_style before BondBond13 Coeffs");
+	error->all(FLERR,"Must define dihedral_style before BondBond13 Coeffs");
       dihedralcoeffs(5);
 
     } else if (strcmp(keyword,"AngleAngle Coeffs") == 0) {
       if (atom->avec->impropers_allow == 0) 
-	error->all("Invalid data file section: AngleAngle Coeffs");
+	error->all(FLERR,"Invalid data file section: AngleAngle Coeffs");
       if (force->improper == NULL) 
-	error->all("Must define improper_style before AngleAngle Coeffs");
+	error->all(FLERR,"Must define improper_style before AngleAngle Coeffs");
       impropercoeffs(1);
 
     } else {
       char str[128];
       sprintf(str,"Unknown identifier in data file: %s",keyword);
-      error->all(str);
+      error->all(FLERR,str);
     }
 
     parse_keyword(0,1);
@@ -277,7 +274,7 @@ void ReadData::command(int narg, char **arg)
   
   // error if natoms > 0 yet no atoms were read
 
-  if (atom->natoms > 0 && atomflag == 0) error->all("No atoms in data file");
+  if (atom->natoms > 0 && atomflag == 0) error->all(FLERR,"No atoms in data file");
 
   // create bond topology now that system is defined
 
@@ -318,7 +315,7 @@ void ReadData::header(int flag)
 
   if (me == 0) {
     char *eof = fgets(line,MAXLINE,fp);
-    if (eof == NULL) error->one("Unexpected end of data file");
+    if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
   }
 
   // customize for new header lines
@@ -374,7 +371,7 @@ void ReadData::header(int flag)
 
     else if (strstr(line,"ellipsoids")) {
       if (!avec_ellipsoid)
-	error->all("No ellipsoids allowed with this atom style");
+	error->all(FLERR,"No ellipsoids allowed with this atom style");
       sscanf(line,BIGINT_FORMAT,&nellipsoids);
     }
 
@@ -397,8 +394,8 @@ void ReadData::header(int flag)
       atom->nangles < 0 || atom->nangles > MAXBIGINT ||
       atom->ndihedrals < 0 || atom->ndihedrals > MAXBIGINT ||
       atom->nimpropers < 0 || atom->nimpropers > MAXBIGINT) {
-    if (flag == 0) error->one("System in data file is too big");
-    else error->all("System in data file is too big");
+    if (flag == 0) error->one(FLERR,"System in data file is too big");
+    else error->all(FLERR,"System in data file is too big");
   }
 
   // check that exiting string is a valid section keyword
@@ -409,32 +406,32 @@ void ReadData::header(int flag)
   if (n == NSECTIONS) {
     char str[128];
     sprintf(str,"Unknown identifier in data file: %s",keyword);
-    error->all(str);
+    error->all(FLERR,str);
   }
 
   // error check on consistency of header values
 
   if ((atom->nbonds || atom->nbondtypes) && 
       atom->avec->bonds_allow == 0)
-    error->one("No bonds allowed with this atom style");
+    error->one(FLERR,"No bonds allowed with this atom style");
   if ((atom->nangles || atom->nangletypes) && 
       atom->avec->angles_allow == 0)
-    error->one("No angles allowed with this atom style");
+    error->one(FLERR,"No angles allowed with this atom style");
   if ((atom->ndihedrals || atom->ndihedraltypes) && 
       atom->avec->dihedrals_allow == 0)
-    error->one("No dihedrals allowed with this atom style");
+    error->one(FLERR,"No dihedrals allowed with this atom style");
   if ((atom->nimpropers || atom->nimpropertypes) && 
       atom->avec->impropers_allow == 0)
-    error->one("No impropers allowed with this atom style");
+    error->one(FLERR,"No impropers allowed with this atom style");
 
   if (atom->nbonds > 0 && atom->nbondtypes <= 0)
-    error->one("Bonds defined but no bond types");
+    error->one(FLERR,"Bonds defined but no bond types");
   if (atom->nangles > 0 && atom->nangletypes <= 0)
-    error->one("Angles defined but no angle types");
+    error->one(FLERR,"Angles defined but no angle types");
   if (atom->ndihedrals > 0 && atom->ndihedraltypes <= 0)
-    error->one("Dihedrals defined but no dihedral types");
+    error->one(FLERR,"Dihedrals defined but no dihedral types");
   if (atom->nimpropers > 0 && atom->nimpropertypes <= 0)
-    error->one("Impropers defined but no improper types");
+    error->one(FLERR,"Impropers defined but no improper types");
 }
 
 /* ----------------------------------------------------------------------
@@ -456,7 +453,7 @@ void ReadData::atoms()
       m = 0;
       for (i = 0; i < nchunk; i++) {
 	eof = fgets(&buffer[m],MAXLINE,fp);
-	if (eof == NULL) error->one("Unexpected end of data file");
+	if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
 	m += strlen(&buffer[m]);
       }
       m++;
@@ -478,7 +475,7 @@ void ReadData::atoms()
     if (logfile) fprintf(logfile,"  " BIGINT_FORMAT " atoms\n",natoms);
   }
 
-  if (natoms != atom->natoms) error->all("Did not assign all atoms correctly");
+  if (natoms != atom->natoms) error->all(FLERR,"Did not assign all atoms correctly");
   
   // if any atom ID < 0, error
   // if all atom IDs = 0, tag_enable = 0
@@ -494,7 +491,7 @@ void ReadData::atoms()
   int flag_all;
   MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_SUM,world);
   if (flag_all)
-    error->all("Invalid atom ID in Atoms section of data file");
+    error->all(FLERR,"Invalid atom ID in Atoms section of data file");
 
   flag = 0;
   for (int i = 0; i < nlocal; i++)
@@ -508,7 +505,7 @@ void ReadData::atoms()
       if (tag[i] == 0) flag = 1;
     MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_SUM,world);
     if (flag_all)
-      error->all("Invalid atom ID in Atoms section of data file");
+      error->all(FLERR,"Invalid atom ID in Atoms section of data file");
   }
 
   // create global mapping
@@ -547,7 +544,7 @@ void ReadData::velocities()
       m = 0;
       for (i = 0; i < nchunk; i++) {
 	eof = fgets(&buffer[m],MAXLINE,fp);
-	if (eof == NULL) error->one("Unexpected end of data file");
+	if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
 	m += strlen(&buffer[m]);
       }
       m++;
@@ -598,7 +595,7 @@ void ReadData::ellipsoids()
       m = 0;
       for (i = 0; i < nchunk; i++) {
 	eof = fgets(&buffer[m],MAXLINE,fp);
-	if (eof == NULL) error->one("Unexpected end of data file");
+	if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
 	m += strlen(&buffer[m]);
       }
       m++;
@@ -637,7 +634,7 @@ void ReadData::bonds()
       m = 0;
       for (i = 0; i < nchunk; i++) {
 	eof = fgets(&buffer[m],MAXLINE,fp);
-	if (eof == NULL) error->one("Unexpected end of data file");
+	if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
 	m += strlen(&buffer[m]);
       }
       m++;
@@ -663,7 +660,7 @@ void ReadData::bonds()
     if (screen) fprintf(screen,"  " BIGINT_FORMAT " bonds\n",sum/factor);
     if (logfile) fprintf(logfile,"  " BIGINT_FORMAT " bonds\n",sum/factor);
   }
-  if (sum != factor*atom->nbonds) error->all("Bonds assigned incorrectly");
+  if (sum != factor*atom->nbonds) error->all(FLERR,"Bonds assigned incorrectly");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -682,7 +679,7 @@ void ReadData::angles()
       m = 0;
       for (i = 0; i < nchunk; i++) {
 	eof = fgets(&buffer[m],MAXLINE,fp);
-	if (eof == NULL) error->one("Unexpected end of data file");
+	if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
 	m += strlen(&buffer[m]);
       }
       m++;
@@ -708,7 +705,7 @@ void ReadData::angles()
     if (screen) fprintf(screen,"  " BIGINT_FORMAT " angles\n",sum/factor);
     if (logfile) fprintf(logfile,"  " BIGINT_FORMAT " angles\n",sum/factor);
   }
-  if (sum != factor*atom->nangles) error->all("Angles assigned incorrectly");
+  if (sum != factor*atom->nangles) error->all(FLERR,"Angles assigned incorrectly");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -727,7 +724,7 @@ void ReadData::dihedrals()
       m = 0;
       for (i = 0; i < nchunk; i++) {
 	eof = fgets(&buffer[m],MAXLINE,fp);
-	if (eof == NULL) error->one("Unexpected end of data file");
+	if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
 	m += strlen(&buffer[m]);
       }
       m++;
@@ -754,7 +751,7 @@ void ReadData::dihedrals()
     if (logfile) fprintf(logfile,"  " BIGINT_FORMAT " dihedrals\n",sum/factor);
   }
   if (sum != factor*atom->ndihedrals) 
-    error->all("Dihedrals assigned incorrectly");
+    error->all(FLERR,"Dihedrals assigned incorrectly");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -773,7 +770,7 @@ void ReadData::impropers()
       m = 0;
       for (i = 0; i < nchunk; i++) {
 	eof = fgets(&buffer[m],MAXLINE,fp);
-	if (eof == NULL) error->one("Unexpected end of data file");
+	if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
 	m += strlen(&buffer[m]);
       }
       m++;
@@ -800,7 +797,7 @@ void ReadData::impropers()
     if (logfile) fprintf(logfile,"  " BIGINT_FORMAT " impropers\n",sum/factor);
   }
   if (sum != factor*atom->nimpropers) 
-    error->all("Impropers assigned incorrectly");
+    error->all(FLERR,"Impropers assigned incorrectly");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -816,7 +813,7 @@ void ReadData::mass()
     m = 0;
     for (i = 0; i < atom->ntypes; i++) {
       eof = fgets(&buf[m],MAXLINE,fp);
-      if (eof == NULL) error->one("Unexpected end of data file");
+      if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
       m += strlen(&buf[m]);
       buf[m-1] = '\0';
     }
@@ -845,7 +842,7 @@ void ReadData::paircoeffs()
     m = 0;
     for (i = 0; i < atom->ntypes; i++) {
       eof = fgets(&buf[m],MAXLINE,fp);
-      if (eof == NULL) error->one("Unexpected end of data file");
+      if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
       m += strlen(&buf[m]);
       buf[m-1] = '\0';
     }
@@ -876,7 +873,7 @@ void ReadData::bondcoeffs()
     m = 0;
     for (i = 0; i < atom->nbondtypes; i++) {
       eof = fgets(&buf[m],MAXLINE,fp);
-      if (eof == NULL) error->one("Unexpected end of data file");
+      if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
       m += strlen(&buf[m]);
       buf[m-1] = '\0';
     }
@@ -907,7 +904,7 @@ void ReadData::anglecoeffs(int which)
     m = 0;
     for (i = 0; i < atom->nangletypes; i++) {
       eof = fgets(&buf[m],MAXLINE,fp);
-      if (eof == NULL) error->one("Unexpected end of data file");
+      if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
       m += strlen(&buf[m]);
       buf[m-1] = '\0';
     }
@@ -940,7 +937,7 @@ void ReadData::dihedralcoeffs(int which)
     m = 0;
     for (i = 0; i < atom->ndihedraltypes; i++) {
       eof = fgets(&buf[m],MAXLINE,fp);
-      if (eof == NULL) error->one("Unexpected end of data file");
+      if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
       m += strlen(&buf[m]);
       buf[m-1] = '\0';
     }
@@ -976,7 +973,7 @@ void ReadData::impropercoeffs(int which)
     m = 0;
     for (i = 0; i < atom->nimpropertypes; i++) {
       eof = fgets(&buf[m],MAXLINE,fp);
-      if (eof == NULL) error->one("Unexpected end of data file");
+      if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
       m += strlen(&buf[m]);
       buf[m-1] = '\0';
     }
@@ -1006,7 +1003,7 @@ void ReadData::scan(int &bond_per_atom, int &angle_per_atom,
   char *eof;
 
   if (atom->natoms > MAXSMALLINT)
-    error->all("Molecular data file has too many atoms");
+    error->all(FLERR,"Molecular data file has too many atoms");
 
   // customize for new sections
 
@@ -1031,86 +1028,86 @@ void ReadData::scan(int &bond_per_atom, int &angle_per_atom,
 
     else if (strcmp(keyword,"Ellipsoids") == 0) {
       if (!avec_ellipsoid) 
-	error->all("Invalid data file section: Ellipsoids");
+	error->all(FLERR,"Invalid data file section: Ellipsoids");
       ellipsoid_flag = 1;
       skip_lines(nellipsoids);
 
     } else if (strcmp(keyword,"Pair Coeffs") == 0) {
       if (force->pair == NULL) 
-	error->all("Must define pair_style before Pair Coeffs");
+	error->all(FLERR,"Must define pair_style before Pair Coeffs");
       skip_lines(atom->ntypes);
     } else if (strcmp(keyword,"Bond Coeffs") == 0) {
       if (atom->avec->bonds_allow == 0) 
-	error->all("Invalid data file section: Bond Coeffs");
+	error->all(FLERR,"Invalid data file section: Bond Coeffs");
       if (force->bond == NULL) 
-	error->all("Must define bond_style before Bond Coeffs");
+	error->all(FLERR,"Must define bond_style before Bond Coeffs");
       skip_lines(atom->nbondtypes);
     } else if (strcmp(keyword,"Angle Coeffs") == 0) {
       if (atom->avec->angles_allow == 0) 
-	error->all("Invalid data file section: Angle Coeffs");
+	error->all(FLERR,"Invalid data file section: Angle Coeffs");
       if (force->angle == NULL) 
-	error->all("Must define angle_style before Angle Coeffs");
+	error->all(FLERR,"Must define angle_style before Angle Coeffs");
       skip_lines(atom->nangletypes);
     } else if (strcmp(keyword,"Dihedral Coeffs") == 0) {
       skip_lines(atom->ndihedraltypes);
       if (atom->avec->dihedrals_allow == 0) 
-	error->all("Invalid data file section: Dihedral Coeffs");
+	error->all(FLERR,"Invalid data file section: Dihedral Coeffs");
       if (force->dihedral == NULL) 
-	error->all("Must define dihedral_style before Dihedral Coeffs");
+	error->all(FLERR,"Must define dihedral_style before Dihedral Coeffs");
     }  else if (strcmp(keyword,"Improper Coeffs") == 0) {
       if (atom->avec->impropers_allow == 0) 
-	error->all("Invalid data file section: Improper Coeffs");
+	error->all(FLERR,"Invalid data file section: Improper Coeffs");
       if (force->improper == NULL) 
-	error->all("Must define improper_style before Improper Coeffs");
+	error->all(FLERR,"Must define improper_style before Improper Coeffs");
       skip_lines(atom->nimpropertypes);
 
     } else if (strcmp(keyword,"BondBond Coeffs") == 0) {
       if (atom->avec->angles_allow == 0) 
-	error->all("Invalid data file section: BondBond Coeffs");
+	error->all(FLERR,"Invalid data file section: BondBond Coeffs");
       if (force->angle == NULL) 
-	error->all("Must define angle_style before BondBond Coeffs");
+	error->all(FLERR,"Must define angle_style before BondBond Coeffs");
       skip_lines(atom->nangletypes);
     } else if (strcmp(keyword,"BondAngle Coeffs") == 0) {
       if (atom->avec->angles_allow == 0) 
-	error->all("Invalid data file section: BondAngle Coeffs");
+	error->all(FLERR,"Invalid data file section: BondAngle Coeffs");
       if (force->angle == NULL) 
-	error->all("Must define angle_style before BondAngle Coeffs");
+	error->all(FLERR,"Must define angle_style before BondAngle Coeffs");
       skip_lines(atom->nangletypes);
     } else if (strcmp(keyword,"MiddleBondTorsion Coeffs") == 0) {
       if (atom->avec->dihedrals_allow == 0) 
-	error->all("Invalid data file section: MiddleBondTorsion Coeffs");
+	error->all(FLERR,"Invalid data file section: MiddleBondTorsion Coeffs");
       if (force->dihedral == NULL) 
-	error->all("Must define dihedral_style before MiddleBondTorsion Coeffs");
+	error->all(FLERR,"Must define dihedral_style before MiddleBondTorsion Coeffs");
       skip_lines(atom->ndihedraltypes);
     } else if (strcmp(keyword,"EndBondTorsion Coeffs") == 0) {
       if (atom->avec->dihedrals_allow == 0) 
-	error->all("Invalid data file section: EndBondTorsion Coeffs");
+	error->all(FLERR,"Invalid data file section: EndBondTorsion Coeffs");
       if (force->dihedral == NULL) 
-	error->all("Must define dihedral_style before EndBondTorsion Coeffs");
+	error->all(FLERR,"Must define dihedral_style before EndBondTorsion Coeffs");
       skip_lines(atom->ndihedraltypes);
     } else if (strcmp(keyword,"AngleTorsion Coeffs") == 0) {
       if (atom->avec->dihedrals_allow == 0) 
-	error->all("Invalid data file section: AngleTorsion Coeffs");
+	error->all(FLERR,"Invalid data file section: AngleTorsion Coeffs");
       if (force->dihedral == NULL) 
-	error->all("Must define dihedral_style before AngleTorsion Coeffs");
+	error->all(FLERR,"Must define dihedral_style before AngleTorsion Coeffs");
       skip_lines(atom->ndihedraltypes);
     } else if (strcmp(keyword,"AngleAngleTorsion Coeffs") == 0) {
       if (atom->avec->dihedrals_allow == 0) 
-	error->all("Invalid data file section: AngleAngleTorsion Coeffs");
+	error->all(FLERR,"Invalid data file section: AngleAngleTorsion Coeffs");
       if (force->dihedral == NULL) 
-	error->all("Must define dihedral_style before AngleAngleTorsion Coeffs");
+	error->all(FLERR,"Must define dihedral_style before AngleAngleTorsion Coeffs");
       skip_lines(atom->ndihedraltypes);
     } else if (strcmp(keyword,"BondBond13 Coeffs") == 0) {
       if (atom->avec->dihedrals_allow == 0) 
-	error->all("Invalid data file section: BondBond13 Coeffs");
+	error->all(FLERR,"Invalid data file section: BondBond13 Coeffs");
       if (force->dihedral == NULL) 
-	error->all("Must define dihedral_style before BondBond13 Coeffs");
+	error->all(FLERR,"Must define dihedral_style before BondBond13 Coeffs");
       skip_lines(atom->ndihedraltypes);
     } else if (strcmp(keyword,"AngleAngle Coeffs") == 0) {
       if (atom->avec->impropers_allow == 0) 
-	error->all("Invalid data file section: AngleAngle Coeffs");
+	error->all(FLERR,"Invalid data file section: AngleAngle Coeffs");
       if (force->improper == NULL) 
-	error->all("Must define improper_style before AngleAngle Coeffs");
+	error->all(FLERR,"Must define improper_style before AngleAngle Coeffs");
       skip_lines(atom->nimpropertypes);
 
     } else if (strcmp(keyword,"Bonds") == 0) {
@@ -1118,7 +1115,7 @@ void ReadData::scan(int &bond_per_atom, int &angle_per_atom,
       if (force->newton_bond)
 	for (i = 0; i < atom->nbonds; i++) {
 	  eof = fgets(line,MAXLINE,fp);
-	  if (eof == NULL) error->one("Unexpected end of data file");
+	  if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
 	  sscanf(line,"%d %d %d %d",&tmp1,&tmp2,&atom1,&atom2);
 	  if (atom1 >= cmax) cmax = reallocate(&count,cmax,atom1);
 	  count[atom1]++;
@@ -1126,7 +1123,7 @@ void ReadData::scan(int &bond_per_atom, int &angle_per_atom,
       else
 	for (i = 0; i < atom->nbonds; i++) {
 	  eof = fgets(line,MAXLINE,fp);
-	  if (eof == NULL) error->one("Unexpected end of data file");
+	  if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
 	  sscanf(line,"%d %d %d %d",&tmp1,&tmp2,&atom1,&atom2);
 	  int amax = MAX(atom1,atom2);
 	  if (amax >= cmax) cmax = reallocate(&count,cmax,amax);
@@ -1142,7 +1139,7 @@ void ReadData::scan(int &bond_per_atom, int &angle_per_atom,
       if (force->newton_bond)
 	for (i = 0; i < atom->nangles; i++) {
 	  eof = fgets(line,MAXLINE,fp);
-	  if (eof == NULL) error->one("Unexpected end of data file");
+	  if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
 	  sscanf(line,"%d %d %d %d %d",&tmp1,&tmp2,&atom1,&atom2,&atom3);
 	  if (atom2 >= cmax) cmax = reallocate(&count,cmax,atom2);
 	  count[atom2]++;
@@ -1150,7 +1147,7 @@ void ReadData::scan(int &bond_per_atom, int &angle_per_atom,
       else
 	for (i = 0; i < atom->nangles; i++) {
 	  eof = fgets(line,MAXLINE,fp);
-	  if (eof == NULL) error->one("Unexpected end of data file");
+	  if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
 	  sscanf(line,"%d %d %d %d %d",&tmp1,&tmp2,&atom1,&atom2,&atom3);
 	  int amax = MAX(atom1,atom2);
 	  amax = MAX(amax,atom3);
@@ -1168,7 +1165,7 @@ void ReadData::scan(int &bond_per_atom, int &angle_per_atom,
       if (force->newton_bond)
 	for (i = 0; i < atom->ndihedrals; i++) {
 	  eof = fgets(line,MAXLINE,fp);
-	  if (eof == NULL) error->one("Unexpected end of data file");
+	  if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
 	  sscanf(line,"%d %d %d %d %d %d",
 		 &tmp1,&tmp2,&atom1,&atom2,&atom3,&atom4);
 	  if (atom2 >= cmax) cmax = reallocate(&count,cmax,atom2);
@@ -1177,7 +1174,7 @@ void ReadData::scan(int &bond_per_atom, int &angle_per_atom,
       else
 	for (i = 0; i < atom->ndihedrals; i++) {
 	  eof = fgets(line,MAXLINE,fp);
-	  if (eof == NULL) error->one("Unexpected end of data file");
+	  if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
 	  sscanf(line,"%d %d %d %d %d %d",
 		 &tmp1,&tmp2,&atom1,&atom2,&atom3,&atom4);
 	  int amax = MAX(atom1,atom2);
@@ -1201,7 +1198,7 @@ void ReadData::scan(int &bond_per_atom, int &angle_per_atom,
       if (force->newton_bond)
 	for (i = 0; i < atom->nimpropers; i++) {
 	  eof = fgets(line,MAXLINE,fp);
-	  if (eof == NULL) error->one("Unexpected end of data file");
+	  if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
 	  sscanf(line,"%d %d %d %d %d %d",
 		 &tmp1,&tmp2,&atom1,&atom2,&atom3,&atom4);
 	  if (atom2 >= cmax) cmax = reallocate(&count,cmax,atom2);
@@ -1210,7 +1207,7 @@ void ReadData::scan(int &bond_per_atom, int &angle_per_atom,
       else
 	for (i = 0; i < atom->nimpropers; i++) {
 	  eof = fgets(line,MAXLINE,fp);
-	  if (eof == NULL) error->one("Unexpected end of data file");
+	  if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
 	  sscanf(line,"%d %d %d %d %d %d",
 		 &tmp1,&tmp2,&atom1,&atom2,&atom3,&atom4);
 	  int amax = MAX(atom1,atom2);
@@ -1232,7 +1229,7 @@ void ReadData::scan(int &bond_per_atom, int &angle_per_atom,
     } else {
       char str[128];
       sprintf(str,"Unknown identifier in data file: %s",keyword);
-      error->one(str);
+      error->one(FLERR,str);
     }
 
     parse_keyword(0,0);
@@ -1248,13 +1245,13 @@ void ReadData::scan(int &bond_per_atom, int &angle_per_atom,
       (atom->nangles && !angle_per_atom) ||
       (atom->ndihedrals && !dihedral_per_atom) ||
       (atom->nimpropers && !improper_per_atom)) 
-    error->one("Needed topology not in data file");
+    error->one(FLERR,"Needed topology not in data file");
 
   // customize for new sections
   // error check that Bonus sections were speficied in file
 
   if (nellipsoids && !ellipsoid_flag)
-    error->one("Needed bonus data not in data file");
+    error->one(FLERR,"Needed bonus data not in data file");
 }
 
 /* ----------------------------------------------------------------------
@@ -1288,14 +1285,14 @@ void ReadData::open(char *file)
     sprintf(gunzip,"gunzip -c %s",file);
     fp = popen(gunzip,"r");
 #else
-    error->one("Cannot open gzipped file");
+    error->one(FLERR,"Cannot open gzipped file");
 #endif
   }
 
   if (fp == NULL) {
     char str[128];
     sprintf(str,"Cannot open file %s",file);
-    error->one(str);
+    error->one(FLERR,str);
   }
 }
 
@@ -1362,7 +1359,7 @@ void ReadData::skip_lines(int n)
 {
   char *eof;
   for (int i = 0; i < n; i++) eof = fgets(line,MAXLINE,fp);
-  if (eof == NULL) error->one("Unexpected end of data file");
+  if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/read_restart.cpp b/src/read_restart.cpp
index d815b7ff8e669eb7480399920f014d3a4571827d..0514cea310a67dd7e578948b0b8f85a772003e59 100644
--- a/src/read_restart.cpp
+++ b/src/read_restart.cpp
@@ -69,10 +69,10 @@ ReadRestart::ReadRestart(LAMMPS *lmp) : Pointers(lmp) {}
 
 void ReadRestart::command(int narg, char **arg)
 {
-  if (narg != 1) error->all("Illegal read_restart command");
+  if (narg != 1) error->all(FLERR,"Illegal read_restart command");
 
   if (domain->box_exist) 
-    error->all("Cannot read_restart after simulation box is defined");
+    error->all(FLERR,"Cannot read_restart after simulation box is defined");
 
   MPI_Comm_rank(world,&me);
   MPI_Comm_size(world,&nprocs);
@@ -112,7 +112,7 @@ void ReadRestart::command(int narg, char **arg)
     if (fp == NULL) {
       char str[128];
       sprintf(str,"Cannot open restart file %s",hfile);
-      error->one(str);
+      error->one(FLERR,str);
     }
     if (multiproc) delete [] hfile;
   }
@@ -226,7 +226,7 @@ void ReadRestart::command(int narg, char **arg)
       if (fp == NULL) {
 	char str[128];
 	sprintf(str,"Cannot open restart file %s",perproc);
-	error->one(str);
+	error->one(FLERR,str);
       }
 
       fread(&n,sizeof(int),1,fp);
@@ -307,7 +307,7 @@ void ReadRestart::command(int narg, char **arg)
     if (logfile) fprintf(logfile,"  " BIGINT_FORMAT " atoms\n",natoms);
   }
 
-  if (natoms != atom->natoms) error->all("Did not assign all atoms correctly");
+  if (natoms != atom->natoms) error->all(FLERR,"Did not assign all atoms correctly");
 
   if (me == 0) {
     if (atom->nbonds) {
@@ -411,7 +411,7 @@ void ReadRestart::file_search(char *infile, char *outfile)
   struct dirent *ep;
   DIR *dp = opendir(dirname);
   if (dp == NULL) 
-    error->one("Cannot open dir to search for restart file");
+    error->one(FLERR,"Cannot open dir to search for restart file");
   while (ep = readdir(dp)) {
     if (strstr(ep->d_name,begin) != ep->d_name) continue;
     if ((ptr = strstr(&ep->d_name[nbegin],end)) == NULL) continue;
@@ -423,7 +423,7 @@ void ReadRestart::file_search(char *infile, char *outfile)
     }
   }
   closedir(dp);
-  if (maxnum < 0) error->one("Found no restart file matching pattern");
+  if (maxnum < 0) error->one(FLERR,"Found no restart file matching pattern");
 
   // create outfile with maxint substituted for "*"
   // use original infile, not pattern, since need to retain "%" in filename
@@ -463,7 +463,7 @@ void ReadRestart::header()
     if (flag == VERSION) {
       char *version = read_char();
       if (strcmp(version,universe->version) != 0 && me == 0) {
-	error->warning("Restart file version does not match LAMMPS version");
+	error->warning(FLERR,"Restart file version does not match LAMMPS version");
 	if (screen) fprintf(screen,"  restart file = %s, LAMMPS = %s\n",
 			    version,universe->version);
       }
@@ -474,15 +474,15 @@ void ReadRestart::header()
     } else if (flag == SMALLINT) {
       int size = read_int();
       if (size != sizeof(smallint))
-	error->all("Smallint setting in lmptype.h is not compatible");
+	error->all(FLERR,"Smallint setting in lmptype.h is not compatible");
     } else if (flag == TAGINT) {
       int size = read_int();
       if (size != sizeof(tagint))
-	error->all("Tagint setting in lmptype.h is not compatible");
+	error->all(FLERR,"Tagint setting in lmptype.h is not compatible");
     } else if (flag == BIGINT) {
       int size = read_int();
       if (size != sizeof(bigint))
-	error->all("Bigint setting in lmptype.h is not compatible");
+	error->all(FLERR,"Bigint setting in lmptype.h is not compatible");
 
       // reset unit_style only if different
       // so that timestep,neighbor-skin are not changed
@@ -501,14 +501,14 @@ void ReadRestart::header()
       int dimension = read_int();
       domain->dimension = dimension;
       if (domain->dimension == 2 && domain->zperiodic == 0)
-	error->all("Cannot run 2d simulation with nonperiodic Z dimension");
+	error->all(FLERR,"Cannot run 2d simulation with nonperiodic Z dimension");
 
       // read nprocs from restart file, warn if different
 
     } else if (flag == NPROCS) {
       nprocs_file = read_int();
       if (nprocs_file != comm->nprocs && me == 0)
-	error->warning("Restart file used different # of processors");
+	error->warning(FLERR,"Restart file used different # of processors");
 
       // don't set procgrid, warn if different
 
@@ -521,7 +521,7 @@ void ReadRestart::header()
       if (comm->user_procgrid[0] != 0 && 
 	  (px != comm->user_procgrid[0] || py != comm->user_procgrid[1] || 
 	   pz != comm->user_procgrid[2]) && me == 0)
-	error->warning("Restart file used different 3d processor grid");
+	error->warning(FLERR,"Restart file used different 3d processor grid");
 
     // don't set newton_pair, leave input script value unchanged
     // set newton_bond from restart file
@@ -531,14 +531,14 @@ void ReadRestart::header()
       int newton_pair_file = read_int();
       if (force->newton_pair != 1) {
 	if (newton_pair_file != force->newton_pair && me == 0)
-	  error->warning("Restart file used different newton pair setting, "
+	  error->warning(FLERR,"Restart file used different newton pair setting, "
 			 "using input script value");
       }
     } else if (flag == NEWTON_BOND) {
       int newton_bond_file = read_int();
       if (force->newton_bond != 1) {
 	if (newton_bond_file != force->newton_bond && me == 0)
-	  error->warning("Restart file used different newton bond setting, "
+	  error->warning(FLERR,"Restart file used different newton bond setting, "
 			 "using restart file value");
       }
       force->newton_bond = newton_bond_file;
@@ -577,7 +577,7 @@ void ReadRestart::header()
 	    boundary[2][0] != domain->boundary[2][0] ||
 	    boundary[2][1] != domain->boundary[2][1]) {
 	  if (me == 0) 
-	    error->warning("Restart file used different boundary settings, "
+	    error->warning(FLERR,"Restart file used different boundary settings, "
 			   "using restart file values");
 	}
       }
@@ -687,7 +687,7 @@ void ReadRestart::header()
       domain->triclinic = 1;
       domain->yz = read_double();
 
-    } else error->all("Invalid flag in header section of restart file");
+    } else error->all(FLERR,"Invalid flag in header section of restart file");
 
     flag = read_int();
   }
@@ -707,7 +707,7 @@ void ReadRestart::type_arrays()
       atom->set_mass(mass);
       delete [] mass;
 
-    } else error->all("Invalid flag in type arrays section of restart file");
+    } else error->all(FLERR,"Invalid flag in type arrays section of restart file");
 
     flag = read_int();
   }
@@ -778,7 +778,7 @@ void ReadRestart::force_fields()
       delete [] style;
       force->improper->read_restart(fp);
 
-    } else error->all("Invalid flag in force field section of restart file");
+    } else error->all(FLERR,"Invalid flag in force field section of restart file");
 
     flag = read_int();
   }
diff --git a/src/region.cpp b/src/region.cpp
index 412fcdeff913aa0f0082d7490d5dff2b8b2eacaa..d73ebd368aae406faa4d9297b55886013c0b1e85 100644
--- a/src/region.cpp
+++ b/src/region.cpp
@@ -60,27 +60,27 @@ void Region::init()
 {
   if (xstr) {
     xvar = input->variable->find(xstr);
-    if (xvar < 0) error->all("Variable name for region does not exist");
+    if (xvar < 0) error->all(FLERR,"Variable name for region does not exist");
     if (!input->variable->equalstyle(xvar))
-      error->all("Variable for region is invalid style");
+      error->all(FLERR,"Variable for region is invalid style");
   }
   if (ystr) {
     yvar = input->variable->find(ystr);
-    if (yvar < 0) error->all("Variable name for region does not exist");
+    if (yvar < 0) error->all(FLERR,"Variable name for region does not exist");
     if (!input->variable->equalstyle(yvar))
-      error->all("Variable for region is not equal style");
+      error->all(FLERR,"Variable for region is not equal style");
   }
   if (zstr) {
     zvar = input->variable->find(zstr);
-    if (zvar < 0) error->all("Variable name for region does not exist");
+    if (zvar < 0) error->all(FLERR,"Variable name for region does not exist");
     if (!input->variable->equalstyle(zvar))
-      error->all("Variable for region is not equal style");
+      error->all(FLERR,"Variable for region is not equal style");
   }
   if (tstr) {
     tvar = input->variable->find(tstr);
-    if (tvar < 0) error->all("Variable name for region does not exist");
+    if (tvar < 0) error->all(FLERR,"Variable name for region does not exist");
     if (!input->variable->equalstyle(tvar))
-      error->all("Variable for region is not equal style");
+      error->all(FLERR,"Variable for region is not equal style");
   }
 }
 
@@ -275,7 +275,7 @@ void Region::rotate(double &x, double &y, double &z, double angle)
 
 void Region::options(int narg, char **arg)
 {
-  if (narg < 0) error->all("Illegal region command");
+  if (narg < 0) error->all(FLERR,"Illegal region command");
 
   // option defaults
 
@@ -286,37 +286,37 @@ void Region::options(int narg, char **arg)
   int iarg = 0;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"units") == 0) {
-      if (iarg+2 > narg) error->all("Illegal region command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal region command");
       if (strcmp(arg[iarg+1],"box") == 0) scaleflag = 0;
       else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1;
-      else error->all("Illegal region command");
+      else error->all(FLERR,"Illegal region command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"side") == 0) {
-      if (iarg+2 > narg) error->all("Illegal region command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal region command");
       if (strcmp(arg[iarg+1],"in") == 0) interior = 1;
       else if (strcmp(arg[iarg+1],"out") == 0) interior = 0;
-      else error->all("Illegal region command");
+      else error->all(FLERR,"Illegal region command");
       iarg += 2;
 
     } else if (strcmp(arg[iarg],"move") == 0) {
-      if (iarg+4 > narg) error->all("Illegal region command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal region command");
       if (strcmp(arg[iarg+1],"NULL") != 0) {
 	if (strstr(arg[iarg+1],"v_") != arg[iarg+1]) 
-	  error->all("Illegal region command");
+	  error->all(FLERR,"Illegal region command");
 	int n = strlen(&arg[iarg+1][2]) + 1;
 	xstr = new char[n];
 	strcpy(xstr,&arg[iarg+1][2]);
       }
       if (strcmp(arg[iarg+2],"NULL") != 0) {
 	if (strstr(arg[iarg+2],"v_") != arg[iarg+2]) 
-	  error->all("Illegal region command");
+	  error->all(FLERR,"Illegal region command");
 	int n = strlen(&arg[iarg+2][2]) + 1;
 	ystr = new char[n];
 	strcpy(ystr,&arg[iarg+2][2]);
       }
       if (strcmp(arg[iarg+3],"NULL") != 0) {
 	if (strstr(arg[iarg+3],"v_") != arg[iarg+3]) 
-	  error->all("Illegal region command");
+	  error->all(FLERR,"Illegal region command");
 	int n = strlen(&arg[iarg+3][2]) + 1;
 	zstr = new char[n];
 	strcpy(zstr,&arg[iarg+3][2]);
@@ -325,9 +325,9 @@ void Region::options(int narg, char **arg)
       iarg += 4;
 
     } else if (strcmp(arg[iarg],"rotate") == 0) {
-      if (iarg+8 > narg) error->all("Illegal region command");
+      if (iarg+8 > narg) error->all(FLERR,"Illegal region command");
       if (strstr(arg[iarg+1],"v_") != arg[iarg+1]) 
-	error->all("Illegal region command");
+	error->all(FLERR,"Illegal region command");
       int n = strlen(&arg[iarg+1][2]) + 1;
       tstr = new char[n];
       strcpy(tstr,&arg[iarg+1][2]);
@@ -339,19 +339,19 @@ void Region::options(int narg, char **arg)
       axis[2] = atof(arg[iarg+7]);
       rotateflag = 1;
       iarg += 8;
-    } else error->all("Illegal region command");
+    } else error->all(FLERR,"Illegal region command");
   }
 
   // error check
   
   if ((moveflag || rotateflag) && 
       (strcmp(style,"union") == 0 || strcmp(style,"intersect") == 0))
-    error->all("Region union or intersect cannot be dynamic");
+    error->all(FLERR,"Region union or intersect cannot be dynamic");
 
   // setup scaling
 
   if (scaleflag && domain->lattice == NULL)
-    error->all("Use of region with undefined lattice");
+    error->all(FLERR,"Use of region with undefined lattice");
 
   if (scaleflag) {
     xscale = domain->lattice->xlattice;
@@ -371,7 +371,7 @@ void Region::options(int narg, char **arg)
   if (rotateflag) {
     double len = sqrt(axis[0]*axis[0] + axis[1]*axis[1] + axis[2]*axis[2]);
     if (len == 0.0) 
-      error->all("Region cannot have 0 length rotation vector");
+      error->all(FLERR,"Region cannot have 0 length rotation vector");
     runit[0] = axis[0]/len;
     runit[1] = axis[1]/len;
     runit[2] = axis[2]/len;
diff --git a/src/region_block.cpp b/src/region_block.cpp
index ff01e7f6a9d1209fd9a20d059eef620c63a2f7e4..cf5eb992080561548676fd88015874a236d1b391 100644
--- a/src/region_block.cpp
+++ b/src/region_block.cpp
@@ -21,9 +21,6 @@ using namespace LAMMPS_NS;
 
 #define BIG 1.0e20
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
@@ -32,7 +29,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
   
   if (strcmp(arg[2],"INF") == 0 || strcmp(arg[2],"EDGE") == 0) {
     if (domain->box_exist == 0) 
-      error->all("Cannot use region INF or EDGE when box does not exist");
+      error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (strcmp(arg[2],"INF") == 0) xlo = -BIG;
     else if (domain->triclinic == 0) xlo = domain->boxlo[0];
     else xlo = domain->boxlo_bound[0];
@@ -40,7 +37,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
 
   if (strcmp(arg[3],"INF") == 0 || strcmp(arg[3],"EDGE") == 0) {
     if (domain->box_exist == 0) 
-      error->all("Cannot use region INF or EDGE when box does not exist");
+      error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (strcmp(arg[3],"INF") == 0) xhi = BIG;
     else if (domain->triclinic == 0) xhi = domain->boxhi[0];
     else xhi = domain->boxhi_bound[0];
@@ -48,7 +45,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
 
   if (strcmp(arg[4],"INF") == 0 || strcmp(arg[4],"EDGE") == 0) {
     if (domain->box_exist == 0) 
-      error->all("Cannot use region INF or EDGE when box does not exist");
+      error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (strcmp(arg[4],"INF") == 0) ylo = -BIG;
     else if (domain->triclinic == 0) ylo = domain->boxlo[1];
     else ylo = domain->boxlo_bound[1];
@@ -56,7 +53,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
 
   if (strcmp(arg[5],"INF") == 0 || strcmp(arg[5],"EDGE") == 0) {
     if (domain->box_exist == 0) 
-      error->all("Cannot use region INF or EDGE when box does not exist");
+      error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (strcmp(arg[5],"INF") == 0) yhi = BIG;
     else if (domain->triclinic == 0) yhi = domain->boxhi[1];
     else yhi = domain->boxhi_bound[1];
@@ -64,7 +61,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
 
   if (strcmp(arg[6],"INF") == 0 || strcmp(arg[6],"EDGE") == 0) {
     if (domain->box_exist == 0) 
-      error->all("Cannot use region INF or EDGE when box does not exist");
+      error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (strcmp(arg[6],"INF") == 0) zlo = -BIG;
     else if (domain->triclinic == 0) zlo = domain->boxlo[2];
     else zlo = domain->boxlo_bound[2];
@@ -72,7 +69,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
 
   if (strcmp(arg[7],"INF") == 0 || strcmp(arg[7],"EDGE") == 0) {
     if (domain->box_exist == 0) 
-      error->all("Cannot use region INF or EDGE when box does not exist");
+      error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (strcmp(arg[7],"INF") == 0) zhi = BIG;
     else if (domain->triclinic == 0) zhi = domain->boxhi[2];
     else zhi = domain->boxhi_bound[2];
@@ -81,7 +78,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
   // error check
 
   if (xlo > xhi || ylo > yhi || zlo > zhi)
-    error->all("Illegal region block command");
+    error->all(FLERR,"Illegal region block command");
 
   // extent of block
 
diff --git a/src/region_cone.cpp b/src/region_cone.cpp
index c6b94c295c7d2cb8f0baad081a0f770f037e5d6d..bfa4e79716442718bd96210a88763a1c4d11c014 100644
--- a/src/region_cone.cpp
+++ b/src/region_cone.cpp
@@ -34,7 +34,7 @@ RegCone::RegCone(LAMMPS *lmp, int narg, char **arg) :
   options(narg-9,&arg[9]);
 
   if (strcmp(arg[2],"x") && strcmp(arg[2],"y") && strcmp(arg[2],"z")) 
-    error->all("Illegal region cylinder command");
+    error->all(FLERR,"Illegal region cylinder command");
   axis = arg[2][0];
 
   if (axis == 'x') {
@@ -56,7 +56,7 @@ RegCone::RegCone(LAMMPS *lmp, int narg, char **arg) :
 
   if (strcmp(arg[7],"INF") == 0 || strcmp(arg[7],"EDGE") == 0) {
     if (domain->box_exist == 0) 
-      error->all("Cannot use region INF or EDGE when box does not exist");
+      error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (axis == 'x') {
       if (strcmp(arg[7],"INF") == 0) lo = -BIG;
       else if (domain->triclinic == 0) lo = domain->boxlo[0];
@@ -80,7 +80,7 @@ RegCone::RegCone(LAMMPS *lmp, int narg, char **arg) :
 
   if (strcmp(arg[8],"INF") == 0 || strcmp(arg[7],"EDGE") == 0) {
     if (domain->box_exist == 0) 
-      error->all("Cannot use region INF or EDGE when box does not exist");
+      error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (axis == 'x') {
       if (strcmp(arg[8],"INF") == 0) hi = BIG;
       else if (domain->triclinic == 0) hi = domain->boxhi[0];
@@ -104,11 +104,11 @@ RegCone::RegCone(LAMMPS *lmp, int narg, char **arg) :
 
   // error check
 
-  if (radiuslo < 0.0) error->all("Illegal radius in region cone command");
-  if (radiushi < 0.0) error->all("Illegal radius in region cone command");
+  if (radiuslo < 0.0) error->all(FLERR,"Illegal radius in region cone command");
+  if (radiushi < 0.0) error->all(FLERR,"Illegal radius in region cone command");
   if (radiuslo == 0.0 && radiushi == 0.0)
-    error->all("Illegal radius in region cone command");
-  if (hi == lo) error->all("Illegal cone length in region cone command");
+    error->all(FLERR,"Illegal radius in region cone command");
+  if (hi == lo) error->all(FLERR,"Illegal cone length in region cone command");
 
   // extent of cone
 
diff --git a/src/region_cylinder.cpp b/src/region_cylinder.cpp
index 58bb51f212b0b39070fa6101d845b73e272a1e6b..9aafb9ca87fc3fcfd58520f73a5e0f6fefe9bad6 100644
--- a/src/region_cylinder.cpp
+++ b/src/region_cylinder.cpp
@@ -22,9 +22,6 @@ using namespace LAMMPS_NS;
 
 #define BIG 1.0e20
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) :
@@ -33,7 +30,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) :
   options(narg-8,&arg[8]);
 
   if (strcmp(arg[2],"x") && strcmp(arg[2],"y") && strcmp(arg[2],"z")) 
-    error->all("Illegal region cylinder command");
+    error->all(FLERR,"Illegal region cylinder command");
   axis = arg[2][0];
 
   if (axis == 'x') {
@@ -52,7 +49,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) :
 
   if (strcmp(arg[6],"INF") == 0 || strcmp(arg[6],"EDGE") == 0) {
     if (domain->box_exist == 0) 
-      error->all("Cannot use region INF or EDGE when box does not exist");
+      error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (axis == 'x') {
       if (strcmp(arg[6],"INF") == 0) lo = -BIG;
       else if (domain->triclinic == 0) lo = domain->boxlo[0];
@@ -76,7 +73,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) :
 
   if (strcmp(arg[7],"INF") == 0 || strcmp(arg[6],"EDGE") == 0) {
     if (domain->box_exist == 0) 
-      error->all("Cannot use region INF or EDGE when box does not exist");
+      error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (axis == 'x') {
       if (strcmp(arg[7],"INF") == 0) hi = BIG;
       else if (domain->triclinic == 0) hi = domain->boxhi[0];
@@ -100,7 +97,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) :
 
   // error check
 
-  if (radius <= 0.0) error->all("Illegal region cylinder command");
+  if (radius <= 0.0) error->all(FLERR,"Illegal region cylinder command");
 
   // extent of cylinder
 
diff --git a/src/region_intersect.cpp b/src/region_intersect.cpp
index abb959dea35b3e2e48cb9c848b045ff84a8ab329..5618b46b270adb78ac3acfcc94f52012688fc024 100644
--- a/src/region_intersect.cpp
+++ b/src/region_intersect.cpp
@@ -19,17 +19,14 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 RegIntersect::RegIntersect(LAMMPS *lmp, int narg, char **arg) :
   Region(lmp, narg, arg)
 {
-  if (narg < 5) error->all("Illegal region command");
+  if (narg < 5) error->all(FLERR,"Illegal region command");
   int n = atoi(arg[2]);
-  if (n < 2) error->all("Illegal region command");
+  if (n < 2) error->all(FLERR,"Illegal region command");
   options(narg-(n+3),&arg[n+3]);
 
   // build list of regions to intersect
@@ -40,7 +37,7 @@ RegIntersect::RegIntersect(LAMMPS *lmp, int narg, char **arg) :
   int iregion;
   for (int iarg = 0; iarg < n; iarg++) {
     iregion = domain->find_region(arg[iarg+3]);
-    if (iregion == -1) error->all("Region intersect region ID does not exist");
+    if (iregion == -1) error->all(FLERR,"Region intersect region ID does not exist");
     list[nregion++] = iregion;
   }
 
diff --git a/src/region_plane.cpp b/src/region_plane.cpp
index 45b6f103ab6198cc77c2036f30d54618c88faf4a..aa2827422dbc19a785101a4e9ba454c6836bf0c8 100644
--- a/src/region_plane.cpp
+++ b/src/region_plane.cpp
@@ -36,7 +36,7 @@ RegPlane::RegPlane(LAMMPS *lmp, int narg, char **arg) :
   // enforce unit normal
 
   double rsq = normal[0]*normal[0] + normal[1]*normal[1] + normal[2]*normal[2];
-  if (rsq == 0.0) error->all("Illegal region plane command");
+  if (rsq == 0.0) error->all(FLERR,"Illegal region plane command");
   normal[0] /= sqrt(rsq);
   normal[1] /= sqrt(rsq);
   normal[2] /= sqrt(rsq);
diff --git a/src/region_prism.cpp b/src/region_prism.cpp
index 26d65ab4f741199fbe0ce8725989e4250d0317f9..72f40987cdbb36c731686d7aed75521ba7a34822 100644
--- a/src/region_prism.cpp
+++ b/src/region_prism.cpp
@@ -27,9 +27,6 @@ using namespace LAMMPS_NS;
 
 #define BIG 1.0e20
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 RegPrism::RegPrism(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
@@ -38,42 +35,42 @@ RegPrism::RegPrism(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
 
   if (strcmp(arg[2],"INF") == 0 || strcmp(arg[2],"EDGE") == 0) {
     if (domain->box_exist == 0) 
-      error->all("Cannot use region INF or EDGE when box does not exist");
+      error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (strcmp(arg[2],"INF") == 0) xlo = -BIG;
     else xlo = domain->boxlo[0];
   } else xlo = xscale*atof(arg[2]);
 
   if (strcmp(arg[3],"INF") == 0 || strcmp(arg[3],"EDGE") == 0) {
     if (domain->box_exist == 0) 
-      error->all("Cannot use region INF or EDGE when box does not exist");
+      error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (strcmp(arg[3],"INF") == 0) xhi = BIG;
     else xhi = domain->boxhi[0];
   } else xhi = xscale*atof(arg[3]);
 
   if (strcmp(arg[4],"INF") == 0 || strcmp(arg[4],"EDGE") == 0) {
     if (domain->box_exist == 0) 
-      error->all("Cannot use region INF or EDGE when box does not exist");
+      error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (strcmp(arg[4],"INF") == 0) ylo = -BIG;
     else ylo = domain->boxlo[1];
   } else ylo = yscale*atof(arg[4]);
 
   if (strcmp(arg[5],"INF") == 0 || strcmp(arg[5],"EDGE") == 0) {
     if (domain->box_exist == 0) 
-      error->all("Cannot use region INF or EDGE when box does not exist");
+      error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (strcmp(arg[5],"INF") == 0) yhi = BIG;
     else yhi = domain->boxhi[1];
   } else yhi = yscale*atof(arg[5]);
 
   if (strcmp(arg[6],"INF") == 0 || strcmp(arg[6],"EDGE") == 0) {
     if (domain->box_exist == 0) 
-      error->all("Cannot use region INF or EDGE when box does not exist");
+      error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (strcmp(arg[6],"INF") == 0) zlo = -BIG;
     else zlo = domain->boxlo[2];
   } else zlo = zscale*atof(arg[6]);
 
   if (strcmp(arg[7],"INF") == 0 || strcmp(arg[7],"EDGE") == 0) {
     if (domain->box_exist == 0) 
-      error->all("Cannot use region INF or EDGE when box does not exist");
+      error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (strcmp(arg[7],"INF") == 0) zhi = BIG;
     else zhi = domain->boxhi[2];
   } else zhi = zscale*atof(arg[7]);
@@ -87,22 +84,22 @@ RegPrism::RegPrism(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
   // non-zero tilt values cannot be used if either dim is INF on both ends
 
   if (xlo >= xhi || ylo >= yhi || zlo >= zhi)
-    error->all("Illegal region prism command");
+    error->all(FLERR,"Illegal region prism command");
 
   if (xy != 0.0 && xlo == -BIG && xhi == BIG)
-    error->all("Illegal region prism command");
+    error->all(FLERR,"Illegal region prism command");
   if (xy != 0.0 && ylo == -BIG && yhi == BIG)
-    error->all("Illegal region prism command");
+    error->all(FLERR,"Illegal region prism command");
 
   if (xz != 0.0 && xlo == -BIG && xhi == BIG)
-    error->all("Illegal region prism command");
+    error->all(FLERR,"Illegal region prism command");
   if (xz != 0.0 && zlo == -BIG && zhi == BIG)
-    error->all("Illegal region prism command");
+    error->all(FLERR,"Illegal region prism command");
 
   if (yz != 0.0 && ylo == -BIG && yhi == BIG)
-    error->all("Illegal region prism command");
+    error->all(FLERR,"Illegal region prism command");
   if (yz != 0.0 && zlo == -BIG && zhi == BIG)
-    error->all("Illegal region prism command");
+    error->all(FLERR,"Illegal region prism command");
 
   // extent of prism
   
diff --git a/src/region_sphere.cpp b/src/region_sphere.cpp
index b03ad6bc23201eb11868c601437e0f426a30b08e..80446b55a81e2ba2157ed41135ce8104ed8172c3 100644
--- a/src/region_sphere.cpp
+++ b/src/region_sphere.cpp
@@ -33,7 +33,7 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) :
 
   // error check
 
-  if (radius < 0.0) error->all("Illegal region sphere command");
+  if (radius < 0.0) error->all(FLERR,"Illegal region sphere command");
 
   // extent of sphere
 
diff --git a/src/region_union.cpp b/src/region_union.cpp
index 90a6815cbfd1de790c1e22c234f57b00aa10e77e..ff566087efa9de199ed2779e2d571ecb3871cf0d 100644
--- a/src/region_union.cpp
+++ b/src/region_union.cpp
@@ -19,18 +19,15 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 #define BIG 1.0e20
 
 /* ---------------------------------------------------------------------- */
 
 RegUnion::RegUnion(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
 {
-  if (narg < 5) error->all("Illegal region command");
+  if (narg < 5) error->all(FLERR,"Illegal region command");
   int n = atoi(arg[2]);
-  if (n < 2) error->all("Illegal region command");
+  if (n < 2) error->all(FLERR,"Illegal region command");
   options(narg-(n+3),&arg[n+3]);
 
   // build list of regions to union
@@ -41,7 +38,7 @@ RegUnion::RegUnion(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
   int iregion;
   for (int iarg = 0; iarg < n; iarg++) {
     iregion = domain->find_region(arg[iarg+3]);
-    if (iregion == -1) error->all("Region union region ID does not exist");
+    if (iregion == -1) error->all(FLERR,"Region union region ID does not exist");
     list[nregion++] = iregion;
   }
 
diff --git a/src/replicate.cpp b/src/replicate.cpp
index b9767e424d21d1617a187e133f9e03269c9e335d..da6a662069c94900b428a6418c6022490f0e16c1 100644
--- a/src/replicate.cpp
+++ b/src/replicate.cpp
@@ -30,9 +30,6 @@ using namespace LAMMPS_NS;
 #define LB_FACTOR 1.1
 #define EPSILON   1.0e-6
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 Replicate::Replicate(LAMMPS *lmp) : Pointers(lmp) {}
@@ -44,8 +41,8 @@ void Replicate::command(int narg, char **arg)
   int i,j,m,n;
 
   if (domain->box_exist == 0)
-    error->all("Replicate command before simulation box is defined");
-  if (narg != 3) error->all("Illegal replicate command");
+    error->all(FLERR,"Replicate command before simulation box is defined");
+  if (narg != 3) error->all(FLERR,"Illegal replicate command");
 
   int me = comm->me;
   int nprocs = comm->nprocs;
@@ -61,16 +58,16 @@ void Replicate::command(int narg, char **arg)
 
   // error and warning checks
 
-  if (nx <= 0 || ny <= 0 || nz <= 0) error->all("Illegal replicate command");
+  if (nx <= 0 || ny <= 0 || nz <= 0) error->all(FLERR,"Illegal replicate command");
   if (domain->dimension == 2 && nz != 1)
-    error->all("Cannot replicate 2d simulation in z dimension");
+    error->all(FLERR,"Cannot replicate 2d simulation in z dimension");
   if ((nx > 1 && domain->xperiodic == 0) || 
       (ny > 1 && domain->yperiodic == 0) ||
       (nz > 1 && domain->zperiodic == 0)) 
-    error->warning("Replicating in a non-periodic dimension");
+    error->warning(FLERR,"Replicating in a non-periodic dimension");
 
   if (atom->nextra_grow || atom->nextra_restart || atom->nextra_store)
-    error->all("Cannot replicate with fixes that store atom quantities");
+    error->all(FLERR,"Cannot replicate with fixes that store atom quantities");
 
   // maxtag = largest atom tag across all existing atoms
 
@@ -130,7 +127,7 @@ void Replicate::command(int narg, char **arg)
   // new system cannot exceed MAXBIGINT
 
   if (atom->molecular && (nrep*old->natoms < 0 || nrep*old->natoms > MAXTAGINT))
-    error->all("Replicated molecular system atom IDs are too big");
+    error->all(FLERR,"Replicated molecular system atom IDs are too big");
   if (nrep*old->natoms < 0 || nrep*old->natoms > MAXTAGINT)
     atom->tag_enable = 0;
   if (atom->tag_enable == 0)
@@ -142,7 +139,7 @@ void Replicate::command(int narg, char **arg)
       nrep*old->nangles < 0 || nrep*old->nangles > MAXBIGINT || 
       nrep*old->ndihedrals < 0 || nrep*old->ndihedrals > MAXBIGINT || 
       nrep*old->nimpropers < 0 || nrep*old->nimpropers > MAXBIGINT)
-    error->all("Replicated system is too big");
+    error->all(FLERR,"Replicated system is too big");
 
   // assign atom and topology counts in new class from old one
 
@@ -356,7 +353,7 @@ void Replicate::command(int narg, char **arg)
   }
 
   if (natoms != atom->natoms)
-    error->all("Replicate did not assign all atoms correctly");
+    error->all(FLERR,"Replicate did not assign all atoms correctly");
   
   if (me == 0) {
     if (atom->nbonds) {
diff --git a/src/respa.cpp b/src/respa.cpp
index 83457da738465b9bd4f405565f7fc7e9f3acee2c..c283b6454cb5abb23cb8dd30db2571ac2bb33f62 100644
--- a/src/respa.cpp
+++ b/src/respa.cpp
@@ -45,16 +45,16 @@ using namespace LAMMPS_NS;
 
 Respa::Respa(LAMMPS *lmp, int narg, char **arg) : Integrate(lmp, narg, arg)
 {
-  if (narg < 1) error->all("Illegal run_style respa command");
+  if (narg < 1) error->all(FLERR,"Illegal run_style respa command");
 
   nlevels = atoi(arg[0]);
-  if (nlevels < 1) error->all("Respa levels must be >= 1");
+  if (nlevels < 1) error->all(FLERR,"Respa levels must be >= 1");
 
-  if (narg < nlevels) error->all("Illegal run_style respa command");
+  if (narg < nlevels) error->all(FLERR,"Illegal run_style respa command");
   loop = new int[nlevels];
   for (int iarg = 1; iarg < nlevels; iarg++) {
     loop[iarg-1] = atoi(arg[iarg]);
-    if (loop[iarg-1] <= 0) error->all("Illegal run_style respa command");
+    if (loop[iarg-1] <= 0) error->all(FLERR,"Illegal run_style respa command");
   }
   loop[nlevels-1] = 1;
 
@@ -68,64 +68,64 @@ Respa::Respa(LAMMPS *lmp, int narg, char **arg) : Integrate(lmp, narg, arg)
   int iarg = nlevels;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"bond") == 0) {
-      if (iarg+2 > narg) error->all("Illegal run_style respa command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
       level_bond = atoi(arg[iarg+1]) - 1;
       iarg += 2;
     } else if (strcmp(arg[iarg],"angle") == 0) {
-      if (iarg+2 > narg) error->all("Illegal run_style respa command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
       level_angle = atoi(arg[iarg+1]) - 1;
       iarg += 2;
     } else if (strcmp(arg[iarg],"dihedral") == 0) {
-      if (iarg+2 > narg) error->all("Illegal run_style respa command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
       level_dihedral = atoi(arg[iarg+1]) - 1;
       iarg += 2;
     } else if (strcmp(arg[iarg],"improper") == 0) {
-      if (iarg+2 > narg) error->all("Illegal run_style respa command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
       level_improper = atoi(arg[iarg+1]) - 1;
       iarg += 2;
     } else if (strcmp(arg[iarg],"pair") == 0) {
-      if (iarg+2 > narg) error->all("Illegal run_style respa command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
       level_pair = atoi(arg[iarg+1]) - 1;
       iarg += 2;
     } else if (strcmp(arg[iarg],"inner") == 0) {
-      if (iarg+4 > narg) error->all("Illegal run_style respa command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal run_style respa command");
       level_inner = atoi(arg[iarg+1]) - 1;
       cutoff[0] = atof(arg[iarg+2]);
       cutoff[1] = atof(arg[iarg+3]);
       iarg += 4;
     } else if (strcmp(arg[iarg],"middle") == 0) {
-      if (iarg+4 > narg) error->all("Illegal run_style respa command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal run_style respa command");
       level_middle = atoi(arg[iarg+1]) - 1;
       cutoff[2] = atof(arg[iarg+2]);
       cutoff[3] = atof(arg[iarg+3]);
       iarg += 4;
     } else if (strcmp(arg[iarg],"outer") == 0) {
-      if (iarg+2 > narg) error->all("Illegal run_style respa command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
       level_outer = atoi(arg[iarg+1]) - 1;
       iarg += 2;
     } else if (strcmp(arg[iarg],"kspace") == 0) {
-      if (iarg+2 > narg) error->all("Illegal run_style respa command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
       level_kspace = atoi(arg[iarg+1]) - 1;
       iarg += 2;
-    } else error->all("Illegal run_style respa command");
+    } else error->all(FLERR,"Illegal run_style respa command");
   }
 
   // cannot specify both pair and inner/middle/outer
 
   if (level_pair >= 0 && 
       (level_inner >= 0 || level_middle >= 0 || level_outer >= 0))
-    error->all("Cannot set both respa pair and inner/middle/outer");
+    error->all(FLERR,"Cannot set both respa pair and inner/middle/outer");
 
   // if either inner and outer is specified, then both must be
 
   if ((level_inner >= 0 && level_outer == -1) || 
       (level_outer >= 0 && level_inner == -1))
-    error->all("Must set both respa inner and outer");
+    error->all(FLERR,"Must set both respa inner and outer");
 
   // middle cannot be set without inner/outer
 
   if (level_middle >= 0 && level_inner == -1)
-    error->all("Cannot set respa middle without inner/outer");
+    error->all(FLERR,"Cannot set respa middle without inner/outer");
 
   // set defaults if user did not specify level
   // bond to innermost level
@@ -183,20 +183,20 @@ Respa::Respa(LAMMPS *lmp, int narg, char **arg) : Integrate(lmp, narg, arg)
   
   if (level_angle < level_bond || level_dihedral < level_angle ||
       level_improper < level_dihedral)
-    error->all("Invalid order of forces within respa levels");
+    error->all(FLERR,"Invalid order of forces within respa levels");
   if (level_pair >= 0) {
     if (level_pair < level_improper || level_kspace < level_pair)
-      error->all("Invalid order of forces within respa levels");
+      error->all(FLERR,"Invalid order of forces within respa levels");
   }
   if (level_pair == -1 && level_middle == -1) {
     if (level_inner < level_improper || level_outer < level_inner ||
 	level_kspace != level_outer)
-      error->all("Invalid order of forces within respa levels");
+      error->all(FLERR,"Invalid order of forces within respa levels");
   }
   if (level_pair == -1 && level_middle >= 0) {
     if (level_inner < level_improper || level_middle < level_inner ||
 	level_outer < level_inner || level_kspace != level_outer)
-      error->all("Invalid order of forces within respa levels");
+      error->all(FLERR,"Invalid order of forces within respa levels");
   }
 
   // warn if any levels are devoid of forces
@@ -207,14 +207,14 @@ Respa::Respa(LAMMPS *lmp, int narg, char **arg) : Integrate(lmp, narg, arg)
 	level_improper != i && level_pair != i && level_inner != i &&
 	level_middle != i && level_outer != i && level_kspace != i) flag = 1;
   if (flag && comm->me == 0) 
-    error->warning("One or more respa levels compute no forces");
+    error->warning(FLERR,"One or more respa levels compute no forces");
 
   // check cutoff consistency if inner/middle/outer are enabled
 
   if (level_inner >= 0 && cutoff[1] < cutoff[0])
-    error->all("Respa inner cutoffs are invalid");
+    error->all(FLERR,"Respa inner cutoffs are invalid");
   if (level_middle >= 0 && (cutoff[3] < cutoff[2] || cutoff[2] < cutoff[1]))
-    error->all("Respa middle cutoffs are invalid");
+    error->all(FLERR,"Respa middle cutoffs are invalid");
 
   // set outer pair of cutoffs to inner pair if middle is not enabled
 
@@ -247,7 +247,7 @@ void Respa::init()
   // warn if no fixes
 
   if (modify->nfix == 0 && comm->me == 0)
-    error->warning("No fixes defined, atoms won't move");
+    error->warning(FLERR,"No fixes defined, atoms won't move");
 
   // create fix needed for storing atom-based respa level forces
   // will delete it at end of run
@@ -267,7 +267,7 @@ void Respa::init()
 
   if (level_inner >= 0)
     if (force->pair && force->pair->respa_enable == 0)
-      error->all("Pair style does not support rRESPA inner/middle/outer");
+      error->all(FLERR,"Pair style does not support rRESPA inner/middle/outer");
 
   // virial_style = 1 (explicit) since never computed implicitly like Verlet
 
diff --git a/src/run.cpp b/src/run.cpp
index 667ea84a80846ffe84f89b3cfb512ce999ec816e..1f413072a04122c68962a99d7561a0850a441953 100644
--- a/src/run.cpp
+++ b/src/run.cpp
@@ -27,9 +27,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 #define MAXLINE 2048
 
 /* ---------------------------------------------------------------------- */
@@ -40,10 +37,10 @@ Run::Run(LAMMPS *lmp) : Pointers(lmp) {}
 
 void Run::command(int narg, char **arg)
 {
-  if (narg < 1) error->all("Illegal run command");
+  if (narg < 1) error->all(FLERR,"Illegal run command");
 
   if (domain->box_exist == 0)
-    error->all("Run command before simulation box is defined");
+    error->all(FLERR,"Run command before simulation box is defined");
 
   bigint nsteps_input = ATOBIGINT(arg[0]);
 
@@ -62,30 +59,30 @@ void Run::command(int narg, char **arg)
   int iarg = 1;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"upto") == 0) {
-      if (iarg+1 > narg) error->all("Illegal run command");
+      if (iarg+1 > narg) error->all(FLERR,"Illegal run command");
       uptoflag = 1;
       iarg += 1;
     } else if (strcmp(arg[iarg],"start") == 0) {
-      if (iarg+2 > narg) error->all("Illegal run command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal run command");
       startflag = 1;
       start = ATOBIGINT(arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"stop") == 0) {
-      if (iarg+2 > narg) error->all("Illegal run command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal run command");
       stopflag = 1;
       stop = ATOBIGINT(arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"pre") == 0) {
-      if (iarg+2 > narg) error->all("Illegal run command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal run command");
       if (strcmp(arg[iarg+1],"no") == 0) preflag = 0;
       else if (strcmp(arg[iarg+1],"yes") == 0) preflag = 1;
-      else error->all("Illegal run command");
+      else error->all(FLERR,"Illegal run command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"post") == 0) {
-      if (iarg+2 > narg) error->all("Illegal run command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal run command");
       if (strcmp(arg[iarg+1],"no") == 0) postflag = 0;
       else if (strcmp(arg[iarg+1],"yes") == 0) postflag = 1;
-      else error->all("Illegal run command");
+      else error->all(FLERR,"Illegal run command");
       iarg += 2;
 
       // all remaining args are commands
@@ -93,15 +90,15 @@ void Run::command(int narg, char **arg)
       // set ncommands = 0 if single command and it is NULL
 
     } else if (strcmp(arg[iarg],"every") == 0) {
-      if (iarg+3 > narg) error->all("Illegal run command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal run command");
       nevery = atoi(arg[iarg+1]);
-      if (nevery <= 0) error->all("Illegal run command");
+      if (nevery <= 0) error->all(FLERR,"Illegal run command");
       first = iarg+2;
       last = narg-1;
       ncommands = last-first + 1;
       if (ncommands == 1 && strcmp(arg[first],"NULL") == 0) ncommands = 0;
       iarg = narg;
-    } else error->all("Illegal run command");
+    } else error->all(FLERR,"Illegal run command");
   }
 
   // set nsteps as integer, using upto value if specified
@@ -109,12 +106,12 @@ void Run::command(int narg, char **arg)
   int nsteps;
   if (!uptoflag) {
     if (nsteps_input < 0 || nsteps_input > MAXSMALLINT)
-      error->all("Invalid run command N value");
+      error->all(FLERR,"Invalid run command N value");
     nsteps = static_cast<int> (nsteps_input);
   } else {
     bigint delta = nsteps_input - update->ntimestep;
     if (delta < 0 || delta > MAXSMALLINT)
-      error->all("Invalid run command upto value");
+      error->all(FLERR,"Invalid run command upto value");
     nsteps = static_cast<int> (delta);
   }
 
@@ -122,15 +119,15 @@ void Run::command(int narg, char **arg)
 
   if (startflag) {
     if (start < 0 || start > MAXBIGINT)
-      error->all("Invalid run command start/stop value");
+      error->all(FLERR,"Invalid run command start/stop value");
     if (start > update->ntimestep)
-      error->all("Run command start value is after start of run");
+      error->all(FLERR,"Run command start value is after start of run");
   }
   if (stopflag) {
     if (stop < 0 || stop > MAXBIGINT)
-      error->all("Invalid run command start/stop value");
+      error->all(FLERR,"Invalid run command start/stop value");
     if (stop < update->ntimestep + nsteps)
-      error->all("Run command stop value is before end of run");
+      error->all(FLERR,"Run command stop value is before end of run");
   }
 
   // if nevery, make copies of arg strings that are commands
@@ -161,7 +158,7 @@ void Run::command(int narg, char **arg)
     update->firststep = update->ntimestep;
     update->laststep = update->ntimestep + nsteps;
     if (update->laststep < 0 || update->laststep > MAXBIGINT)
-      error->all("Too many timesteps");
+      error->all(FLERR,"Too many timesteps");
 
     if (startflag) update->beginstep = start;
     else update->beginstep = update->firststep;
@@ -201,7 +198,7 @@ void Run::command(int narg, char **arg)
       update->firststep = update->ntimestep;
       update->laststep = update->ntimestep + nsteps;
       if (update->laststep < 0 || update->laststep > MAXBIGINT)
-	error->all("Too many timesteps");
+	error->all(FLERR,"Too many timesteps");
 
       if (startflag) update->beginstep = start;
       else update->beginstep = update->firststep;
diff --git a/src/set.cpp b/src/set.cpp
index a541fcca98fc2f5058e69b9835046fc8c4876810..be3cd5867d32cc060eab853bde69d68fe32c8ea3 100644
--- a/src/set.cpp
+++ b/src/set.cpp
@@ -52,10 +52,10 @@ Set::Set(LAMMPS *lmp) : Pointers(lmp)
 void Set::command(int narg, char **arg)
 {
   if (domain->box_exist == 0)
-    error->all("Set command before simulation box is defined");
+    error->all(FLERR,"Set command before simulation box is defined");
   if (atom->natoms == 0)
-    error->all("Set command with no atoms existing");
-  if (narg < 3) error->all("Illegal set command");
+    error->all(FLERR,"Set command with no atoms existing");
+  if (narg < 3) error->all(FLERR,"Illegal set command");
 
   // style and ID info
 
@@ -64,7 +64,7 @@ void Set::command(int narg, char **arg)
   else if (strcmp(arg[0],"type") == 0) style = TYPE_SELECT;
   else if (strcmp(arg[0],"group") == 0) style = GROUP_SELECT;
   else if (strcmp(arg[0],"region") == 0) style = REGION_SELECT;
-  else error->all("Illegal set command");
+  else error->all(FLERR,"Illegal set command");
 
   int n = strlen(arg[1]) + 1;
   id = new char[n];
@@ -84,137 +84,137 @@ void Set::command(int narg, char **arg)
     origarg = iarg;
     
     if (strcmp(arg[iarg],"type") == 0) {
-      if (iarg+2 > narg) error->all("Illegal set command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       ivalue = atoi(arg[iarg+1]);
       if (ivalue <= 0 || ivalue > atom->ntypes)
-	error->all("Invalid value in set command");
+	error->all(FLERR,"Invalid value in set command");
       set(TYPE);
       iarg += 2;
     } else if (strcmp(arg[iarg],"type/fraction") == 0) {
-      if (iarg+4 > narg) error->all("Illegal set command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal set command");
       newtype = atoi(arg[iarg+1]);
       fraction = atof(arg[iarg+2]);
       ivalue = atoi(arg[iarg+3]);
       if (newtype <= 0 || newtype > atom->ntypes)
-	error->all("Invalid value in set command");
+	error->all(FLERR,"Invalid value in set command");
       if (fraction < 0.0 || fraction > 1.0) 
-	error->all("Invalid value in set command");
-      if (ivalue <= 0) error->all("Invalid random number seed in set command");
+	error->all(FLERR,"Invalid value in set command");
+      if (ivalue <= 0) error->all(FLERR,"Invalid random number seed in set command");
       setrandom(TYPE_FRACTION);
       iarg += 4;
     } else if (strcmp(arg[iarg],"mol") == 0) {
-      if (iarg+2 > narg) error->all("Illegal set command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       ivalue = atoi(arg[iarg+1]);
       if (!atom->molecule_flag)
-	error->all("Cannot set this attribute for this atom style");
+	error->all(FLERR,"Cannot set this attribute for this atom style");
       set(MOLECULE);
       iarg += 2;
     } else if (strcmp(arg[iarg],"x") == 0) {
-      if (iarg+2 > narg) error->all("Illegal set command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       dvalue = atof(arg[iarg+1]);
       set(X);
       iarg += 2;
     } else if (strcmp(arg[iarg],"y") == 0) {
-      if (iarg+2 > narg) error->all("Illegal set command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       dvalue = atof(arg[iarg+1]);
       set(Y);
       iarg += 2;
     } else if (strcmp(arg[iarg],"z") == 0) {
-      if (iarg+2 > narg) error->all("Illegal set command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       dvalue = atof(arg[iarg+1]);
       set(Z);
       iarg += 2;
     } else if (strcmp(arg[iarg],"charge") == 0) {
-      if (iarg+2 > narg) error->all("Illegal set command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       dvalue = atof(arg[iarg+1]);
       if (!atom->q_flag)
-	error->all("Cannot set this attribute for this atom style");
+	error->all(FLERR,"Cannot set this attribute for this atom style");
       set(CHARGE);
       iarg += 2;
     } else if (strcmp(arg[iarg],"mass") == 0) {
-      if (iarg+2 > narg) error->all("Illegal set command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       dvalue = atof(arg[iarg+1]);
       if (!atom->rmass_flag)
-	error->all("Cannot set this attribute for this atom style");
-      if (dvalue <= 0.0) error->all("Invalid mass in set command");
+	error->all(FLERR,"Cannot set this attribute for this atom style");
+      if (dvalue <= 0.0) error->all(FLERR,"Invalid mass in set command");
       set(MASS);
       iarg += 2;
     } else if (strcmp(arg[iarg],"shape") == 0) {
-      if (iarg+4 > narg) error->all("Illegal set command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal set command");
       xvalue = atof(arg[iarg+1]);
       yvalue = atof(arg[iarg+2]);
       zvalue = atof(arg[iarg+3]);
       if (!atom->ellipsoid_flag)
-	error->all("Cannot set this attribute for this atom style");
+	error->all(FLERR,"Cannot set this attribute for this atom style");
       if (xvalue < 0.0 || yvalue < 0.0 || zvalue < 0.0)
-	error->all("Invalid shape in set command");
+	error->all(FLERR,"Invalid shape in set command");
       if (xvalue > 0.0 || yvalue > 0.0 || zvalue > 0.0) {
 	if (xvalue == 0.0 || yvalue == 0.0 || zvalue == 0.0)
-	  error->one("Invalid shape in set command");
+	  error->one(FLERR,"Invalid shape in set command");
       }
       set(SHAPE);
       iarg += 4;
     } else if (strcmp(arg[iarg],"dipole") == 0) {
-      if (iarg+4 > narg) error->all("Illegal set command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal set command");
       xvalue = atof(arg[iarg+1]);
       yvalue = atof(arg[iarg+2]);
       zvalue = atof(arg[iarg+3]);
       if (!atom->mu_flag)
-	error->all("Cannot set this attribute for this atom style");
+	error->all(FLERR,"Cannot set this attribute for this atom style");
       set(DIPOLE);
       iarg += 4;
     } else if (strcmp(arg[iarg],"dipole/random") == 0) {
-      if (iarg+3 > narg) error->all("Illegal set command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal set command");
       ivalue = atoi(arg[iarg+1]);
       dvalue = atof(arg[iarg+2]);
       if (!atom->mu_flag)
-	error->all("Cannot set this attribute for this atom style");
-      if (ivalue <= 0) error->all("Invalid random number seed in set command");
-      if (dvalue <= 0.0) error->all("Invalid dipole length in set command");
+	error->all(FLERR,"Cannot set this attribute for this atom style");
+      if (ivalue <= 0) error->all(FLERR,"Invalid random number seed in set command");
+      if (dvalue <= 0.0) error->all(FLERR,"Invalid dipole length in set command");
       setrandom(DIPOLE_RANDOM);
       iarg += 3;
     } else if (strcmp(arg[iarg],"quat") == 0) {
-      if (iarg+5 > narg) error->all("Illegal set command");
+      if (iarg+5 > narg) error->all(FLERR,"Illegal set command");
       xvalue = atof(arg[iarg+1]);
       yvalue = atof(arg[iarg+2]);
       zvalue = atof(arg[iarg+3]);
       wvalue = atof(arg[iarg+4]);
       if (!atom->ellipsoid_flag)
-	error->all("Cannot set this attribute for this atom style");
+	error->all(FLERR,"Cannot set this attribute for this atom style");
       set(QUAT);
       iarg += 5;
     } else if (strcmp(arg[iarg],"quat/random") == 0) {
-      if (iarg+2 > narg) error->all("Illegal set command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       ivalue = atoi(arg[iarg+1]);
       if (!atom->ellipsoid_flag)
-	error->all("Cannot set this attribute for this atom style");
-      if (ivalue <= 0) error->all("Invalid random number seed in set command");
+	error->all(FLERR,"Cannot set this attribute for this atom style");
+      if (ivalue <= 0) error->all(FLERR,"Invalid random number seed in set command");
       setrandom(QUAT_RANDOM);
       iarg += 2;
     } else if (strcmp(arg[iarg],"diameter") == 0) {
-      if (iarg+2 > narg) error->all("Illegal set command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       dvalue = atof(arg[iarg+1]);
       if (!atom->radius_flag)
-        error->all("Cannot set this attribute for this atom style");
-      if (dvalue < 0.0) error->all("Invalid diameter in set command");
+        error->all(FLERR,"Cannot set this attribute for this atom style");
+      if (dvalue < 0.0) error->all(FLERR,"Invalid diameter in set command");
       set(DIAMETER);
       iarg += 2;
     } else if (strcmp(arg[iarg],"density") == 0) {
-      if (iarg+2 > narg) error->all("Illegal set command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       dvalue = atof(arg[iarg+1]);
       if (!atom->rmass_flag)
-        error->all("Cannot set this attribute for this atom style");
+        error->all(FLERR,"Cannot set this attribute for this atom style");
       set(DENSITY);
       iarg += 2;
     } else if (strcmp(arg[iarg],"volume") == 0) {
-      if (iarg+2 > narg) error->all("Illegal set command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       dvalue = atof(arg[iarg+1]);
       if (!atom->vfrac_flag)
-        error->all("Cannot set this attribute for this atom style");
+        error->all(FLERR,"Cannot set this attribute for this atom style");
       set(VOLUME);
       iarg += 2;
     } else if (strcmp(arg[iarg],"image") == 0) {
-      if (iarg+4 > narg) error->all("Illegal set command");
+      if (iarg+4 > narg) error->all(FLERR,"Illegal set command");
       ximageflag = yimageflag = zimageflag = 0;
       if (strcmp(arg[iarg+1],"NULL") != 0) {
 	ximageflag = 1;
@@ -229,71 +229,71 @@ void Set::command(int narg, char **arg)
 	zimage = atoi(arg[iarg+3]);
       }
       if (ximageflag && ximage && !domain->xperiodic) 
-	error->all("Cannot set non-zero image flag for non-periodic dimension");
+	error->all(FLERR,"Cannot set non-zero image flag for non-periodic dimension");
       if (yimageflag && yimage && !domain->yperiodic) 
-	error->all("Cannot set non-zero image flag for non-periodic dimension");
+	error->all(FLERR,"Cannot set non-zero image flag for non-periodic dimension");
       if (zimageflag && zimage && !domain->zperiodic) 
-	error->all("Cannot set non-zero image flag for non-periodic dimension");
+	error->all(FLERR,"Cannot set non-zero image flag for non-periodic dimension");
       set(IMAGE);
       iarg += 4;
     } else if (strcmp(arg[iarg],"bond") == 0) {
-      if (iarg+2 > narg) error->all("Illegal set command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       ivalue = atoi(arg[iarg+1]);
       if (atom->avec->bonds_allow == 0)
-	error->all("Cannot set this attribute for this atom style");
+	error->all(FLERR,"Cannot set this attribute for this atom style");
       if (ivalue <= 0 || ivalue > atom->nbondtypes)
-	error->all("Invalid value in set command");
+	error->all(FLERR,"Invalid value in set command");
       topology(BOND);
       iarg += 2;
     } else if (strcmp(arg[iarg],"angle") == 0) {
-      if (iarg+2 > narg) error->all("Illegal set command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       ivalue = atoi(arg[iarg+1]);
       if (atom->avec->angles_allow == 0)
-	error->all("Cannot set this attribute for this atom style");
+	error->all(FLERR,"Cannot set this attribute for this atom style");
       if (ivalue <= 0 || ivalue > atom->nangletypes)
-	error->all("Invalid value in set command");
+	error->all(FLERR,"Invalid value in set command");
       topology(ANGLE);
       iarg += 2;
     } else if (strcmp(arg[iarg],"dihedral") == 0) {
-      if (iarg+2 > narg) error->all("Illegal set command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       ivalue = atoi(arg[iarg+1]);
       if (atom->avec->dihedrals_allow == 0)
-	error->all("Cannot set this attribute for this atom style");
+	error->all(FLERR,"Cannot set this attribute for this atom style");
       if (ivalue <= 0 || ivalue > atom->ndihedraltypes)
-	error->all("Invalid value in set command");
+	error->all(FLERR,"Invalid value in set command");
       topology(DIHEDRAL);
       iarg += 2;
     } else if (strcmp(arg[iarg],"improper") == 0) {
-      if (iarg+2 > narg) error->all("Illegal set command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       ivalue = atoi(arg[iarg+1]);
       if (atom->avec->impropers_allow == 0)
-	error->all("Cannot set this attribute for this atom style");
+	error->all(FLERR,"Cannot set this attribute for this atom style");
       if (ivalue <= 0 || ivalue > atom->nimpropertypes)
-	error->all("Invalid value in set command");
+	error->all(FLERR,"Invalid value in set command");
       topology(IMPROPER);
       iarg += 2;
     } else if (strcmp(arg[iarg],"meso_e") == 0) {
-      if (iarg+2 > narg) error->all("Illegal set command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       dvalue = atof(arg[iarg+1]);
       if (!atom->e_flag)
-	error->all("Cannot set this attribute for this atom style");
+	error->all(FLERR,"Cannot set this attribute for this atom style");
       set(MESO_E);
       iarg += 2;
     } else if (strcmp(arg[iarg],"meso_cv") == 0) {
-      if (iarg+2 > narg) error->all("Illegal set command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       dvalue = atof(arg[iarg+1]);
       if (!atom->cv_flag)
-    	error->all("Cannot set this attribute for this atom style");
+    	error->all(FLERR,"Cannot set this attribute for this atom style");
       set(MESO_CV);
       iarg += 2;
     } else if (strcmp(arg[iarg],"meso_rho") == 0) {
-      if (iarg+2 > narg) error->all("Illegal set command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       dvalue = atof(arg[iarg+1]);
       if (!atom->rho_flag)
-	error->all("Cannot set meso_rho for this atom style");
+	error->all(FLERR,"Cannot set meso_rho for this atom style");
       set(MESO_RHO);
       iarg += 2;
-    } else error->all("Illegal set command");    
+    } else error->all(FLERR,"Illegal set command");    
 
     // statistics
 
@@ -326,7 +326,7 @@ void Set::selection(int n)
 
   if (style == ATOM_SELECT) {
     if (atom->tag_enable == 0)
-      error->all("Cannot use set atom with no atom IDs defined");
+      error->all(FLERR,"Cannot use set atom with no atom IDs defined");
     force->bounds(id,BIG,nlo,nhi);
 
     int *tag = atom->tag;
@@ -336,7 +336,7 @@ void Set::selection(int n)
 
   } else if (style == MOL_SELECT) {
     if (atom->molecule_flag == 0)
-      error->all("Cannot use set mol with no molecule IDs defined");
+      error->all(FLERR,"Cannot use set mol with no molecule IDs defined");
     if (strcmp(id,"0") == 0) nlo = nhi = 0;
     else force->bounds(id,BIG,nlo,nhi);
 
@@ -355,7 +355,7 @@ void Set::selection(int n)
 
   } else if (style == GROUP_SELECT) {
     int igroup = group->find(id);
-    if (igroup == -1) error->all("Could not find set group ID");
+    if (igroup == -1) error->all(FLERR,"Could not find set group ID");
     int groupbit = group->bitmask[igroup];
 
     int *mask = atom->mask;
@@ -365,7 +365,7 @@ void Set::selection(int n)
 
   } else if (style == REGION_SELECT) {
     int iregion = domain->find_region(id);
-    if (iregion == -1) error->all("Set region ID does not exist");
+    if (iregion == -1) error->all(FLERR,"Set region ID does not exist");
 
     double **x = atom->x;
     for (int i = 0; i < n; i++)
@@ -448,7 +448,7 @@ void Set::set(int keyword)
 
     } else if (keyword == QUAT) {
       if (atom->ellipsoid[i] < 0)
-	error->one("Cannot set quaternion for atom that is not an ellipsoid");
+	error->one(FLERR,"Cannot set quaternion for atom that is not an ellipsoid");
       double *quat = avec_ellipsoid->bonus[atom->ellipsoid[i]].quat;
       double theta2 = 0.5 * PI * wvalue/180.0;
       double sintheta2 = sin(theta2);
@@ -547,7 +547,7 @@ void Set::setrandom(int keyword)
       for (i = 0; i < nlocal; i++)
 	if (select[i]) {
 	  if (ellipsoid[i] < 0)
-	    error->one("Cannot set quaternion for atom "
+	    error->one(FLERR,"Cannot set quaternion for atom "
 		       "that is not an ellipsoid");
 	  quat = bonus[ellipsoid[i]].quat;
 	  random->reset(seed,x[i]);
@@ -568,7 +568,7 @@ void Set::setrandom(int keyword)
       for (i = 0; i < nlocal; i++)
 	if (select[i]) {
 	  if (ellipsoid[i] < 0)
-	    error->one("Cannot set quaternion for atom "
+	    error->one(FLERR,"Cannot set quaternion for atom "
 		       "that is not an ellipsoid");
 	  quat = bonus[ellipsoid[i]].quat;
 	  random->reset(seed,x[i]);
@@ -618,7 +618,7 @@ void Set::topology(int keyword)
     for (int i = 0; i < nlocal; i++)
       for (m = 0; m < atom->num_bond[i]; m++) {
 	atom1 = atom->map(atom->bond_atom[i][m]);
-	if (atom1 == -1) error->one("Bond atom missing in set command");
+	if (atom1 == -1) error->one(FLERR,"Bond atom missing in set command");
 	if (select[i] && select[atom1]) {
 	  atom->bond_type[i][m] = ivalue;
 	  count++;
@@ -636,7 +636,7 @@ void Set::topology(int keyword)
 	atom2 = atom->map(atom->angle_atom2[i][m]);
 	atom3 = atom->map(atom->angle_atom3[i][m]);
 	if (atom1 == -1 || atom2 == -1 || atom3 == -1)
-	  error->one("Angle atom missing in set command");
+	  error->one(FLERR,"Angle atom missing in set command");
 	if (select[atom1] && select[atom2] && select[atom3]) {
 	  atom->angle_type[i][m] = ivalue;
 	  count++;
@@ -655,7 +655,7 @@ void Set::topology(int keyword)
 	atom3 = atom->map(atom->dihedral_atom3[i][m]);
 	atom4 = atom->map(atom->dihedral_atom4[i][m]);
 	if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1)
-	  error->one("Dihedral atom missing in set command");
+	  error->one(FLERR,"Dihedral atom missing in set command");
 	if (select[atom1] && select[atom2] && select[atom3] && select[atom4]) {
 	  atom->dihedral_type[i][m] = ivalue;
 	  count++;
@@ -674,7 +674,7 @@ void Set::topology(int keyword)
 	atom3 = atom->map(atom->improper_atom3[i][m]);
 	atom4 = atom->map(atom->improper_atom4[i][m]);
 	if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1)
-	  error->one("Improper atom missing in set command");
+	  error->one(FLERR,"Improper atom missing in set command");
 	if (select[atom1] && select[atom2] && select[atom3] && select[atom4]) {
 	  atom->improper_type[i][m] = ivalue;
 	  count++;
diff --git a/src/special.cpp b/src/special.cpp
index e0ec4ce3179f25d4bf77b177b9375d1faf57240a..189b2374fb7e088ca87680fc6ea31e17f978004c 100644
--- a/src/special.cpp
+++ b/src/special.cpp
@@ -22,9 +22,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 Special::Special(LAMMPS *lmp) : Pointers(lmp)
@@ -374,7 +371,7 @@ void Special::build()
   j = 0;
   for (i = 0; i < nlocal; i++) {
     if (buf[j+3] != nspecial[i][1])
-      error->one("1-3 bond count is inconsistent");
+      error->one(FLERR,"1-3 bond count is inconsistent");
     j += 4 + nspecial[i][0];
     for (k = 0; k < nspecial[i][1]; k++) 
       onethree[i][k] = buf[j++];
@@ -537,7 +534,7 @@ void Special::build()
   j = 0;
   for (i = 0; i < nlocal; i++) {
     if (buf[j+2] != nspecial[i][2])
-      error->one("1-4 bond count is inconsistent");
+      error->one(FLERR,"1-4 bond count is inconsistent");
     j += 3 + nspecial[i][1];
     for (k = 0; k < nspecial[i][2]; k++) 
       onefour[i][k] = buf[j++];
diff --git a/src/thermo.cpp b/src/thermo.cpp
index 1653de8f42a2b3c2cc43b6c363dfc806e9131a96..5bd877191aa5f8a12118365fbfd37bb4aa21d031 100644
--- a/src/thermo.cpp
+++ b/src/thermo.cpp
@@ -68,9 +68,6 @@ enum{SCALAR,VECTOR,ARRAY};
 #define MAXLINE 8192               // make this 4x longer than Input::MAXLINE
 #define DELTA 8
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 /* ---------------------------------------------------------------------- */
 
 Thermo::Thermo(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
@@ -103,7 +100,7 @@ Thermo::Thermo(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
     lineflag = MULTILINE;
 
   } else if (strcmp(style,"custom") == 0) {
-    if (narg == 1) error->all("Illegal thermo style custom command");
+    if (narg == 1) error->all(FLERR,"Illegal thermo style custom command");
     line[0] = '\0';
     for (int iarg = 1; iarg < narg; iarg++) {
       strcat(line,arg[iarg]);
@@ -111,7 +108,7 @@ Thermo::Thermo(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
     }
     line[strlen(line)-1] = '\0';
 
-  } else error->all("Illegal thermo style command");
+  } else error->all(FLERR,"Illegal thermo style command");
 
   // ptrs, flags, IDs for compute objects thermo may use or create
 
@@ -229,7 +226,7 @@ void Thermo::init()
   int icompute;
   for (i = 0; i < ncompute; i++) {
     icompute = modify->find_compute(id_compute[i]);
-    if (icompute < 0) error->all("Could not find thermo compute ID");
+    if (icompute < 0) error->all(FLERR,"Could not find thermo compute ID");
     computes[i] = modify->compute[icompute];
     cudable = cudable && computes[i]->cudable;
   }
@@ -240,10 +237,10 @@ void Thermo::init()
   int ifix;
   for (i = 0; i < nfix; i++) {
     ifix = modify->find_fix(id_fix[i]);
-    if (ifix < 0) error->all("Could not find thermo fix ID");
+    if (ifix < 0) error->all(FLERR,"Could not find thermo fix ID");
     fixes[i] = modify->fix[ifix];
     if (output->thermo_every % fixes[i]->global_freq)
-      error->all("Thermo and fix not computed at compatible times");
+      error->all(FLERR,"Thermo and fix not computed at compatible times");
   }
 
   // find current ptr for each Variable ID
@@ -252,7 +249,7 @@ void Thermo::init()
   for (i = 0; i < nvariable; i++) {
     ivariable = input->variable->find(id_variable[i]);
     if (ivariable < 0) 
-      error->all("Could not find thermo custom variable name");
+      error->all(FLERR,"Could not find thermo custom variable name");
     variables[i] = ivariable;
   }
 
@@ -366,7 +363,7 @@ bigint Thermo::lost_check()
   bigint ntotal;
   bigint nblocal = atom->nlocal;
   MPI_Allreduce(&nblocal,&ntotal,1,MPI_LMP_BIGINT,MPI_SUM,world);
-  if (ntotal < 0 || ntotal > MAXBIGINT) error->all("Too many total atoms");
+  if (ntotal < 0 || ntotal > MAXBIGINT) error->all(FLERR,"Too many total atoms");
   if (ntotal == atom->natoms) return ntotal;
 
   // if not checking or already warned, just return
@@ -385,7 +382,7 @@ bigint Thermo::lost_check()
     sprintf(str,
 	    "Lost atoms: original " BIGINT_FORMAT " current " BIGINT_FORMAT,
 	    atom->natoms,ntotal);
-    error->all(str);
+    error->all(FLERR,str);
   }
 
   // warning message
@@ -394,7 +391,7 @@ bigint Thermo::lost_check()
   sprintf(str,
 	  "Lost atoms: original " BIGINT_FORMAT " current " BIGINT_FORMAT,
 	  atom->natoms,ntotal);
-  if (me == 0) error->warning(str,0);
+  if (me == 0) error->warning(FLERR,str,0);
 
   // reset total atom count
 
@@ -409,25 +406,25 @@ bigint Thermo::lost_check()
 
 void Thermo::modify_params(int narg, char **arg)
 {
-  if (narg == 0) error->all("Illegal thermo_modify command");
+  if (narg == 0) error->all(FLERR,"Illegal thermo_modify command");
 
   modified = 1;
 
   int iarg = 0;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"every") == 0) {
-      if (iarg+2 > narg) error->all("Illegal thermo_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal thermo_modify command");
       if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
 	delete [] output->var_thermo;
 	int n = strlen(&arg[iarg+1][2]) + 1;
 	output->var_thermo = new char[n];
 	strcpy(output->var_thermo,&arg[iarg+1][2]);
-      } else error->all("Illegal thermo_modify command");
+      } else error->all(FLERR,"Illegal thermo_modify command");
       output->thermo_every = 0;
       iarg += 2;
     } else if (strcmp(arg[iarg],"temp") == 0) {
-      if (iarg+2 > narg) error->all("Illegal thermo_modify command");
-      if (index_temp < 0) error->all("Thermo style does not use temp");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal thermo_modify command");
+      if (index_temp < 0) error->all(FLERR,"Thermo style does not use temp");
       delete [] id_compute[index_temp];
       int n = strlen(arg[iarg+1]) + 1;
       id_compute[index_temp] = new char[n];
@@ -435,24 +432,24 @@ void Thermo::modify_params(int narg, char **arg)
 
       int icompute = modify->find_compute(arg[iarg+1]);
       if (icompute < 0) 
-	error->all("Could not find thermo_modify temperature ID");
+	error->all(FLERR,"Could not find thermo_modify temperature ID");
       temperature = modify->compute[icompute];
 
       if (temperature->tempflag == 0)
-	error->all("Thermo_modify temperature ID does not "
+	error->all(FLERR,"Thermo_modify temperature ID does not "
 		   "compute temperature");
       if (temperature->igroup != 0 && comm->me == 0)
-	error->warning("Temperature for thermo pressure is not for group all");
+	error->warning(FLERR,"Temperature for thermo pressure is not for group all");
 
       // reset id_temp of pressure to new temperature ID
       // either pressure currently being used by thermo or "thermo_press"
 
       if (index_press_scalar >= 0) {
 	icompute = modify->find_compute(id_compute[index_press_scalar]);
-	if (icompute < 0) error->all("Pressure ID for thermo does not exist");
+	if (icompute < 0) error->all(FLERR,"Pressure ID for thermo does not exist");
       } else if (index_press_vector >= 0) {
 	icompute = modify->find_compute(id_compute[index_press_vector]);
-	if (icompute < 0) error->all("Pressure ID for thermo does not exist");
+	if (icompute < 0) error->all(FLERR,"Pressure ID for thermo does not exist");
       } else icompute = modify->find_compute((char *) "thermo_press");
 
       modify->compute[icompute]->reset_extra_compute_fix(arg[iarg+1]);
@@ -460,9 +457,9 @@ void Thermo::modify_params(int narg, char **arg)
       iarg += 2;
 
     } else if (strcmp(arg[iarg],"press") == 0) {
-      if (iarg+2 > narg) error->all("Illegal thermo_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal thermo_modify command");
       if (index_press_scalar < 0 && index_press_vector < 0)
-	error->all("Thermo style does not use press");
+	error->all(FLERR,"Thermo style does not use press");
 
       if (index_press_scalar >= 0) {
 	delete [] id_compute[index_press_scalar];
@@ -478,46 +475,46 @@ void Thermo::modify_params(int narg, char **arg)
       }
 
       int icompute = modify->find_compute(arg[iarg+1]);
-      if (icompute < 0) error->all("Could not find thermo_modify pressure ID");
+      if (icompute < 0) error->all(FLERR,"Could not find thermo_modify pressure ID");
       pressure = modify->compute[icompute];
 
       if (pressure->pressflag == 0)
-	error->all("Thermo_modify pressure ID does not compute pressure");
+	error->all(FLERR,"Thermo_modify pressure ID does not compute pressure");
 
       iarg += 2;
 
     } else if (strcmp(arg[iarg],"lost") == 0) {
-      if (iarg+2 > narg) error->all("Illegal thermo_modify command");
+      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;
-      else error->all("Illegal thermo_modify command");
+      else error->all(FLERR,"Illegal thermo_modify command");
       iarg += 2;
 
     } else if (strcmp(arg[iarg],"norm") == 0) {
-      if (iarg+2 > narg) error->all("Illegal thermo_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal thermo_modify command");
       normuserflag = 1;
       if (strcmp(arg[iarg+1],"no") == 0) normuser = 0;
       else if (strcmp(arg[iarg+1],"yes") == 0) normuser = 1;
-      else error->all("Illegal thermo_modify command");
+      else error->all(FLERR,"Illegal thermo_modify command");
       iarg += 2;
 
     } else if (strcmp(arg[iarg],"flush") == 0) {
-      if (iarg+2 > narg) error->all("Illegal thermo_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal thermo_modify command");
       if (strcmp(arg[iarg+1],"no") == 0) flushflag = 0;
       else if (strcmp(arg[iarg+1],"yes") == 0) flushflag = 1;
-      else error->all("Illegal thermo_modify command");
+      else error->all(FLERR,"Illegal thermo_modify command");
       iarg += 2;
 
     } else if (strcmp(arg[iarg],"line") == 0) {
-      if (iarg+2 > narg) error->all("Illegal thermo_modify command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal thermo_modify command");
       if (strcmp(arg[iarg+1],"one") == 0) lineflag = ONELINE;
       else if (strcmp(arg[iarg+1],"multi") == 0) lineflag = MULTILINE;
-      else error->all("Illegal thermo_modify command");
+      else error->all(FLERR,"Illegal thermo_modify command");
       iarg += 2;
 
     } else if (strcmp(arg[iarg],"format") == 0) {
-      if (iarg+3 > narg) error->all("Illegal thermo_modify command");
+      if (iarg+3 > narg) error->all(FLERR,"Illegal thermo_modify command");
       if (strcmp(arg[iarg+1],"int") == 0) {
 	if (format_int_user) delete [] format_int_user;
 	int n = strlen(arg[iarg+2]) + 1;
@@ -528,7 +525,7 @@ void Thermo::modify_params(int narg, char **arg)
 	format_bigint_user = new char[n];
 	char *ptr = strchr(format_int_user,'d');
 	if (ptr == NULL) 
-	  error->all("Thermo_modify int format does not contain d character");
+	  error->all(FLERR,"Thermo_modify int format does not contain d character");
 	*ptr = '\0';
 	sprintf(format_bigint_user,"%s%s%s",format_int_user,
 		BIGINT_FORMAT,ptr+1);
@@ -541,7 +538,7 @@ void Thermo::modify_params(int narg, char **arg)
       } else {
 	int i = atoi(arg[iarg+1]) - 1;
 	if (i < 0 || i >= nfield_initial)
-	  error->all("Illegal thermo_modify command");
+	  error->all(FLERR,"Illegal thermo_modify command");
 	if (format_user[i]) delete [] format_user[i];
 	int n = strlen(arg[iarg+2]) + 1;
 	format_user[i] = new char[n];
@@ -549,7 +546,7 @@ void Thermo::modify_params(int narg, char **arg)
       }
       iarg += 3;
 
-    } else error->all("Illegal thermo_modify command");
+    } else error->all(FLERR,"Illegal thermo_modify command");
   }
 }
 
@@ -744,15 +741,15 @@ void Thermo::parse_fields(char *str)
 
     } else if (strcmp(word,"xlat") == 0) {
       if (domain->lattice == NULL) 
-	error->all("Thermo keyword requires lattice be defined");
+	error->all(FLERR,"Thermo keyword requires lattice be defined");
       addfield("Xlat",&Thermo::compute_xlat,FLOAT);
     } else if (strcmp(word,"ylat") == 0) {
       if (domain->lattice == NULL) 
-	error->all("Thermo keyword requires lattice be defined");
+	error->all(FLERR,"Thermo keyword requires lattice be defined");
       addfield("Ylat",&Thermo::compute_ylat,FLOAT);
     } else if (strcmp(word,"zlat") == 0) {
       if (domain->lattice == NULL) 
-	error->all("Thermo keyword requires lattice be defined");
+	error->all(FLERR,"Thermo keyword requires lattice be defined");
       addfield("Zlat",&Thermo::compute_zlat,FLOAT);
 
     } else if (strcmp(word,"pxx") == 0) {
@@ -823,21 +820,21 @@ void Thermo::parse_fields(char *str)
 
       if (word[0] == 'c') {
 	n = modify->find_compute(id);
-	if (n < 0) error->all("Could not find thermo custom compute ID");
+	if (n < 0) error->all(FLERR,"Could not find thermo custom compute ID");
 	if (argindex1[nfield] == 0 && modify->compute[n]->scalar_flag == 0)
-	  error->all("Thermo compute does not compute scalar");
+	  error->all(FLERR,"Thermo compute does not compute scalar");
 	if (argindex1[nfield] > 0 && argindex2[nfield] == 0) {
 	  if (modify->compute[n]->vector_flag == 0)
-	    error->all("Thermo compute does not compute vector");
+	    error->all(FLERR,"Thermo compute does not compute vector");
 	  if (argindex1[nfield] > modify->compute[n]->size_vector)
-	    error->all("Thermo compute vector is accessed out-of-range");
+	    error->all(FLERR,"Thermo compute vector is accessed out-of-range");
 	}
 	if (argindex1[nfield] > 0 && argindex2[nfield] > 0) {
 	  if (modify->compute[n]->array_flag == 0)
-	    error->all("Thermo compute does not compute array");
+	    error->all(FLERR,"Thermo compute does not compute array");
 	  if (argindex1[nfield] > modify->compute[n]->size_array_rows ||
 	      argindex2[nfield] > modify->compute[n]->size_array_cols)
-	    error->all("Thermo compute array is accessed out-of-range");
+	    error->all(FLERR,"Thermo compute array is accessed out-of-range");
 	}
 
 	if (argindex1[nfield] == 0)
@@ -850,21 +847,21 @@ void Thermo::parse_fields(char *str)
 
       } else if (word[0] == 'f') {
 	n = modify->find_fix(id);
-	if (n < 0) error->all("Could not find thermo custom fix ID");
+	if (n < 0) error->all(FLERR,"Could not find thermo custom fix ID");
 	if (argindex1[nfield] == 0 && modify->fix[n]->scalar_flag == 0)
-	  error->all("Thermo fix does not compute scalar");
+	  error->all(FLERR,"Thermo fix does not compute scalar");
 	if (argindex1[nfield] > 0 && argindex2[nfield] == 0) {
 	  if (modify->fix[n]->vector_flag == 0)
-	    error->all("Thermo fix does not compute vector");
+	    error->all(FLERR,"Thermo fix does not compute vector");
 	  if (argindex1[nfield] > modify->fix[n]->size_vector)
-	    error->all("Thermo fix vector is accessed out-of-range");
+	    error->all(FLERR,"Thermo fix vector is accessed out-of-range");
 	}
 	if (argindex1[nfield] > 0 && argindex2[nfield] > 0) {
 	  if (modify->fix[n]->array_flag == 0)
-	    error->all("Thermo fix does not compute array");
+	    error->all(FLERR,"Thermo fix does not compute array");
 	  if (argindex1[nfield] > modify->fix[n]->size_array_rows ||
 	      argindex2[nfield] > modify->fix[n]->size_array_cols)
-	    error->all("Thermo fix array is accessed out-of-range");
+	    error->all(FLERR,"Thermo fix array is accessed out-of-range");
 	}
 
 	field2index[nfield] = add_fix(id);
@@ -872,11 +869,11 @@ void Thermo::parse_fields(char *str)
 
       } else if (word[0] == 'v') {
 	n = input->variable->find(id);
-	if (n < 0) error->all("Could not find thermo custom variable name");
+	if (n < 0) error->all(FLERR,"Could not find thermo custom variable name");
 	if (input->variable->equalstyle(n) == 0)
-	  error->all("Thermo custom variable is not equal-style variable");
+	  error->all(FLERR,"Thermo custom variable is not equal-style variable");
 	if (argindex1[nfield]) 
-	  error->all("Thermo custom variable cannot be indexed");
+	  error->all(FLERR,"Thermo custom variable cannot be indexed");
 
 	field2index[nfield] = add_variable(id);
 	addfield(copy,&Thermo::compute_variable,FLOAT);
@@ -884,7 +881,7 @@ void Thermo::parse_fields(char *str)
 
       delete [] id;
 
-    } else error->all("Invalid keyword in thermo_style custom command");
+    } else error->all(FLERR,"Invalid keyword in thermo_style custom command");
 
     word = strtok(NULL," \0");
   }
@@ -974,13 +971,13 @@ int Thermo::evaluate_keyword(char *word, double *answer)
 
   } else if (strcmp(word,"elapsed") == 0) {
     if (update->whichflag == 0) 
-      error->all("This variable thermo keyword cannot be used between runs");
+      error->all(FLERR,"This variable thermo keyword cannot be used between runs");
     compute_elapsed();
     dvalue = bivalue;
 
   } else if (strcmp(word,"elaplong") == 0) {
     if (update->whichflag == 0) 
-      error->all("This variable thermo keyword cannot be used between runs");
+      error->all(FLERR,"This variable thermo keyword cannot be used between runs");
     compute_elapsed_long();
     dvalue = bivalue;
 
@@ -989,17 +986,17 @@ int Thermo::evaluate_keyword(char *word, double *answer)
 
   } else if (strcmp(word,"cpu") == 0) {
     if (update->whichflag == 0) 
-      error->all("This variable thermo keyword cannot be used between runs");
+      error->all(FLERR,"This variable thermo keyword cannot be used between runs");
     compute_cpu();
 
   } else if (strcmp(word,"tpcpu") == 0) {
     if (update->whichflag == 0) 
-      error->all("This variable thermo keyword cannot be used between runs");
+      error->all(FLERR,"This variable thermo keyword cannot be used between runs");
     compute_tpcpu();
 
   } else if (strcmp(word,"spcpu") == 0) {
     if (update->whichflag == 0) 
-      error->all("This variable thermo keyword cannot be used between runs");
+      error->all(FLERR,"This variable thermo keyword cannot be used between runs");
     compute_spcpu();
 
   } else if (strcmp(word,"atoms") == 0) {
@@ -1008,11 +1005,11 @@ int Thermo::evaluate_keyword(char *word, double *answer)
 
   } else if (strcmp(word,"temp") == 0) {
     if (!temperature)
-      error->all("Thermo keyword in variable requires "
+      error->all(FLERR,"Thermo keyword in variable requires "
 		 "thermo to use/init temp");	  
     if (update->whichflag == 0) {
       if (temperature->invoked_scalar != update->ntimestep)
-	error->all("Compute used in variable thermo keyword between runs "
+	error->all(FLERR,"Compute used in variable thermo keyword between runs "
 		   "is not current");
     } else if (!(temperature->invoked_flag & INVOKED_SCALAR)) {
       temperature->compute_scalar();
@@ -1022,11 +1019,11 @@ int Thermo::evaluate_keyword(char *word, double *answer)
     
   } else if (strcmp(word,"press") == 0) {
     if (!pressure)
-      error->all("Thermo keyword in variable requires "
+      error->all(FLERR,"Thermo keyword in variable requires "
 		 "thermo to use/init press");
     if (update->whichflag == 0) {
       if (pressure->invoked_scalar != update->ntimestep)
-	error->all("Compute used in variable thermo keyword between runs "
+	error->all(FLERR,"Compute used in variable thermo keyword between runs "
 		   "is not current");
     } else if (!(pressure->invoked_flag & INVOKED_SCALAR)) {
       pressure->compute_scalar();
@@ -1036,10 +1033,10 @@ int Thermo::evaluate_keyword(char *word, double *answer)
 
   } else if (strcmp(word,"pe") == 0) {
     if (!pe)
-      error->all("Thermo keyword in variable requires thermo to use/init pe");
+      error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
     if (update->whichflag == 0) {
       if (pe->invoked_scalar != update->ntimestep)
-	error->all("Compute used in variable thermo keyword between runs "
+	error->all(FLERR,"Compute used in variable thermo keyword between runs "
 		   "is not current");
     } else if (!(pe->invoked_flag & INVOKED_SCALAR)) {
       pe->compute_scalar();
@@ -1049,11 +1046,11 @@ int Thermo::evaluate_keyword(char *word, double *answer)
 
   } else if (strcmp(word,"ke") == 0) {
     if (!temperature)
-      error->all("Thermo keyword in variable requires "
+      error->all(FLERR,"Thermo keyword in variable requires "
 		 "thermo to use/init temp");
     if (update->whichflag == 0) {
       if (temperature->invoked_scalar != update->ntimestep)
-	error->all("Compute used in variable thermo keyword between runs "
+	error->all(FLERR,"Compute used in variable thermo keyword between runs "
 		   "is not current");
     } else if (!(temperature->invoked_flag & INVOKED_SCALAR)) {
       temperature->compute_scalar();
@@ -1063,21 +1060,21 @@ int Thermo::evaluate_keyword(char *word, double *answer)
 
   } else if (strcmp(word,"etotal") == 0) {
     if (!pe)
-      error->all("Thermo keyword in variable requires thermo to use/init pe");
+      error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
     if (update->whichflag == 0) {
       if (pe->invoked_scalar != update->ntimestep)
-	error->all("Compute used in variable thermo keyword between runs "
+	error->all(FLERR,"Compute used in variable thermo keyword between runs "
 		   "is not current");
     } else if (!(pe->invoked_flag & INVOKED_SCALAR)) {
       pe->compute_scalar();
       pe->invoked_flag |= INVOKED_SCALAR;
     }
     if (!temperature)
-      error->all("Thermo keyword in variable requires "
+      error->all(FLERR,"Thermo keyword in variable requires "
 		 "thermo to use/init temp");
     if (update->whichflag == 0) {
       if (temperature->invoked_scalar != update->ntimestep)
-	error->all("Compute used in variable thermo keyword between runs "
+	error->all(FLERR,"Compute used in variable thermo keyword between runs "
 		   "is not current");
     } else if (!(temperature->invoked_flag & INVOKED_SCALAR)) {
       temperature->compute_scalar();
@@ -1087,32 +1084,32 @@ int Thermo::evaluate_keyword(char *word, double *answer)
 
   } else if (strcmp(word,"enthalpy") == 0) {
     if (!pe)
-      error->all("Thermo keyword in variable requires thermo to use/init pe");
+      error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
     if (update->whichflag == 0) {
       if (pe->invoked_scalar != update->ntimestep)
-	error->all("Compute used in variable thermo keyword between runs "
+	error->all(FLERR,"Compute used in variable thermo keyword between runs "
 		   "is not current");
     } else if (!(pe->invoked_flag & INVOKED_SCALAR)) {
       pe->compute_scalar();
       pe->invoked_flag |= INVOKED_SCALAR;
     }
     if (!temperature)
-      error->all("Thermo keyword in variable requires "
+      error->all(FLERR,"Thermo keyword in variable requires "
 		 "thermo to use/init temp");
     if (update->whichflag == 0) {
       if (temperature->invoked_scalar != update->ntimestep)
-	error->all("Compute used in variable thermo keyword between runs "
+	error->all(FLERR,"Compute used in variable thermo keyword between runs "
 		   "is not current");
     } else if (!(temperature->invoked_flag & INVOKED_SCALAR)) {
       temperature->compute_scalar();
       temperature->invoked_flag |= INVOKED_SCALAR;
     }
     if (!pressure)
-      error->all("Thermo keyword in variable requires "
+      error->all(FLERR,"Thermo keyword in variable requires "
 		 "thermo to use/init press");
     if (update->whichflag == 0) {
       if (pressure->invoked_scalar != update->ntimestep)
-	error->all("Compute used in variable thermo keyword between runs "
+	error->all(FLERR,"Compute used in variable thermo keyword between runs "
 		   "is not current");
     } else if (!(pressure->invoked_flag & INVOKED_SCALAR)) {
       pressure->compute_scalar();
@@ -1122,81 +1119,81 @@ int Thermo::evaluate_keyword(char *word, double *answer)
 
   } else if (strcmp(word,"evdwl") == 0) {
     if (update->eflag_global != update->ntimestep)
-      error->all("Energy was not tallied on needed timestep");
+      error->all(FLERR,"Energy was not tallied on needed timestep");
     if (!pe)
-      error->all("Thermo keyword in variable requires thermo to use/init pe");
+      error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
     pe->invoked_flag |= INVOKED_SCALAR;
     compute_evdwl();
 
   } else if (strcmp(word,"ecoul") == 0) {
     if (update->eflag_global != update->ntimestep)
-      error->all("Energy was not tallied on needed timestep");
+      error->all(FLERR,"Energy was not tallied on needed timestep");
     if (!pe)
-      error->all("Thermo keyword in variable requires thermo to use/init pe");
+      error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
     pe->invoked_flag |= INVOKED_SCALAR;
     compute_ecoul();
 
   } else if (strcmp(word,"epair") == 0) {
     if (update->eflag_global != update->ntimestep)
-      error->all("Energy was not tallied on needed timestep");
+      error->all(FLERR,"Energy was not tallied on needed timestep");
     if (!pe)
-      error->all("Thermo keyword in variable requires thermo to use/init pe");
+      error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
     pe->invoked_flag |= INVOKED_SCALAR;
     compute_epair();
 
   } else if (strcmp(word,"ebond") == 0) {
     if (update->eflag_global != update->ntimestep)
-      error->all("Energy was not tallied on needed timestep");
+      error->all(FLERR,"Energy was not tallied on needed timestep");
     if (!pe)
-      error->all("Thermo keyword in variable requires thermo to use/init pe");
+      error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
     pe->invoked_flag |= INVOKED_SCALAR;
     compute_ebond();
 
   } else if (strcmp(word,"eangle") == 0) {
     if (update->eflag_global != update->ntimestep)
-      error->all("Energy was not tallied on needed timestep");
+      error->all(FLERR,"Energy was not tallied on needed timestep");
     if (!pe)
-      error->all("Thermo keyword in variable requires thermo to use/init pe");
+      error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
     pe->invoked_flag |= INVOKED_SCALAR;
     compute_eangle();
 
   } else if (strcmp(word,"edihed") == 0) {
     if (update->eflag_global != update->ntimestep)
-      error->all("Energy was not tallied on needed timestep");
+      error->all(FLERR,"Energy was not tallied on needed timestep");
     if (!pe)
-      error->all("Thermo keyword in variable requires thermo to use/init pe");
+      error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
     pe->invoked_flag |= INVOKED_SCALAR;
     compute_edihed();
 
   } else if (strcmp(word,"eimp") == 0) {
     if (update->eflag_global != update->ntimestep)
-      error->all("Energy was not tallied on needed timestep");
+      error->all(FLERR,"Energy was not tallied on needed timestep");
     if (!pe)
-      error->all("Thermo keyword in variable requires thermo to use/init pe");
+      error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
     pe->invoked_flag |= INVOKED_SCALAR;
     compute_eimp();
 
   } else if (strcmp(word,"emol") == 0) {
     if (update->eflag_global != update->ntimestep)
-      error->all("Energy was not tallied on needed timestep");
+      error->all(FLERR,"Energy was not tallied on needed timestep");
     if (!pe)
-      error->all("Thermo keyword in variable requires thermo to use/init pe");
+      error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
     pe->invoked_flag |= INVOKED_SCALAR;
     compute_emol();
 
   } else if (strcmp(word,"elong") == 0) {
     if (update->eflag_global != update->ntimestep)
-      error->all("Energy was not tallied on needed timestep");
+      error->all(FLERR,"Energy was not tallied on needed timestep");
     if (!pe)
-      error->all("Thermo keyword in variable requires thermo to use/init pe");
+      error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
     pe->invoked_flag |= INVOKED_SCALAR;
     compute_elong();
 
   } else if (strcmp(word,"etail") == 0) {
     if (update->eflag_global != update->ntimestep)
-      error->all("Energy was not tallied on needed timestep");
+      error->all(FLERR,"Energy was not tallied on needed timestep");
     if (!pe)
-      error->all("Thermo keyword in variable requires thermo to use/init pe");
+      error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
     pe->invoked_flag |= INVOKED_SCALAR;
     compute_etail();
 
@@ -1218,24 +1215,24 @@ int Thermo::evaluate_keyword(char *word, double *answer)
 
   else if (strcmp(word,"xlat") == 0) {
     if (domain->lattice == NULL) 
-      error->all("Thermo keyword in variable requires lattice be defined");
+      error->all(FLERR,"Thermo keyword in variable requires lattice be defined");
     compute_xlat();
   } else if (strcmp(word,"ylat") == 0) {
     if (domain->lattice == NULL) 
-      error->all("Thermo keyword in variable requires lattice be defined");
+      error->all(FLERR,"Thermo keyword in variable requires lattice be defined");
     compute_ylat(); 
   } else if (strcmp(word,"zlat") == 0) {
     if (domain->lattice == NULL) 
-      error->all("Thermo keyword in variable requires lattice be defined");
+      error->all(FLERR,"Thermo keyword in variable requires lattice be defined");
     compute_zlat();
 
   } else if (strcmp(word,"pxx") == 0) {
     if (!pressure)
-      error->all("Thermo keyword in variable requires "
+      error->all(FLERR,"Thermo keyword in variable requires "
 		 "thermo to use/init press");
     if (update->whichflag == 0) {
       if (pressure->invoked_vector != update->ntimestep)
-	error->all("Compute used in variable thermo keyword between runs "
+	error->all(FLERR,"Compute used in variable thermo keyword between runs "
 		   "is not current");
     } else if (!(pressure->invoked_flag & INVOKED_VECTOR)) {
       pressure->compute_vector();
@@ -1245,11 +1242,11 @@ int Thermo::evaluate_keyword(char *word, double *answer)
 
   } else if (strcmp(word,"pyy") == 0) {
     if (!pressure)
-      error->all("Thermo keyword in variable requires "
+      error->all(FLERR,"Thermo keyword in variable requires "
 		 "thermo to use/init press");
     if (update->whichflag == 0) {
       if (pressure->invoked_vector != update->ntimestep)
-	error->all("Compute used in variable thermo keyword between runs "
+	error->all(FLERR,"Compute used in variable thermo keyword between runs "
 		   "is not current");
     } else if (!(pressure->invoked_flag & INVOKED_VECTOR)) {
       pressure->compute_vector();
@@ -1259,11 +1256,11 @@ int Thermo::evaluate_keyword(char *word, double *answer)
 
   } else if (strcmp(word,"pzz") == 0) {
     if (!pressure)
-      error->all("Thermo keyword in variable requires "
+      error->all(FLERR,"Thermo keyword in variable requires "
 		 "thermo to use/init press");
     if (update->whichflag == 0) {
       if (pressure->invoked_vector != update->ntimestep)
-	error->all("Compute used in variable thermo keyword between runs "
+	error->all(FLERR,"Compute used in variable thermo keyword between runs "
 		   "is not current");
     } else if (!(pressure->invoked_flag & INVOKED_VECTOR)) {
       pressure->compute_vector();
@@ -1273,11 +1270,11 @@ int Thermo::evaluate_keyword(char *word, double *answer)
 
   } else if (strcmp(word,"pxy") == 0) {
     if (!pressure)
-      error->all("Thermo keyword in variable requires "
+      error->all(FLERR,"Thermo keyword in variable requires "
 		 "thermo to use/init press");
     if (update->whichflag == 0) {
       if (pressure->invoked_vector != update->ntimestep)
-	error->all("Compute used in variable thermo keyword between runs "
+	error->all(FLERR,"Compute used in variable thermo keyword between runs "
 		   "is not current");
     } else if (!(pressure->invoked_flag & INVOKED_VECTOR)) {
       pressure->compute_vector();
@@ -1287,11 +1284,11 @@ int Thermo::evaluate_keyword(char *word, double *answer)
 
   } else if (strcmp(word,"pxz") == 0) {
     if (!pressure)
-      error->all("Thermo keyword in variable requires "
+      error->all(FLERR,"Thermo keyword in variable requires "
 		 "thermo to use/init press");
     if (update->whichflag == 0) {
       if (pressure->invoked_vector != update->ntimestep)
-	error->all("Compute used in variable thermo keyword between runs "
+	error->all(FLERR,"Compute used in variable thermo keyword between runs "
 		   "is not current");
     } else if (!(pressure->invoked_flag & INVOKED_VECTOR)) {
       pressure->compute_vector();
@@ -1301,11 +1298,11 @@ int Thermo::evaluate_keyword(char *word, double *answer)
 
   } else if (strcmp(word,"pyz") == 0) {
     if (!pressure)
-      error->all("Thermo keyword in variable requires "
+      error->all(FLERR,"Thermo keyword in variable requires "
 		 "thermo to use/init press");
     if (update->whichflag == 0) {
       if (pressure->invoked_vector != update->ntimestep)
-	error->all("Compute used in variable thermo keyword between runs "
+	error->all(FLERR,"Compute used in variable thermo keyword between runs "
 		   "is not current");
     } else if (!(pressure->invoked_flag & INVOKED_VECTOR)) {
       pressure->compute_vector();
diff --git a/src/update.cpp b/src/update.cpp
index 947bba8c1e2602bdea7b13b3c78e35575222a352..1ac25170d9ad68191b7c77904a6236ebeaa7d706 100644
--- a/src/update.cpp
+++ b/src/update.cpp
@@ -91,10 +91,10 @@ void Update::init()
 
   if (whichflag == 1 && lmp->cuda)
     if (strstr(integrate_style,"cuda") == NULL)
-      error->all("USER-CUDA mode requires CUDA variant of run style");
+      error->all(FLERR,"USER-CUDA mode requires CUDA variant of run style");
   if (whichflag == 2 && lmp->cuda)
     if (strstr(minimize_style,"cuda") == NULL)
-      error->all("USER-CUDA mode requires CUDA variant of min style");
+      error->all(FLERR,"USER-CUDA mode requires CUDA variant of min style");
 
   // init the appropriate integrate and/or minimize class
   // if neither (e.g. from write_restart) then just return
@@ -224,7 +224,7 @@ void Update::set_units(const char *style)
     dt = 0.001;
     neighbor->skin = 2.0;
     
-  } else error->all("Illegal units command");
+  } else error->all(FLERR,"Illegal units command");
 
   delete [] unit_style;
   int n = strlen(style) + 1;
@@ -236,7 +236,7 @@ void Update::set_units(const char *style)
 
 void Update::create_integrate(int narg, char **arg, char *suffix)
 {
-  if (narg < 1) error->all("Illegal run_style command");
+  if (narg < 1) error->all(FLERR,"Illegal run_style command");
 
   delete [] integrate_style;
   delete integrate;
@@ -296,7 +296,7 @@ void Update::new_integrate(char *style, int narg, char **arg,
 #undef IntegrateStyle
 #undef INTEGRATE_CLASS
 
-    else error->all("Illegal integrate style");
+    else error->all(FLERR,"Illegal integrate style");
   }
 }
 
@@ -304,7 +304,7 @@ void Update::new_integrate(char *style, int narg, char **arg,
 
 void Update::create_minimize(int narg, char **arg)
 {
-  if (narg != 1) error->all("Illegal min_style command");
+  if (narg != 1) error->all(FLERR,"Illegal min_style command");
 
   delete [] minimize_style;
   delete minimize;
@@ -317,7 +317,7 @@ void Update::create_minimize(int narg, char **arg)
 #include "style_minimize.h"
 #undef MINIMIZE_CLASS
 
-  else error->all("Illegal min_style command");
+  else error->all(FLERR,"Illegal min_style command");
 
   int n = strlen(arg[0]) + 1;
   minimize_style = new char[n];
@@ -337,21 +337,21 @@ void Update::create_minimize(int narg, char **arg)
 
 void Update::reset_timestep(int narg, char **arg)
 {
-  if (narg != 1) error->all("Illegal reset_timestep command");
+  if (narg != 1) error->all(FLERR,"Illegal reset_timestep command");
 
   for (int i = 0; i < output->ndump; i++)
     if (output->last_dump[i] >= 0)
-      error->all("Cannot reset timestep with dump file already written to");
+      error->all(FLERR,"Cannot reset timestep with dump file already written to");
   if (output->restart && output->last_restart >= 0)
-    error->all("Cannot reset timestep with restart file already written");
+    error->all(FLERR,"Cannot reset timestep with restart file already written");
 
   for (int i = 0; i < modify->nfix; i++)
     if (modify->fix[i]->time_depend)
-      error->all("Cannot reset timestep with a time-dependent fix defined");
+      error->all(FLERR,"Cannot reset timestep with a time-dependent fix defined");
 
   for (int i = 0; i < domain->nregion; i++)
     if (domain->regions[i]->dynamic_check())
-      error->all("Cannot reset timestep with a dynamic region defined");
+      error->all(FLERR,"Cannot reset timestep with a dynamic region defined");
 
   eflag_global = vflag_global = -1;
 
@@ -367,8 +367,8 @@ void Update::reset_timestep(int narg, char **arg)
     if (modify->compute[i]->timeflag) modify->compute[i]->clearstep();
 
   ntimestep = ATOBIGINT(arg[0]);
-  if (ntimestep < 0) error->all("Timestep must be >= 0");
-  if (ntimestep > MAXBIGINT) error->all("Too big a timestep");
+  if (ntimestep < 0) error->all(FLERR,"Timestep must be >= 0");
+  if (ntimestep > MAXBIGINT) error->all(FLERR,"Too big a timestep");
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/variable.cpp b/src/variable.cpp
index b8ec5e589eb6f1ef9322537ed5897248c7035818..cab825ff4ae2f9ed1510bccdbf191395ebaba2cc 100644
--- a/src/variable.cpp
+++ b/src/variable.cpp
@@ -37,9 +37,6 @@ using namespace LAMMPS_NS;
 #define VARDELTA 4
 #define MAXLEVEL 4
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 #define MYROUND(a) (( a-floor(a) ) >= .5) ? ceil(a) : floor(a)
 
 enum{INDEX,LOOP,WORLD,UNIVERSE,ULOOP,STRING,EQUAL,ATOM};
@@ -122,13 +119,13 @@ Variable::~Variable()
 
 void Variable::set(int narg, char **arg)
 {
-  if (narg < 2) error->all("Illegal variable command");
+  if (narg < 2) error->all(FLERR,"Illegal variable command");
 
   // DELETE
   // doesn't matter if variable no longer exists
 
   if (strcmp(arg[1],"delete") == 0) {
-    if (narg != 2) error->all("Illegal variable command");
+    if (narg != 2) error->all(FLERR,"Illegal variable command");
     if (find(arg[0]) >= 0) remove(find(arg[0]));
     return;
 
@@ -136,7 +133,7 @@ void Variable::set(int narg, char **arg)
   // num = listed args, which = 1st value, data = copied args
 
   } else if (strcmp(arg[1],"index") == 0) {
-    if (narg < 3) error->all("Illegal variable command");
+    if (narg < 3) error->all(FLERR,"Illegal variable command");
     if (find(arg[0]) >= 0) return;
     if (nvar == maxvar) extend();
     style[nvar] = INDEX;
@@ -158,7 +155,7 @@ void Variable::set(int narg, char **arg)
     if (narg == 3 || (narg == 4 && strcmp(arg[3],"pad") == 0)) {
       nfirst = 1;
       nlast = atoi(arg[2]);
-      if (nlast <= 0) error->all("Illegal variable command");
+      if (nlast <= 0) error->all(FLERR,"Illegal variable command");
       if (narg == 4 && strcmp(arg[3],"pad") == 0) {
 	char digits[12];
 	sprintf(digits,"%d",nlast);
@@ -167,13 +164,13 @@ void Variable::set(int narg, char **arg)
     } else if (narg == 4 || (narg == 5 && strcmp(arg[4],"pad") == 0)) {
       nfirst = atoi(arg[2]);
       nlast = atoi(arg[3]);
-      if (nfirst > nlast || nlast <= 0) error->all("Illegal variable command");
+      if (nfirst > nlast || nlast <= 0) error->all(FLERR,"Illegal variable command");
       if (narg == 5 && strcmp(arg[4],"pad") == 0) {
 	char digits[12];
 	sprintf(digits,"%d",nlast);
 	pad[nvar] = strlen(digits);
       } else pad[nvar] = 0;
-    } else error->all("Illegal variable command");
+    } else error->all(FLERR,"Illegal variable command");
     num[nvar] = nlast;
     which[nvar] = nfirst-1;
     data[nvar] = new char*[1];
@@ -184,13 +181,13 @@ void Variable::set(int narg, char **arg)
   // error check that num = # of worlds in universe
 
   } else if (strcmp(arg[1],"world") == 0) {
-    if (narg < 3) error->all("Illegal variable command");
+    if (narg < 3) error->all(FLERR,"Illegal variable command");
     if (find(arg[0]) >= 0) return;
     if (nvar == maxvar) extend();
     style[nvar] = WORLD;
     num[nvar] = narg - 2;
     if (num[nvar] != universe->nworlds)
-      error->all("World variable count doesn't match # of partitions");
+      error->all(FLERR,"World variable count doesn't match # of partitions");
     which[nvar] = universe->iworld;
     pad[nvar] = 0;
     data[nvar] = new char*[num[nvar]];
@@ -205,7 +202,7 @@ void Variable::set(int narg, char **arg)
 
   } else if (strcmp(arg[1],"universe") == 0 || strcmp(arg[1],"uloop") == 0) {
     if (strcmp(arg[1],"universe") == 0) {
-      if (narg < 3) error->all("Illegal variable command");
+      if (narg < 3) error->all(FLERR,"Illegal variable command");
       if (find(arg[0]) >= 0) return;
       if (nvar == maxvar) extend();
       style[nvar] = UNIVERSE;
@@ -215,7 +212,7 @@ void Variable::set(int narg, char **arg)
       copy(num[nvar],&arg[2],data[nvar]);
     } else if (strcmp(arg[1],"uloop") == 0) {
       if (narg < 3 || narg > 4 || (narg == 4 && strcmp(arg[3],"pad") != 0))
-	error->all("Illegal variable command");
+	error->all(FLERR,"Illegal variable command");
       if (find(arg[0]) >= 0) return;
       if (nvar == maxvar) extend();
       style[nvar] = ULOOP;
@@ -230,7 +227,7 @@ void Variable::set(int narg, char **arg)
     }
 
     if (num[nvar] < universe->nworlds)
-      error->all("Universe/uloop variable count < # of partitions");
+      error->all(FLERR,"Universe/uloop variable count < # of partitions");
     which[nvar] = universe->iworld;
 
     if (universe->me == 0) {
@@ -242,7 +239,7 @@ void Variable::set(int narg, char **arg)
     for (int jvar = 0; jvar < nvar; jvar++)
       if (num[jvar] && (style[jvar] == UNIVERSE || style[jvar] == ULOOP) && 
 	  num[nvar] != num[jvar])
-	error->all("All universe/uloop variables must have same # of values");
+	error->all(FLERR,"All universe/uloop variables must have same # of values");
 
   // STRING
   // remove pre-existing var if also style STRING (allows it to be reset)
@@ -250,10 +247,10 @@ void Variable::set(int narg, char **arg)
   // data = 1 value, string to eval
 
   } else if (strcmp(arg[1],"string") == 0) {
-    if (narg != 3) error->all("Illegal variable command");
+    if (narg != 3) error->all(FLERR,"Illegal variable command");
     if (find(arg[0]) >= 0) {
       if (style[find(arg[0])] != STRING)
-	error->all("Cannot redefine variable as a different style");
+	error->all(FLERR,"Cannot redefine variable as a different style");
       remove(find(arg[0]));
     }
     if (nvar == maxvar) extend();
@@ -270,10 +267,10 @@ void Variable::set(int narg, char **arg)
   // data = 2 values, 1st is string to eval, 2nd is filled on retrieval
 
   } else if (strcmp(arg[1],"equal") == 0) {
-    if (narg != 3) error->all("Illegal variable command");
+    if (narg != 3) error->all(FLERR,"Illegal variable command");
     if (find(arg[0]) >= 0) {
       if (style[find(arg[0])] != EQUAL)
-	error->all("Cannot redefine variable as a different style");
+	error->all(FLERR,"Cannot redefine variable as a different style");
       remove(find(arg[0]));
     }
     if (nvar == maxvar) extend();
@@ -291,10 +288,10 @@ void Variable::set(int narg, char **arg)
   // data = 1 value, string to eval
 
   } else if (strcmp(arg[1],"atom") == 0) {
-    if (narg != 3) error->all("Illegal variable command");
+    if (narg != 3) error->all(FLERR,"Illegal variable command");
     if (find(arg[0]) >= 0) {
       if (style[find(arg[0])] != ATOM)
-	error->all("Cannot redefine variable as a different style");
+	error->all(FLERR,"Cannot redefine variable as a different style");
       remove(find(arg[0]));
     }
     if (nvar == maxvar) extend();
@@ -305,7 +302,7 @@ void Variable::set(int narg, char **arg)
     data[nvar] = new char*[num[nvar]];
     copy(1,&arg[2],data[nvar]);
     
-  } else error->all("Illegal variable command");
+  } else error->all(FLERR,"Illegal variable command");
 
   // set name of variable
   // must come at end, since STRING/EQUAL/ATOM reset may have removed name
@@ -317,7 +314,7 @@ void Variable::set(int narg, char **arg)
 
   for (int i = 0; i < n-1; i++)
     if (!isalnum(names[nvar][i]) && names[nvar][i] != '_')
-      error->all("Variable name must be alphanumeric or "
+      error->all(FLERR,"Variable name must be alphanumeric or "
 		 "underscore characters");
   nvar++;
 }
@@ -347,25 +344,25 @@ int Variable::next(int narg, char **arg)
 {
   int ivar;
 
-  if (narg == 0) error->all("Illegal next command");
+  if (narg == 0) error->all(FLERR,"Illegal next command");
 
   // check that variables exist and are all the same style
   // exception: UNIVERSE and ULOOP variables can be mixed in same next command
 
   for (int iarg = 0; iarg < narg; iarg++) {
     ivar = find(arg[iarg]);
-    if (ivar == -1) error->all("Invalid variable in next command");
+    if (ivar == -1) error->all(FLERR,"Invalid variable in next command");
     if (style[ivar] == ULOOP && style[find(arg[0])] == UNIVERSE) continue;
     else if (style[ivar] == UNIVERSE && style[find(arg[0])] == ULOOP) continue;
     else if (style[ivar] != style[find(arg[0])])
-      error->all("All variables in next command must be same style");
+      error->all(FLERR,"All variables in next command must be same style");
   }
 
   // invalid styles STRING or EQUAL or WORLD or ATOM
 
   int istyle = style[find(arg[0])];
   if (istyle == STRING || istyle == EQUAL || istyle == WORLD || istyle == ATOM)
-    error->all("Invalid variable style with next command");
+    error->all(FLERR,"Invalid variable style with next command");
 
   // increment all variables in list
   // if any variable is exhausted, set flag = 1 and remove var to allow re-use
@@ -655,7 +652,7 @@ double Variable::evaluate(char *str, Tree **tree)
     // ----------------
 
     else if (onechar == '(') {
-      if (expect == OP) error->all("Invalid syntax in variable formula");
+      if (expect == OP) error->all(FLERR,"Invalid syntax in variable formula");
       expect = OP;
 
       char *contents;
@@ -677,7 +674,7 @@ double Variable::evaluate(char *str, Tree **tree)
     // ----------------
 
     } else if (isdigit(onechar) || onechar == '.') {
-      if (expect == OP) error->all("Invalid syntax in variable formula");
+      if (expect == OP) error->all(FLERR,"Invalid syntax in variable formula");
       expect = OP;
 
       // istop = end of number, including scientific notation
@@ -712,7 +709,7 @@ double Variable::evaluate(char *str, Tree **tree)
     // ----------------
 
     } else if (isalpha(onechar)) {
-      if (expect == OP) error->all("Invalid syntax in variable formula");
+      if (expect == OP) error->all(FLERR,"Invalid syntax in variable formula");
       expect = OP;
 
       // istop = end of word
@@ -733,14 +730,14 @@ double Variable::evaluate(char *str, Tree **tree)
 
       if (strncmp(word,"c_",2) == 0) {
 	if (domain->box_exist == 0)
-	  error->all("Variable evaluation before simulation box is defined");
+	  error->all(FLERR,"Variable evaluation before simulation box is defined");
  
 	n = strlen(word) - 2 + 1;
 	char *id = new char[n];
 	strcpy(id,&word[2]);
 
 	int icompute = modify->find_compute(id);
-	if (icompute < 0) error->all("Invalid compute ID in variable formula");
+	if (icompute < 0) error->all(FLERR,"Invalid compute ID in variable formula");
 	Compute *compute = modify->compute[icompute];
 	delete [] id;
 
@@ -770,7 +767,7 @@ double Variable::evaluate(char *str, Tree **tree)
 
 	  if (update->whichflag == 0) {
 	    if (compute->invoked_scalar != update->ntimestep)
-	      error->all("Compute used in variable between runs "
+	      error->all(FLERR,"Compute used in variable between runs "
 			 "is not current");
 	  } else if (!(compute->invoked_flag & INVOKED_SCALAR)) {
 	    compute->compute_scalar();
@@ -791,11 +788,11 @@ double Variable::evaluate(char *str, Tree **tree)
 	} else if (nbracket == 1 && compute->vector_flag) {
 
 	  if (index1 > compute->size_vector)
-	    error->all("Variable formula compute vector "
+	    error->all(FLERR,"Variable formula compute vector "
 		       "is accessed out-of-range");
 	  if (update->whichflag == 0) {
 	    if (compute->invoked_vector != update->ntimestep)
-	      error->all("Compute used in variable between runs "
+	      error->all(FLERR,"Compute used in variable between runs "
 			 "is not current");
 	  } else if (!(compute->invoked_flag & INVOKED_VECTOR)) {
 	    compute->compute_vector();
@@ -816,14 +813,14 @@ double Variable::evaluate(char *str, Tree **tree)
 	} else if (nbracket == 2 && compute->array_flag) {
 
 	  if (index1 > compute->size_array_rows)
-	    error->all("Variable formula compute array "
+	    error->all(FLERR,"Variable formula compute array "
 		       "is accessed out-of-range");
 	  if (index2 > compute->size_array_cols)
-	    error->all("Variable formula compute array "
+	    error->all(FLERR,"Variable formula compute array "
 		       "is accessed out-of-range");
 	  if (update->whichflag == 0) {
 	    if (compute->invoked_array != update->ntimestep)
-	      error->all("Compute used in variable between runs "
+	      error->all(FLERR,"Compute used in variable between runs "
 			 "is not current");
 	  } else if (!(compute->invoked_flag & INVOKED_ARRAY)) {
 	    compute->compute_array();
@@ -846,7 +843,7 @@ double Variable::evaluate(char *str, Tree **tree)
 
 	  if (update->whichflag == 0) {
 	    if (compute->invoked_peratom != update->ntimestep)
-	      error->all("Compute used in variable between runs "
+	      error->all(FLERR,"Compute used in variable between runs "
 			 "is not current");
 	  } else if (!(compute->invoked_flag & INVOKED_PERATOM)) {
 	    compute->compute_peratom();
@@ -862,11 +859,11 @@ double Variable::evaluate(char *str, Tree **tree)
 		   compute->size_peratom_cols > 0) {
 
 	  if (index2 > compute->size_peratom_cols)
-	    error->all("Variable formula compute array "
+	    error->all(FLERR,"Variable formula compute array "
 		       "is accessed out-of-range");
 	  if (update->whichflag == 0) {
 	    if (compute->invoked_peratom != update->ntimestep)
-	      error->all("Compute used in variable between runs "
+	      error->all(FLERR,"Compute used in variable between runs "
 			 "is not current");
 	  } else if (!(compute->invoked_flag & INVOKED_PERATOM)) {
 	    compute->compute_peratom();
@@ -883,10 +880,10 @@ double Variable::evaluate(char *str, Tree **tree)
 		   compute->size_peratom_cols == 0) {
 
 	  if (tree == NULL)
-	    error->all("Per-atom compute in equal-style variable formula");
+	    error->all(FLERR,"Per-atom compute in equal-style variable formula");
 	  if (update->whichflag == 0) {
 	    if (compute->invoked_peratom != update->ntimestep)
-	      error->all("Compute used in variable between runs "
+	      error->all(FLERR,"Compute used in variable between runs "
 			 "is not current");
 	  } else if (!(compute->invoked_flag & INVOKED_PERATOM)) {
 	    compute->compute_peratom();
@@ -906,13 +903,13 @@ double Variable::evaluate(char *str, Tree **tree)
 		   compute->size_peratom_cols > 0) {
 
 	  if (tree == NULL)
-	    error->all("Per-atom compute in equal-style variable formula");
+	    error->all(FLERR,"Per-atom compute in equal-style variable formula");
 	  if (index1 > compute->size_peratom_cols)
-	    error->all("Variable formula compute array "
+	    error->all(FLERR,"Variable formula compute array "
 		       "is accessed out-of-range");
 	  if (update->whichflag == 0) {
 	    if (compute->invoked_peratom != update->ntimestep)
-	      error->all("Compute used in variable between runs "
+	      error->all(FLERR,"Compute used in variable between runs "
 			 "is not current");
 	  } else if (!(compute->invoked_flag & INVOKED_PERATOM)) {
 	    compute->compute_peratom();
@@ -926,7 +923,7 @@ double Variable::evaluate(char *str, Tree **tree)
 	  newtree->left = newtree->middle = newtree->right = NULL;
 	  treestack[ntreestack++] = newtree;
 
-	} else error->all("Mismatched compute in variable formula");
+	} else error->all(FLERR,"Mismatched compute in variable formula");
 
       // ----------------
       // fix
@@ -934,14 +931,14 @@ double Variable::evaluate(char *str, Tree **tree)
 
       } else if (strncmp(word,"f_",2) == 0) {
 	if (domain->box_exist == 0)
-	  error->all("Variable evaluation before simulation box is defined");
+	  error->all(FLERR,"Variable evaluation before simulation box is defined");
  
 	n = strlen(word) - 2 + 1;
 	char *id = new char[n];
 	strcpy(id,&word[2]);
 
 	int ifix = modify->find_fix(id);
-	if (ifix < 0) error->all("Invalid fix ID in variable formula");
+	if (ifix < 0) error->all(FLERR,"Invalid fix ID in variable formula");
 	Fix *fix = modify->fix[ifix];
 	delete [] id;
 
@@ -970,7 +967,7 @@ double Variable::evaluate(char *str, Tree **tree)
 	if (nbracket == 0 && fix->scalar_flag) {
 
 	  if (update->whichflag > 0 && update->ntimestep % fix->global_freq)
-	    error->all("Fix in variable not computed at compatible time");
+	    error->all(FLERR,"Fix in variable not computed at compatible time");
 
 	  value1 = fix->compute_scalar();
 	  if (tree) {
@@ -986,9 +983,9 @@ double Variable::evaluate(char *str, Tree **tree)
 	} else if (nbracket == 1 && fix->vector_flag) {
 
 	  if (index1 > fix->size_vector)
-	    error->all("Variable formula fix vector is accessed out-of-range");
+	    error->all(FLERR,"Variable formula fix vector is accessed out-of-range");
 	  if (update->whichflag > 0 && update->ntimestep % fix->global_freq)
-	    error->all("Fix in variable not computed at compatible time");
+	    error->all(FLERR,"Fix in variable not computed at compatible time");
 
 	  value1 = fix->compute_vector(index1-1);
 	  if (tree) {
@@ -1004,11 +1001,11 @@ double Variable::evaluate(char *str, Tree **tree)
 	} else if (nbracket == 2 && fix->array_flag) {
 
 	  if (index1 > fix->size_array_rows)
-	    error->all("Variable formula fix array is accessed out-of-range");
+	    error->all(FLERR,"Variable formula fix array is accessed out-of-range");
 	  if (index2 > fix->size_array_cols)
-	    error->all("Variable formula fix array is accessed out-of-range");
+	    error->all(FLERR,"Variable formula fix array is accessed out-of-range");
 	  if (update->whichflag > 0 && update->ntimestep % fix->global_freq)
-	    error->all("Fix in variable not computed at compatible time");
+	    error->all(FLERR,"Fix in variable not computed at compatible time");
 
 	  value1 = fix->compute_array(index1-1,index2-1);
 	  if (tree) {
@@ -1026,7 +1023,7 @@ double Variable::evaluate(char *str, Tree **tree)
 
 	  if (update->whichflag > 0 && 
 	      update->ntimestep % fix->peratom_freq)
-	    error->all("Fix in variable not computed at compatible time");
+	    error->all(FLERR,"Fix in variable not computed at compatible time");
 
 	  peratom2global(1,NULL,fix->vector_atom,1,index1,
 			 tree,treestack,ntreestack,argstack,nargstack);
@@ -1037,10 +1034,10 @@ double Variable::evaluate(char *str, Tree **tree)
 		   fix->size_peratom_cols > 0) {
 
 	  if (index2 > fix->size_peratom_cols)
-	    error->all("Variable formula fix array is accessed out-of-range");
+	    error->all(FLERR,"Variable formula fix array is accessed out-of-range");
 	  if (update->whichflag > 0 && 
 	      update->ntimestep % fix->peratom_freq)
-	    error->all("Fix in variable not computed at compatible time");
+	    error->all(FLERR,"Fix in variable not computed at compatible time");
 
 	  peratom2global(1,NULL,&fix->array_atom[0][index2-1],
 			 fix->size_peratom_cols,index1,
@@ -1052,10 +1049,10 @@ double Variable::evaluate(char *str, Tree **tree)
 		   fix->size_peratom_cols == 0) {
 
 	  if (tree == NULL)
-	    error->all("Per-atom fix in equal-style variable formula");
+	    error->all(FLERR,"Per-atom fix in equal-style variable formula");
 	  if (update->whichflag > 0 && 
 	      update->ntimestep % fix->peratom_freq)
-	    error->all("Fix in variable not computed at compatible time");
+	    error->all(FLERR,"Fix in variable not computed at compatible time");
 
 	  Tree *newtree = new Tree();
 	  newtree->type = ATOMARRAY;
@@ -1070,12 +1067,12 @@ double Variable::evaluate(char *str, Tree **tree)
 		   fix->size_peratom_cols > 0) {
 
 	  if (tree == NULL)
-	    error->all("Per-atom fix in equal-style variable formula");
+	    error->all(FLERR,"Per-atom fix in equal-style variable formula");
 	  if (index1 > fix->size_peratom_cols)
-	    error->all("Variable formula fix array is accessed out-of-range");
+	    error->all(FLERR,"Variable formula fix array is accessed out-of-range");
 	  if (update->whichflag > 0 && 
 	      update->ntimestep % fix->peratom_freq)
-	    error->all("Fix in variable not computed at compatible time");
+	    error->all(FLERR,"Fix in variable not computed at compatible time");
 
 	  Tree *newtree = new Tree();
 	  newtree->type = ATOMARRAY;
@@ -1085,7 +1082,7 @@ double Variable::evaluate(char *str, Tree **tree)
 	  treestack[ntreestack++] = newtree;
 
 
-	} else error->all("Mismatched fix in variable formula");
+	} else error->all(FLERR,"Mismatched fix in variable formula");
 
       // ----------------
       // variable
@@ -1097,7 +1094,7 @@ double Variable::evaluate(char *str, Tree **tree)
 	strcpy(id,&word[2]);
 
 	int ivar = find(id);
-	if (ivar < 0) error->all("Invalid variable name in variable formula");
+	if (ivar < 0) error->all(FLERR,"Invalid variable name in variable formula");
 
 	// parse zero or one trailing brackets
 	// point i beyond last bracket
@@ -1119,7 +1116,7 @@ double Variable::evaluate(char *str, Tree **tree)
 
 	  char *var = retrieve(id);
 	  if (var == NULL)
-	    error->all("Invalid variable evaluation in variable formula");
+	    error->all(FLERR,"Invalid variable evaluation in variable formula");
 	  if (tree) {
 	    Tree *newtree = new Tree();
 	    newtree->type = VALUE;
@@ -1133,7 +1130,7 @@ double Variable::evaluate(char *str, Tree **tree)
 	} else if (nbracket == 0 && style[ivar] == ATOM) {
 
 	  if (tree == NULL)
-	    error->all("Atom-style variable in equal-style variable formula");
+	    error->all(FLERR,"Atom-style variable in equal-style variable formula");
 	  Tree *newtree;
 	  evaluate(data[ivar][0],&newtree);
 	  treestack[ntreestack++] = newtree;
@@ -1151,7 +1148,7 @@ double Variable::evaluate(char *str, Tree **tree)
 			 tree,treestack,ntreestack,argstack,nargstack);
 	  memory->destroy(result);
 
-	} else error->all("Mismatched variable in variable formula");
+	} else error->all(FLERR,"Mismatched variable in variable formula");
 
 	delete [] id;
 
@@ -1177,7 +1174,7 @@ double Variable::evaluate(char *str, Tree **tree)
 				  treestack,ntreestack,argstack,nargstack));
 	  else if (special_function(word,contents,tree,
 				    treestack,ntreestack,argstack,nargstack));
-	  else error->all("Invalid math/group/special function "
+	  else error->all(FLERR,"Invalid math/group/special function "
 			  "in variable formula");
 	  delete [] contents;
 
@@ -1187,7 +1184,7 @@ double Variable::evaluate(char *str, Tree **tree)
 
 	} else if (str[i] == '[') {
 	  if (domain->box_exist == 0)
-	    error->all("Variable evaluation before simulation box is defined");
+	    error->all(FLERR,"Variable evaluation before simulation box is defined");
 
 	  ptr = &str[i];
 	  int id = int_between_brackets(ptr);
@@ -1202,7 +1199,7 @@ double Variable::evaluate(char *str, Tree **tree)
 
 	} else if (is_atom_vector(word)) {
 	  if (domain->box_exist == 0)
-	    error->all("Variable evaluation before simulation box is defined");
+	    error->all(FLERR,"Variable evaluation before simulation box is defined");
 
 	  atom_vector(word,tree,treestack,ntreestack);
 
@@ -1226,10 +1223,10 @@ double Variable::evaluate(char *str, Tree **tree)
 
 	} else {
 	  if (domain->box_exist == 0)
-	    error->all("Variable evaluation before simulation box is defined");
+	    error->all(FLERR,"Variable evaluation before simulation box is defined");
  
 	  int flag = output->thermo->evaluate_keyword(word,&value1);
-	  if (flag) error->all("Invalid thermo keyword in variable formula");
+	  if (flag) error->all(FLERR,"Invalid thermo keyword in variable formula");
 	  if (tree) {
 	    Tree *newtree = new Tree();
 	    newtree->type = VALUE;
@@ -1253,7 +1250,7 @@ double Variable::evaluate(char *str, Tree **tree)
       else if (onechar == '/') op = DIVIDE;
       else if (onechar == '^') op = CARAT;
       else if (onechar == '=') {
-	if (str[i+1] != '=') error->all("Invalid syntax in variable formula");
+	if (str[i+1] != '=') error->all(FLERR,"Invalid syntax in variable formula");
 	op = EQ;
 	i++;
       } else if (onechar == '!') {
@@ -1274,11 +1271,11 @@ double Variable::evaluate(char *str, Tree **tree)
 	  i++;
 	}
       } else if (onechar == '&') {
-	if (str[i+1] != '&') error->all("Invalid syntax in variable formula");
+	if (str[i+1] != '&') error->all(FLERR,"Invalid syntax in variable formula");
 	op = AND;
 	i++;
       } else if (onechar == '|') {
-	if (str[i+1] != '|') error->all("Invalid syntax in variable formula");
+	if (str[i+1] != '|') error->all(FLERR,"Invalid syntax in variable formula");
 	op = OR;
 	i++;
       } else op = DONE;
@@ -1294,7 +1291,7 @@ double Variable::evaluate(char *str, Tree **tree)
 	continue;
       }
 
-      if (expect == ARG) error->all("Invalid syntax in variable formula");
+      if (expect == ARG) error->all(FLERR,"Invalid syntax in variable formula");
       expect = ARG;
 
       // evaluate stack as deep as possible while respecting precedence
@@ -1328,10 +1325,10 @@ double Variable::evaluate(char *str, Tree **tree)
 	  else if (opprevious == MULTIPLY)
 	    argstack[nargstack++] = value1 * value2;
 	  else if (opprevious == DIVIDE) {
-	    if (value2 == 0.0) error->all("Divide by 0 in variable formula");
+	    if (value2 == 0.0) error->all(FLERR,"Divide by 0 in variable formula");
 	    argstack[nargstack++] = value1 / value2;
 	  } else if (opprevious == CARAT) {
-	    if (value2 == 0.0) error->all("Power by 0 in variable formula");
+	    if (value2 == 0.0) error->all(FLERR,"Power by 0 in variable formula");
 	    argstack[nargstack++] = pow(value1,value2);
 	  } else if (opprevious == UNARY) {
 	    argstack[nargstack++] = -value2;
@@ -1374,20 +1371,20 @@ double Variable::evaluate(char *str, Tree **tree)
 
       opstack[nopstack++] = op;
 
-    } else error->all("Invalid syntax in variable formula");
+    } else error->all(FLERR,"Invalid syntax in variable formula");
   }
 
-  if (nopstack) error->all("Invalid syntax in variable formula");
+  if (nopstack) error->all(FLERR,"Invalid syntax in variable formula");
 
   // for atom-style variable, return remaining tree
   // for equal-style variable, return remaining arg
 
   if (tree) {
-    if (ntreestack != 1) error->all("Invalid syntax in variable formula");
+    if (ntreestack != 1) error->all(FLERR,"Invalid syntax in variable formula");
     *tree = treestack[0];
     return 0.0;
   } else {
-    if (nargstack != 1) error->all("Invalid syntax in variable formula");
+    if (nargstack != 1) error->all(FLERR,"Invalid syntax in variable formula");
     return argstack[0];
   }
 }
@@ -1447,7 +1444,7 @@ double Variable::collapse_tree(Tree *tree)
     arg2 = collapse_tree(tree->right);
     if (tree->left->type != VALUE || tree->right->type != VALUE) return 0.0;
     tree->type = VALUE;
-    if (arg2 == 0.0) error->one("Divide by 0 in variable formula");
+    if (arg2 == 0.0) error->one(FLERR,"Divide by 0 in variable formula");
     tree->value = arg1 / arg2;
     return tree->value;
   }
@@ -1457,7 +1454,7 @@ double Variable::collapse_tree(Tree *tree)
     arg2 = collapse_tree(tree->right);
     if (tree->left->type != VALUE || tree->right->type != VALUE) return 0.0;
     tree->type = VALUE;
-    if (arg2 == 0.0) error->one("Power by 0 in variable formula");
+    if (arg2 == 0.0) error->one(FLERR,"Power by 0 in variable formula");
     tree->value = pow(arg1,arg2);
     return tree->value;
   }
@@ -1563,7 +1560,7 @@ double Variable::collapse_tree(Tree *tree)
     arg1 = collapse_tree(tree->left);
     if (tree->left->type != VALUE) return 0.0;
     tree->type = VALUE;
-    if (arg1 < 0.0) error->one("Sqrt of negative value in variable formula");
+    if (arg1 < 0.0) error->one(FLERR,"Sqrt of negative value in variable formula");
     tree->value = sqrt(arg1);
     return tree->value;
   }
@@ -1581,7 +1578,7 @@ double Variable::collapse_tree(Tree *tree)
     if (tree->left->type != VALUE) return 0.0;
     tree->type = VALUE;
     if (arg1 <= 0.0) 
-      error->one("Log of zero/negative value in variable formula");
+      error->one(FLERR,"Log of zero/negative value in variable formula");
     tree->value = log(arg1);
     return tree->value;
   }
@@ -1591,7 +1588,7 @@ double Variable::collapse_tree(Tree *tree)
     if (tree->left->type != VALUE) return 0.0;
     tree->type = VALUE;
     if (arg1 <= 0.0) 
-      error->one("Log of zero/negative value in variable formula");
+      error->one(FLERR,"Log of zero/negative value in variable formula");
     tree->value = log10(arg1);
     return tree->value;
   }
@@ -1625,7 +1622,7 @@ double Variable::collapse_tree(Tree *tree)
     if (tree->left->type != VALUE) return 0.0;
     tree->type = VALUE;
     if (arg1 < -1.0 || arg1 > 1.0)
-      error->one("Arcsin of invalid value in variable formula");
+      error->one(FLERR,"Arcsin of invalid value in variable formula");
     tree->value = asin(arg1);
     return tree->value;
   }
@@ -1635,7 +1632,7 @@ double Variable::collapse_tree(Tree *tree)
     if (tree->left->type != VALUE) return 0.0;
     tree->type = VALUE;
     if (arg1 < -1.0 || arg1 > 1.0)
-      error->one("Arccos of invalid value in variable formula");
+      error->one(FLERR,"Arccos of invalid value in variable formula");
     tree->value = acos(arg1);
     return tree->value;
   }
@@ -1664,7 +1661,7 @@ double Variable::collapse_tree(Tree *tree)
     collapse_tree(tree->middle);
     if (randomatom == NULL) {
       int seed = static_cast<int> (collapse_tree(tree->right));
-      if (seed <= 0) error->one("Invalid math function in variable formula");
+      if (seed <= 0) error->one(FLERR,"Invalid math function in variable formula");
       randomatom = new RanMars(lmp,seed+me);
     }
     return 0.0;
@@ -1673,10 +1670,10 @@ double Variable::collapse_tree(Tree *tree)
   if (tree->type == NORMAL) {
     collapse_tree(tree->left);
     double sigma = collapse_tree(tree->middle);
-    if (sigma < 0.0) error->one("Invalid math function in variable formula");
+    if (sigma < 0.0) error->one(FLERR,"Invalid math function in variable formula");
     if (randomatom == NULL) {
       int seed = static_cast<int> (collapse_tree(tree->right));
-      if (seed <= 0) error->one("Invalid math function in variable formula");
+      if (seed <= 0) error->one(FLERR,"Invalid math function in variable formula");
       randomatom = new RanMars(lmp,seed+me);
     }
     return 0.0;
@@ -1723,7 +1720,7 @@ double Variable::collapse_tree(Tree *tree)
     if (tree->left->type != VALUE || tree->right->type != VALUE) return 0.0;
     tree->type = VALUE;
     if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue1 <= ivalue2)
-      error->one("Invalid math function in variable formula");
+      error->one(FLERR,"Invalid math function in variable formula");
     int lower = update->ntimestep/ivalue1 * ivalue1;
     int delta = update->ntimestep - lower;
     if (delta < ivalue2) tree->value = lower+ivalue2;
@@ -1739,7 +1736,7 @@ double Variable::collapse_tree(Tree *tree)
 	tree->right->type != VALUE) return 0.0;
     tree->type = VALUE;
     if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0 || ivalue2 >= ivalue3)
-      error->one("Invalid math function in variable formula");
+      error->one(FLERR,"Invalid math function in variable formula");
     if (update->ntimestep < ivalue1) tree->value = ivalue1;
     else {
       int lower = ivalue1;
@@ -1768,7 +1765,7 @@ double Variable::collapse_tree(Tree *tree)
     if (tree->left->type != VALUE || tree->middle->type != VALUE ||
 	tree->right->type != VALUE) return 0.0;
     tree->type = VALUE;
-    if (arg3 == 0.0) error->one("Invalid math function in variable formula");
+    if (arg3 == 0.0) error->one(FLERR,"Invalid math function in variable formula");
     double delta = update->ntimestep - update->beginstep;
     double omega = 2.0*PI/arg3;
     tree->value = arg1 + arg2*sin(omega*delta*update->dt);
@@ -1782,7 +1779,7 @@ double Variable::collapse_tree(Tree *tree)
     if (tree->left->type != VALUE || tree->middle->type != VALUE ||
 	tree->right->type != VALUE) return 0.0;
     tree->type = VALUE;
-    if (arg3 == 0.0) error->one("Invalid math function in variable formula");
+    if (arg3 == 0.0) error->one(FLERR,"Invalid math function in variable formula");
     double delta = update->ntimestep - update->beginstep;
     double omega = 2.0*PI/arg3;
     tree->value = arg1 + arg2*(1.0-cos(omega*delta*update->dt));
@@ -1826,12 +1823,12 @@ double Variable::eval_tree(Tree *tree, int i)
     return eval_tree(tree->left,i) * eval_tree(tree->right,i);
   if (tree->type == DIVIDE) {
     double denom = eval_tree(tree->right,i);
-    if (denom == 0.0) error->one("Divide by 0 in variable formula");
+    if (denom == 0.0) error->one(FLERR,"Divide by 0 in variable formula");
     return eval_tree(tree->left,i) / denom;
   }
   if (tree->type == CARAT) {
     double exponent = eval_tree(tree->right,i);
-    if (exponent == 0.0) error->one("Power by 0 in variable formula");
+    if (exponent == 0.0) error->one(FLERR,"Power by 0 in variable formula");
     return pow(eval_tree(tree->left,i),exponent);
   }
   if (tree->type == UNARY) return -eval_tree(tree->left,i);
@@ -1877,7 +1874,7 @@ double Variable::eval_tree(Tree *tree, int i)
 
   if (tree->type == SQRT) {
     arg1 = eval_tree(tree->left,i);
-    if (arg1 < 0.0) error->one("Sqrt of negative value in variable formula");
+    if (arg1 < 0.0) error->one(FLERR,"Sqrt of negative value in variable formula");
     return sqrt(arg1);
   }
   if (tree->type == EXP)
@@ -1885,13 +1882,13 @@ double Variable::eval_tree(Tree *tree, int i)
   if (tree->type == LN) {
     arg1 = eval_tree(tree->left,i);
     if (arg1 <= 0.0) 
-      error->one("Log of zero/negative value in variable formula");
+      error->one(FLERR,"Log of zero/negative value in variable formula");
     return log(arg1);
   }
   if (tree->type == LOG) {
     arg1 = eval_tree(tree->left,i);
     if (arg1 <= 0.0) 
-      error->one("Log of zero/negative value in variable formula");
+      error->one(FLERR,"Log of zero/negative value in variable formula");
     return log10(arg1);
   }
 
@@ -1905,13 +1902,13 @@ double Variable::eval_tree(Tree *tree, int i)
   if (tree->type == ASIN) {
     arg1 = eval_tree(tree->left,i);
     if (arg1 < -1.0 || arg1 > 1.0)
-      error->one("Arcsin of invalid value in variable formula");
+      error->one(FLERR,"Arcsin of invalid value in variable formula");
     return asin(arg1);
   }
   if (tree->type == ACOS) {
     arg1 = eval_tree(tree->left,i);
     if (arg1 < -1.0 || arg1 > 1.0)
-      error->one("Arccos of invalid value in variable formula");
+      error->one(FLERR,"Arccos of invalid value in variable formula");
     return acos(arg1);
   }
   if (tree->type == ATAN)
@@ -1924,7 +1921,7 @@ double Variable::eval_tree(Tree *tree, int i)
     double upper = eval_tree(tree->middle,i);
     if (randomatom == NULL) {
       int seed = static_cast<int> (eval_tree(tree->right,i));
-      if (seed <= 0) error->one("Invalid math function in variable formula");
+      if (seed <= 0) error->one(FLERR,"Invalid math function in variable formula");
       randomatom = new RanMars(lmp,seed+me);
     }
     return randomatom->uniform()*(upper-lower)+lower;
@@ -1932,10 +1929,10 @@ double Variable::eval_tree(Tree *tree, int i)
   if (tree->type == NORMAL) {
     double mu = eval_tree(tree->left,i);
     double sigma = eval_tree(tree->middle,i);
-    if (sigma < 0.0) error->one("Invalid math function in variable formula");
+    if (sigma < 0.0) error->one(FLERR,"Invalid math function in variable formula");
     if (randomatom == NULL) {
       int seed = static_cast<int> (eval_tree(tree->right,i));
-      if (seed <= 0) error->one("Invalid math function in variable formula");
+      if (seed <= 0) error->one(FLERR,"Invalid math function in variable formula");
       randomatom = new RanMars(lmp,seed+me);
     }
     return mu + sigma*randomatom->gaussian();
@@ -1961,7 +1958,7 @@ double Variable::eval_tree(Tree *tree, int i)
     int ivalue1 = static_cast<int> (eval_tree(tree->left,i));
     int ivalue2 = static_cast<int> (eval_tree(tree->right,i));
     if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue1 <= ivalue2)
-      error->one("Invalid math function in variable formula");
+      error->one(FLERR,"Invalid math function in variable formula");
     int lower = update->ntimestep/ivalue1 * ivalue1;
     int delta = update->ntimestep - lower;
     if (delta < ivalue2) arg = lower+ivalue2;
@@ -1974,7 +1971,7 @@ double Variable::eval_tree(Tree *tree, int i)
     int ivalue2 = static_cast<int> (eval_tree(tree->middle,i));
     int ivalue3 = static_cast<int> (eval_tree(tree->right,i));
     if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0 || ivalue2 >= ivalue3)
-      error->one("Invalid math function in variable formula");
+      error->one(FLERR,"Invalid math function in variable formula");
     if (update->ntimestep < ivalue1) arg = ivalue1;
     else {
       int lower = ivalue1;
@@ -1998,7 +1995,7 @@ double Variable::eval_tree(Tree *tree, int i)
     arg1 = eval_tree(tree->left,i);
     arg2 = eval_tree(tree->middle,i);
     arg3 = eval_tree(tree->right,i);
-    if (arg3 == 0.0) error->one("Invalid math function in variable formula");
+    if (arg3 == 0.0) error->one(FLERR,"Invalid math function in variable formula");
     double delta = update->ntimestep - update->beginstep;
     double omega = 2.0*PI/arg3;
     arg = arg1 + arg2*sin(omega*delta*update->dt);
@@ -2009,7 +2006,7 @@ double Variable::eval_tree(Tree *tree, int i)
     arg1 = eval_tree(tree->left,i);
     arg2 = eval_tree(tree->middle,i);
     arg3 = eval_tree(tree->right,i);
-    if (arg3 == 0.0) error->one("Invalid math function in variable formula");
+    if (arg3 == 0.0) error->one(FLERR,"Invalid math function in variable formula");
     double delta = update->ntimestep - update->beginstep;
     double omega = 2.0*PI/arg3;
     arg = arg1 + arg2*(1.0-cos(omega*delta*update->dt));
@@ -2068,7 +2065,7 @@ int Variable::find_matching_paren(char *str, int i,char *&contents)
     else if (str[i] == ')' && ilevel) ilevel--;
     else if (str[i] == ')') break;
   }
-  if (!str[i]) error->all("Invalid syntax in variable formula");
+  if (!str[i]) error->all(FLERR,"Invalid syntax in variable formula");
   int istop = i;
 
   int n = istop - istart - 1;
@@ -2093,19 +2090,19 @@ int Variable::int_between_brackets(char *&ptr)
 
   while (*ptr && *ptr != ']') {
     if (!isdigit(*ptr)) 
-      error->all("Non digit character between brackets in variable");
+      error->all(FLERR,"Non digit character between brackets in variable");
     ptr++;
   }
 
-  if (*ptr != ']') error->all("Mismatched brackets in variable");
-  if (ptr == start) error->all("Empty brackets in variable");
+  if (*ptr != ']') error->all(FLERR,"Mismatched brackets in variable");
+  if (ptr == start) error->all(FLERR,"Empty brackets in variable");
 
   *ptr = '\0';
   int index = atoi(start);
   *ptr = ']';
 
   if (index == 0) 
-    error->all("Index between variable brackets must be positive");
+    error->all(FLERR,"Index between variable brackets must be positive");
   return index;
 }
 
@@ -2212,117 +2209,117 @@ int Variable::math_function(char *word, char *contents, Tree **tree,
   }
     
   if (strcmp(word,"sqrt") == 0) {
-    if (narg != 1) error->all("Invalid math function in variable formula");
+    if (narg != 1) error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = SQRT;
     else {
       if (value1 < 0.0) 
-	error->all("Sqrt of negative value in variable formula");
+	error->all(FLERR,"Sqrt of negative value in variable formula");
       argstack[nargstack++] = sqrt(value1);
     }
 
   } else if (strcmp(word,"exp") == 0) {
-    if (narg != 1) error->all("Invalid math function in variable formula");
+    if (narg != 1) error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = EXP;
     else argstack[nargstack++] = exp(value1);
   } else if (strcmp(word,"ln") == 0) {
-    if (narg != 1) error->all("Invalid math function in variable formula");
+    if (narg != 1) error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = LN;
     else {
       if (value1 <= 0.0) 
-	error->all("Log of zero/negative value in variable formula");
+	error->all(FLERR,"Log of zero/negative value in variable formula");
       argstack[nargstack++] = log(value1);
     }
   } else if (strcmp(word,"log") == 0) {
-    if (narg != 1) error->all("Invalid math function in variable formula");
+    if (narg != 1) error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = LOG;
     else {
       if (value1 <= 0.0) 
-	error->all("Log of zero/negative value in variable formula");
+	error->all(FLERR,"Log of zero/negative value in variable formula");
       argstack[nargstack++] = log10(value1);
     }
 
   } else if (strcmp(word,"sin") == 0) {
-    if (narg != 1) error->all("Invalid math function in variable formula");
+    if (narg != 1) error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = SIN;
     else argstack[nargstack++] = sin(value1);
   } else if (strcmp(word,"cos") == 0) {
-    if (narg != 1) error->all("Invalid math function in variable formula");
+    if (narg != 1) error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = COS;
     else argstack[nargstack++] = cos(value1);
   } else if (strcmp(word,"tan") == 0) {
-    if (narg != 1) error->all("Invalid math function in variable formula");
+    if (narg != 1) error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = TAN;
     else argstack[nargstack++] = tan(value1);
 
   } else if (strcmp(word,"asin") == 0) {
-    if (narg != 1) error->all("Invalid math function in variable formula");
+    if (narg != 1) error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = ASIN;
     else {
       if (value1 < -1.0 || value1 > 1.0) 
-	error->all("Arcsin of invalid value in variable formula");
+	error->all(FLERR,"Arcsin of invalid value in variable formula");
       argstack[nargstack++] = asin(value1);
     }
   } else if (strcmp(word,"acos") == 0) {
-    if (narg != 1) error->all("Invalid math function in variable formula");
+    if (narg != 1) error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = ACOS;
     else {
       if (value1 < -1.0 || value1 > 1.0) 
-	error->all("Arccos of invalid value in variable formula");
+	error->all(FLERR,"Arccos of invalid value in variable formula");
       argstack[nargstack++] = acos(value1);
     }
   } else if (strcmp(word,"atan") == 0) {
-    if (narg != 1) error->all("Invalid math function in variable formula");
+    if (narg != 1) error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = ATAN;
     else argstack[nargstack++] = atan(value1);
   } else if (strcmp(word,"atan2") == 0) {
-    if (narg != 2) error->all("Invalid math function in variable formula");
+    if (narg != 2) error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = ATAN2;
     else argstack[nargstack++] = atan2(value1,value2);
 
   } else if (strcmp(word,"random") == 0) {
-    if (narg != 3) error->all("Invalid math function in variable formula");
+    if (narg != 3) error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = RANDOM;
     else {
       if (randomequal == NULL) {
 	int seed = static_cast<int> (value3);
-	if (seed <= 0) error->all("Invalid math function in variable formula");
+	if (seed <= 0) error->all(FLERR,"Invalid math function in variable formula");
 	randomequal = new RanMars(lmp,seed);
       }
       argstack[nargstack++] = randomequal->uniform()*(value2-value1) + value1;
     }
   } else if (strcmp(word,"normal") == 0) {
-    if (narg != 3) error->all("Invalid math function in variable formula");
+    if (narg != 3) error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = NORMAL;
     else {
       if (value2 < 0.0) 
-	error->all("Invalid math function in variable formula");
+	error->all(FLERR,"Invalid math function in variable formula");
       if (randomequal == NULL) {
 	int seed = static_cast<int> (value3);
-	if (seed <= 0) error->all("Invalid math function in variable formula");
+	if (seed <= 0) error->all(FLERR,"Invalid math function in variable formula");
 	randomequal = new RanMars(lmp,seed);
       }
       argstack[nargstack++] = value1 + value2*randomequal->gaussian();
     }
 
   } else if (strcmp(word,"ceil") == 0) {
-    if (narg != 1) error->all("Invalid math function in variable formula");
+    if (narg != 1) error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = CEIL;
     else argstack[nargstack++] = ceil(value1);
 
   } else if (strcmp(word,"floor") == 0) {
-    if (narg != 1) error->all("Invalid math function in variable formula");
+    if (narg != 1) error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = FLOOR;
     else argstack[nargstack++] = floor(value1);
 
   } else if (strcmp(word,"round") == 0) {
-    if (narg != 1) error->all("Invalid math function in variable formula");
+    if (narg != 1) error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = ROUND;
     else argstack[nargstack++] = MYROUND(value1);
 
   } else if (strcmp(word,"ramp") == 0) {
-    if (narg != 2) error->all("Invalid math function in variable formula");
+    if (narg != 2) error->all(FLERR,"Invalid math function in variable formula");
     if (update->whichflag == 0)
-      error->all("Cannot use ramp in variable formula between runs");
+      error->all(FLERR,"Cannot use ramp in variable formula between runs");
     if (tree) newtree->type = RAMP;
     else {
       double delta = update->ntimestep - update->beginstep;
@@ -2332,13 +2329,13 @@ int Variable::math_function(char *word, char *contents, Tree **tree,
     }
 
   } else if (strcmp(word,"stagger") == 0) {
-    if (narg != 2) error->all("Invalid math function in variable formula");
+    if (narg != 2) error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = STAGGER;
     else {
       int ivalue1 = static_cast<int> (value1);
       int ivalue2 = static_cast<int> (value2);
       if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue1 <= ivalue2)
-	error->all("Invalid math function in variable formula");
+	error->all(FLERR,"Invalid math function in variable formula");
       int lower = update->ntimestep/ivalue1 * ivalue1;
       int delta = update->ntimestep - lower;
       double value;
@@ -2348,14 +2345,14 @@ int Variable::math_function(char *word, char *contents, Tree **tree,
     }
 
   } else if (strcmp(word,"logfreq") == 0) {
-    if (narg != 3) error->all("Invalid math function in variable formula");
+    if (narg != 3) error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = LOGFREQ;
     else {
       int ivalue1 = static_cast<int> (value1);
       int ivalue2 = static_cast<int> (value2);
       int ivalue3 = static_cast<int> (value3);
       if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0 || ivalue2 >= ivalue3)
-	error->all("Invalid math function in variable formula");
+	error->all(FLERR,"Invalid math function in variable formula");
       double value;
       if (update->ntimestep < ivalue1) value = ivalue1;
       else {
@@ -2369,9 +2366,9 @@ int Variable::math_function(char *word, char *contents, Tree **tree,
     }
 
   } else if (strcmp(word,"vdisplace") == 0) {
-    if (narg != 2) error->all("Invalid math function in variable formula");
+    if (narg != 2) error->all(FLERR,"Invalid math function in variable formula");
     if (update->whichflag == 0)
-      error->all("Cannot use vdisplace in variable formula between runs");
+      error->all(FLERR,"Cannot use vdisplace in variable formula between runs");
     if (tree) newtree->type = VDISPLACE;
     else {
       double delta = update->ntimestep - update->beginstep;
@@ -2380,13 +2377,13 @@ int Variable::math_function(char *word, char *contents, Tree **tree,
     }
 
   } else if (strcmp(word,"swiggle") == 0) {
-    if (narg != 3) error->all("Invalid math function in variable formula");
+    if (narg != 3) error->all(FLERR,"Invalid math function in variable formula");
     if (update->whichflag == 0)
-      error->all("Cannot use swiggle in variable formula between runs");
+      error->all(FLERR,"Cannot use swiggle in variable formula between runs");
     if (tree) newtree->type = CWIGGLE;
     else {
       if (value3 == 0.0)
-	error->all("Invalid math function in variable formula");
+	error->all(FLERR,"Invalid math function in variable formula");
       double delta = update->ntimestep - update->beginstep;
       double omega = 2.0*PI/value3;
       double value = value1 + value2*sin(omega*delta*update->dt);
@@ -2394,13 +2391,13 @@ int Variable::math_function(char *word, char *contents, Tree **tree,
     }
 
   } else if (strcmp(word,"cwiggle") == 0) {
-    if (narg != 3) error->all("Invalid math function in variable formula");
+    if (narg != 3) error->all(FLERR,"Invalid math function in variable formula");
     if (update->whichflag == 0)
-      error->all("Cannot use cwiggle in variable formula between runs");
+      error->all(FLERR,"Cannot use cwiggle in variable formula between runs");
     if (tree) newtree->type = CWIGGLE;
     else {
       if (value3 == 0.0)
-	error->all("Invalid math function in variable formula");
+	error->all(FLERR,"Invalid math function in variable formula");
       double delta = update->ntimestep - update->beginstep;
       double omega = 2.0*PI/value3;
       double value = value1 + value2*(1.0-cos(omega*delta*update->dt));
@@ -2477,7 +2474,7 @@ int Variable::group_function(char *word, char *contents, Tree **tree,
 
   int igroup = group->find(arg1);
   if (igroup == -1)
-    error->all("Group ID in variable formula does not exist");
+    error->all(FLERR,"Group ID in variable formula does not exist");
 
   // match word to group function
 
@@ -2486,17 +2483,17 @@ int Variable::group_function(char *word, char *contents, Tree **tree,
   if (strcmp(word,"count") == 0) {
     if (narg == 1) value = group->count(igroup);
     else if (narg == 2) value = group->count(igroup,region_function(arg2));
-    else error->all("Invalid group function in variable formula");
+    else error->all(FLERR,"Invalid group function in variable formula");
 
   } else if (strcmp(word,"mass") == 0) {
     if (narg == 1) value = group->mass(igroup);
     else if (narg == 2) value = group->mass(igroup,region_function(arg2));
-    else error->all("Invalid group function in variable formula");
+    else error->all(FLERR,"Invalid group function in variable formula");
 
   } else if (strcmp(word,"charge") == 0) {
     if (narg == 1) value = group->charge(igroup);
     else if (narg == 2) value = group->charge(igroup,region_function(arg2));
-    else error->all("Invalid group function in variable formula");
+    else error->all(FLERR,"Invalid group function in variable formula");
 
   } else if (strcmp(word,"xcm") == 0) {
     atom->check_mass();
@@ -2508,11 +2505,11 @@ int Variable::group_function(char *word, char *contents, Tree **tree,
       int iregion = region_function(arg3);
       double masstotal = group->mass(igroup,iregion);
       group->xcm(igroup,masstotal,xcm,iregion);
-    } else error->all("Invalid group function in variable formula");
+    } else error->all(FLERR,"Invalid group function in variable formula");
     if (strcmp(arg2,"x") == 0) value = xcm[0];
     else if (strcmp(arg2,"y") == 0) value = xcm[1];
     else if (strcmp(arg2,"z") == 0) value = xcm[2];
-    else error->all("Invalid group function in variable formula");
+    else error->all(FLERR,"Invalid group function in variable formula");
 
   } else if (strcmp(word,"vcm") == 0) {
     atom->check_mass();
@@ -2524,34 +2521,34 @@ int Variable::group_function(char *word, char *contents, Tree **tree,
       int iregion = region_function(arg3);
       double masstotal = group->mass(igroup,iregion);
       group->vcm(igroup,masstotal,vcm,iregion);
-    } else error->all("Invalid group function in variable formula");
+    } else error->all(FLERR,"Invalid group function in variable formula");
     if (strcmp(arg2,"x") == 0) value = vcm[0];
     else if (strcmp(arg2,"y") == 0) value = vcm[1];
     else if (strcmp(arg2,"z") == 0) value = vcm[2];
-    else error->all("Invalid group function in variable formula");
+    else error->all(FLERR,"Invalid group function in variable formula");
 
   } else if (strcmp(word,"fcm") == 0) {
     double fcm[3];
     if (narg == 2) group->fcm(igroup,fcm);
     else if (narg == 3) group->fcm(igroup,fcm,region_function(arg3));
-    else error->all("Invalid group function in variable formula");
+    else error->all(FLERR,"Invalid group function in variable formula");
     if (strcmp(arg2,"x") == 0) value = fcm[0];
     else if (strcmp(arg2,"y") == 0) value = fcm[1];
     else if (strcmp(arg2,"z") == 0) value = fcm[2];
-    else error->all("Invalid group function in variable formula");
+    else error->all(FLERR,"Invalid group function in variable formula");
 
   } else if (strcmp(word,"bound") == 0) {
     double minmax[6];
     if (narg == 2) group->bounds(igroup,minmax);
     else if (narg == 3) group->bounds(igroup,minmax,region_function(arg3));
-    else error->all("Invalid group function in variable formula");
+    else error->all(FLERR,"Invalid group function in variable formula");
     if (strcmp(arg2,"xmin") == 0) value = minmax[0];
     else if (strcmp(arg2,"xmax") == 0) value = minmax[1];
     else if (strcmp(arg2,"ymin") == 0) value = minmax[2];
     else if (strcmp(arg2,"ymax") == 0) value = minmax[3];
     else if (strcmp(arg2,"zmin") == 0) value = minmax[4];
     else if (strcmp(arg2,"zmax") == 0) value = minmax[5];
-    else error->all("Invalid group function in variable formula");
+    else error->all(FLERR,"Invalid group function in variable formula");
 
   } else if (strcmp(word,"gyration") == 0) {
     atom->check_mass();
@@ -2565,12 +2562,12 @@ int Variable::group_function(char *word, char *contents, Tree **tree,
       double masstotal = group->mass(igroup,iregion);
       group->xcm(igroup,masstotal,xcm,iregion);
       value = group->gyration(igroup,masstotal,xcm,iregion);
-    } else error->all("Invalid group function in variable formula");
+    } else error->all(FLERR,"Invalid group function in variable formula");
 
   } else if (strcmp(word,"ke") == 0) {
     if (narg == 1) value = group->ke(igroup);
     else if (narg == 2) value = group->ke(igroup,region_function(arg2));
-    else error->all("Invalid group function in variable formula");
+    else error->all(FLERR,"Invalid group function in variable formula");
 
   } else if (strcmp(word,"angmom") == 0) {
     atom->check_mass();
@@ -2584,11 +2581,11 @@ int Variable::group_function(char *word, char *contents, Tree **tree,
       double masstotal = group->mass(igroup,iregion);
       group->xcm(igroup,masstotal,xcm,iregion);
       group->angmom(igroup,xcm,lmom,iregion);
-    } else error->all("Invalid group function in variable formula");
+    } else error->all(FLERR,"Invalid group function in variable formula");
     if (strcmp(arg2,"x") == 0) value = lmom[0];
     else if (strcmp(arg2,"y") == 0) value = lmom[1];
     else if (strcmp(arg2,"z") == 0) value = lmom[2];
-    else error->all("Invalid group function in variable formula");
+    else error->all(FLERR,"Invalid group function in variable formula");
 
   } else if (strcmp(word,"torque") == 0) {
     atom->check_mass();
@@ -2602,11 +2599,11 @@ int Variable::group_function(char *word, char *contents, Tree **tree,
       double masstotal = group->mass(igroup,iregion);
       group->xcm(igroup,masstotal,xcm,iregion);
       group->torque(igroup,xcm,tq,iregion);
-    } else error->all("Invalid group function in variable formula");
+    } else error->all(FLERR,"Invalid group function in variable formula");
     if (strcmp(arg2,"x") == 0) value = tq[0];
     else if (strcmp(arg2,"y") == 0) value = tq[1];
     else if (strcmp(arg2,"z") == 0) value = tq[2];
-    else error->all("Invalid group function in variable formula");
+    else error->all(FLERR,"Invalid group function in variable formula");
 
   } else if (strcmp(word,"inertia") == 0) {
     atom->check_mass();
@@ -2620,14 +2617,14 @@ int Variable::group_function(char *word, char *contents, Tree **tree,
       double masstotal = group->mass(igroup,iregion);
       group->xcm(igroup,masstotal,xcm,iregion);
       group->inertia(igroup,xcm,inertia,iregion);
-    } else error->all("Invalid group function in variable formula");
+    } else error->all(FLERR,"Invalid group function in variable formula");
     if (strcmp(arg2,"xx") == 0) value = inertia[0][0];
     else if (strcmp(arg2,"yy") == 0) value = inertia[1][1];
     else if (strcmp(arg2,"zz") == 0) value = inertia[2][2];
     else if (strcmp(arg2,"xy") == 0) value = inertia[0][1];
     else if (strcmp(arg2,"yz") == 0) value = inertia[1][2];
     else if (strcmp(arg2,"xz") == 0) value = inertia[0][2];
-    else error->all("Invalid group function in variable formula");
+    else error->all(FLERR,"Invalid group function in variable formula");
 
   } else if (strcmp(word,"omega") == 0) {
     atom->check_mass();
@@ -2645,11 +2642,11 @@ int Variable::group_function(char *word, char *contents, Tree **tree,
       group->angmom(igroup,xcm,angmom,iregion);
       group->inertia(igroup,xcm,inertia,iregion);
       group->omega(angmom,inertia,omega);
-    } else error->all("Invalid group function in variable formula");
+    } else error->all(FLERR,"Invalid group function in variable formula");
     if (strcmp(arg2,"x") == 0) value = omega[0];
     else if (strcmp(arg2,"y") == 0) value = omega[1];
     else if (strcmp(arg2,"z") == 0) value = omega[2];
-    else error->all("Invalid group function in variable formula");
+    else error->all(FLERR,"Invalid group function in variable formula");
   }
     
   delete [] arg1;
@@ -2675,7 +2672,7 @@ int Variable::region_function(char *id)
 {
   int iregion = domain->find_region(id);
   if (iregion == -1)
-    error->all("Region ID in variable formula does not exist");
+    error->all(FLERR,"Region ID in variable formula does not exist");
   return iregion;
 }
 
@@ -2743,7 +2740,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree,
     else if (strcmp(word,"ave") == 0) method = AVE;
     else if (strcmp(word,"trap") == 0) method = TRAP;
     
-    if (narg != 1) error->all("Invalid special function in variable formula");
+    if (narg != 1) error->all(FLERR,"Invalid special function in variable formula");
   
     Compute *compute = NULL;
     Fix *fix = NULL;
@@ -2758,12 +2755,12 @@ int Variable::special_function(char *word, char *contents, Tree **tree,
       } else index = 0;
 
       int icompute = modify->find_compute(&arg1[2]);
-      if (icompute < 0) error->all("Invalid compute ID in variable formula");
+      if (icompute < 0) error->all(FLERR,"Invalid compute ID in variable formula");
       compute = modify->compute[icompute];
       if (index == 0 && compute->vector_flag) {
 	if (update->whichflag == 0) {
 	  if (compute->invoked_vector != update->ntimestep)
-	    error->all("Compute used in variable between runs is not current");
+	    error->all(FLERR,"Compute used in variable between runs is not current");
 	} else if (!(compute->invoked_flag & INVOKED_VECTOR)) {
 	  compute->compute_vector();
 	  compute->invoked_flag |= INVOKED_VECTOR;
@@ -2772,18 +2769,18 @@ int Variable::special_function(char *word, char *contents, Tree **tree,
 	nstride = 1;
       } else if (index && compute->array_flag) {
 	if (index > compute->size_array_cols)
-	  error->all("Variable formula compute array "
+	  error->all(FLERR,"Variable formula compute array "
 		     "is accessed out-of-range");
 	if (update->whichflag == 0) {
 	  if (compute->invoked_array != update->ntimestep)
-	    error->all("Compute used in variable between runs is not current");
+	    error->all(FLERR,"Compute used in variable between runs is not current");
 	} else if (!(compute->invoked_flag & INVOKED_ARRAY)) {
 	  compute->compute_array();
 	  compute->invoked_flag |= INVOKED_ARRAY;
 	}
 	nvec = compute->size_array_rows;
 	nstride = compute->size_array_cols;
-      } else error->all("Mismatched compute in variable formula");
+      } else error->all(FLERR,"Mismatched compute in variable formula");
       
     } else if (strstr(arg1,"f_") == arg1) {
       ptr1 = strchr(arg1,'[');
@@ -2794,23 +2791,23 @@ int Variable::special_function(char *word, char *contents, Tree **tree,
       } else index = 0;
       
       int ifix = modify->find_fix(&arg1[2]);
-      if (ifix < 0) error->all("Invalid fix ID in variable formula");
+      if (ifix < 0) error->all(FLERR,"Invalid fix ID in variable formula");
       fix = modify->fix[ifix];
       if (index == 0 && fix->vector_flag) {
 	if (update->whichflag > 0 && update->ntimestep % fix->global_freq)
-	  error->all("Fix in variable not computed at compatible time");
+	  error->all(FLERR,"Fix in variable not computed at compatible time");
 	nvec = fix->size_vector;
 	nstride = 1;
       } else if (index && fix->array_flag) {
 	if (index > fix->size_array_cols)
-	  error->all("Variable formula fix array is accessed out-of-range");
+	  error->all(FLERR,"Variable formula fix array is accessed out-of-range");
 	if (update->whichflag > 0 && update->ntimestep % fix->global_freq)
-	  error->all("Fix in variable not computed at compatible time");
+	  error->all(FLERR,"Fix in variable not computed at compatible time");
 	nvec = fix->size_array_rows;
 	nstride = fix->size_array_cols;
-      } else error->all("Mismatched fix in variable formula");
+      } else error->all(FLERR,"Mismatched fix in variable formula");
       
-    } else error->all("Invalid special function in variable formula");
+    } else error->all(FLERR,"Invalid special function in variable formula");
     
     double value = 0.0;
     if (method == XMIN) value = BIG;
@@ -2871,12 +2868,12 @@ int Variable::special_function(char *word, char *contents, Tree **tree,
 
   } else if (strcmp(word,"gmask") == 0) {
     if (tree == NULL)
-      error->all("Gmask function in equal-style variable formula");
-    if (narg != 1) error->all("Invalid special function in variable formula");
+      error->all(FLERR,"Gmask function in equal-style variable formula");
+    if (narg != 1) error->all(FLERR,"Invalid special function in variable formula");
 
     int igroup = group->find(arg1);
     if (igroup == -1)
-      error->all("Group ID in variable formula does not exist");
+      error->all(FLERR,"Group ID in variable formula does not exist");
     
     Tree *newtree = new Tree();
     newtree->type = GMASK;
@@ -2886,8 +2883,8 @@ int Variable::special_function(char *word, char *contents, Tree **tree,
 
   } else if (strcmp(word,"rmask") == 0) {
     if (tree == NULL)
-      error->all("Rmask function in equal-style variable formula");
-    if (narg != 1) error->all("Invalid special function in variable formula");
+      error->all(FLERR,"Rmask function in equal-style variable formula");
+    if (narg != 1) error->all(FLERR,"Invalid special function in variable formula");
 
     int iregion = region_function(arg1);
     
@@ -2899,12 +2896,12 @@ int Variable::special_function(char *word, char *contents, Tree **tree,
 
   } else if (strcmp(word,"grmask") == 0) {
     if (tree == NULL)
-      error->all("Grmask function in equal-style variable formula");
-    if (narg != 2) error->all("Invalid special function in variable formula");
+      error->all(FLERR,"Grmask function in equal-style variable formula");
+    if (narg != 2) error->all(FLERR,"Invalid special function in variable formula");
 
     int igroup = group->find(arg1);
     if (igroup == -1)
-      error->all("Group ID in variable formula does not exist");
+      error->all(FLERR,"Group ID in variable formula does not exist");
     int iregion = region_function(arg2);
     
     Tree *newtree = new Tree();
@@ -2934,7 +2931,7 @@ void Variable::peratom2global(int flag, char *word,
 			      double *argstack, int &nargstack)
 {
   if (atom->map_style == 0)
-    error->all("Indexed per-atom vector in variable formula without atom map");
+    error->all(FLERR,"Indexed per-atom vector in variable formula without atom map");
 
   int index = atom->map(id);
 
@@ -2957,7 +2954,7 @@ void Variable::peratom2global(int flag, char *word,
       else if (strcmp(word,"fy") == 0) mine = atom->f[index][1];
       else if (strcmp(word,"fz") == 0) mine = atom->f[index][2];
       
-      else error->one("Invalid atom vector in variable formula");
+      else error->one(FLERR,"Invalid atom vector in variable formula");
 
     } else mine = vector[index*nstride];
     
@@ -3010,7 +3007,7 @@ void Variable::atom_vector(char *word, Tree **tree,
 			   Tree **treestack, int &ntreestack)
 {
   if (tree == NULL)
-    error->all("Atom vector in equal-style variable formula");
+    error->all(FLERR,"Atom vector in equal-style variable formula");
 
   Tree *newtree = new Tree();
   newtree->type = ATOMARRAY;
@@ -3077,7 +3074,7 @@ double Variable::numeric(char *str)
     if (isdigit(str[i])) continue;
     if (str[i] == '-' || str[i] == '+' || str[i] == '.') continue;
     if (str[i] == 'e' || str[i] == 'E') continue;
-    error->all("Expected floating point parameter in variable definition");
+    error->all(FLERR,"Expected floating point parameter in variable definition");
   }
 
   return atof(str);
@@ -3093,7 +3090,7 @@ int Variable::inumeric(char *str)
   int n = strlen(str);
   for (int i = 0; i < n; i++) {
     if (isdigit(str[i]) || str[i] == '-' || str[i] == '+') continue;
-    error->all("Expected integer parameter in variable definition");
+    error->all(FLERR,"Expected integer parameter in variable definition");
   }
 
   return atoi(str);
@@ -3163,7 +3160,7 @@ double Variable::evaluate_boolean(char *str)
     // ----------------
     
     else if (onechar == '(') {
-      if (expect == OP) error->all("Invalid Boolean syntax in if command");
+      if (expect == OP) error->all(FLERR,"Invalid Boolean syntax in if command");
       expect = OP;
       
       char *contents;
@@ -3181,7 +3178,7 @@ double Variable::evaluate_boolean(char *str)
     // ----------------
       
     } else if (isdigit(onechar) || onechar == '.' || onechar == '-') {
-      if (expect == OP) error->all("Invalid Boolean syntax in if command");
+      if (expect == OP) error->all(FLERR,"Invalid Boolean syntax in if command");
       expect = OP;
       
       // istop = end of number, including scientific notation
@@ -3211,7 +3208,7 @@ double Variable::evaluate_boolean(char *str)
     } else if (strchr("<>=!&|\0",onechar)) {
       if (onechar == '=') {
 	if (str[i+1] != '=') 
-	  error->all("Invalid Boolean syntax in if command");
+	  error->all(FLERR,"Invalid Boolean syntax in if command");
 	op = EQ;
 	i++;
       } else if (onechar == '!') {
@@ -3233,12 +3230,12 @@ double Variable::evaluate_boolean(char *str)
 	}
       } else if (onechar == '&') {
 	if (str[i+1] != '&') 
-	  error->all("Invalid Boolean syntax in if command");
+	  error->all(FLERR,"Invalid Boolean syntax in if command");
 	op = AND;
 	i++;
       } else if (onechar == '|') {
 	if (str[i+1] != '|') 
-	  error->all("Invalid Boolean syntax in if command");
+	  error->all(FLERR,"Invalid Boolean syntax in if command");
 	op = OR;
 	i++;
       } else op = DONE;
@@ -3250,7 +3247,7 @@ double Variable::evaluate_boolean(char *str)
 	continue;
       }
 
-      if (expect == ARG) error->all("Invalid Boolean syntax in if command");
+      if (expect == ARG) error->all(FLERR,"Invalid Boolean syntax in if command");
       expect = ARG;
       
       // evaluate stack as deep as possible while respecting precedence
@@ -3300,10 +3297,10 @@ double Variable::evaluate_boolean(char *str)
       
       opstack[nopstack++] = op;
 
-    } else error->all("Invalid Boolean syntax in if command");
+    } else error->all(FLERR,"Invalid Boolean syntax in if command");
   }
 
-  if (nopstack) error->all("Invalid Boolean syntax in if command");
-  if (nargstack != 1) error->all("Invalid Boolean syntax in if command");
+  if (nopstack) error->all(FLERR,"Invalid Boolean syntax in if command");
+  if (nargstack != 1) error->all(FLERR,"Invalid Boolean syntax in if command");
   return argstack[0];
 }
diff --git a/src/velocity.cpp b/src/velocity.cpp
index c590ece9dbd015636105b22f48c5b5a5ad74a055..ef95a873a736d4aa8bbf23b411b75eef39c215d4 100644
--- a/src/velocity.cpp
+++ b/src/velocity.cpp
@@ -43,9 +43,6 @@ enum{NONE,CONSTANT,EQUAL,ATOM};
 #define WARMUP 100
 #define SMALL  0.001
 
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
 /* ---------------------------------------------------------------------- */
 
 Velocity::Velocity(LAMMPS *lmp) : Pointers(lmp) {}
@@ -54,12 +51,12 @@ Velocity::Velocity(LAMMPS *lmp) : Pointers(lmp) {}
 
 void Velocity::command(int narg, char **arg)
 {
-  if (narg < 2) error->all("Illegal velocity command");
+  if (narg < 2) error->all(FLERR,"Illegal velocity command");
 
   if (domain->box_exist == 0) 
-    error->all("Velocity command before simulation box is defined");
+    error->all(FLERR,"Velocity command before simulation box is defined");
   if (atom->natoms == 0)
-    error->all("Velocity command with no atoms existing");
+    error->all(FLERR,"Velocity command with no atoms existing");
 
   // atom masses must all be set
 
@@ -68,7 +65,7 @@ void Velocity::command(int narg, char **arg)
   // identify group
 
   igroup = group->find(arg[0]);
-  if (igroup == -1) error->all("Could not find velocity group ID");
+  if (igroup == -1) error->all(FLERR,"Could not find velocity group ID");
   groupbit = group->bitmask[igroup];
 
   // identify style
@@ -78,7 +75,7 @@ void Velocity::command(int narg, char **arg)
   else if (strcmp(arg[1],"scale") == 0) style = SCALE;
   else if (strcmp(arg[1],"ramp") == 0) style = RAMP;
   else if (strcmp(arg[1],"zero") == 0) style = ZERO;
-  else error->all("Illegal velocity command");
+  else error->all(FLERR,"Illegal velocity command");
 
   // set defaults
 
@@ -120,7 +117,7 @@ void Velocity::command(int narg, char **arg)
 void Velocity::init_external(char *extgroup)
 {
   igroup = group->find(extgroup);
-  if (igroup == -1) error->all("Could not find velocity group ID");
+  if (igroup == -1) error->all(FLERR,"Could not find velocity group ID");
   groupbit = group->bitmask[igroup];
 
   temperature = NULL;
@@ -138,7 +135,7 @@ void Velocity::create(double t_desired, int seed)
 {
   int i;
 
-  if (seed <= 0) error->all("Illegal velocity create command");
+  if (seed <= 0) error->all(FLERR,"Illegal velocity create command");
 
   // if temperature = NULL, create a new ComputeTemp with the velocity group
 
@@ -157,7 +154,7 @@ void Velocity::create(double t_desired, int seed)
   // warn if groups don't match
 
   if (igroup != temperature->igroup && comm->me == 0)
-    error->warning("Mismatch between velocity and compute groups");
+    error->warning(FLERR,"Mismatch between velocity and compute groups");
   temperature->init();
 
   // store a copy of current velocities
@@ -214,11 +211,11 @@ void Velocity::create(double t_desired, int seed)
     // error check
 
     if (atom->natoms > MAXSMALLINT)
-      error->all("Too big a problem to use velocity create loop all");
+      error->all(FLERR,"Too big a problem to use velocity create loop all");
     if (atom->tag_enable == 0)
-      error->all("Cannot use velocity create loop all unless atoms have IDs");
+      error->all(FLERR,"Cannot use velocity create loop all unless atoms have IDs");
     if (atom->tag_consecutive() == 0)
-      error->all("Atom IDs must be consecutive for velocity create loop all");
+      error->all(FLERR,"Atom IDs must be consecutive for velocity create loop all");
 
     // loop over all atoms in system
     // generate RNGs for all atoms, only assign to ones I own
@@ -379,19 +376,19 @@ void Velocity::set(int narg, char **arg)
 
   if (xstyle && !xstr) {
     if (scale_flag && domain->lattice == NULL)
-      error->all("Use of velocity with undefined lattice");
+      error->all(FLERR,"Use of velocity with undefined lattice");
     if (scale_flag) xscale = domain->lattice->xlattice;
     vx *= xscale;
   }
   if (ystyle && !ystr) {
     if (scale_flag && domain->lattice == NULL)
-      error->all("Use of velocity with undefined lattice");
+      error->all(FLERR,"Use of velocity with undefined lattice");
     if (scale_flag) yscale = domain->lattice->ylattice;
     vy *= yscale;
   }
   if (zstyle && !zstr) {
     if (scale_flag && domain->lattice == NULL)
-      error->all("Use of velocity with undefined lattice");
+      error->all(FLERR,"Use of velocity with undefined lattice");
     if (scale_flag) zscale = domain->lattice->zlattice;
     vz *= zscale;
   }
@@ -400,24 +397,24 @@ void Velocity::set(int narg, char **arg)
 
   if (xstr) {
     xvar = input->variable->find(xstr);
-    if (xvar < 0) error->all("Variable name for velocity set does not exist");
+    if (xvar < 0) error->all(FLERR,"Variable name for velocity set does not exist");
     if (input->variable->equalstyle(xvar)) xstyle = EQUAL;
     else if (input->variable->atomstyle(xvar)) xstyle = ATOM;
-    else error->all("Variable for velocity set is invalid style");
+    else error->all(FLERR,"Variable for velocity set is invalid style");
   }
   if (ystr) {
     yvar = input->variable->find(ystr);
-    if (yvar < 0) error->all("Variable name for velocity set does not exist");
+    if (yvar < 0) error->all(FLERR,"Variable name for velocity set does not exist");
     if (input->variable->equalstyle(yvar)) ystyle = EQUAL;
     else if (input->variable->atomstyle(yvar)) ystyle = ATOM;
-    else error->all("Variable for velocity set is invalid style");
+    else error->all(FLERR,"Variable for velocity set is invalid style");
   }
   if (zstr) {
     zvar = input->variable->find(zstr);
-    if (zvar < 0) error->all("Variable name for velocity set does not exist");
+    if (zvar < 0) error->all(FLERR,"Variable name for velocity set does not exist");
     if (input->variable->equalstyle(zvar)) zstyle = EQUAL;
     else if (input->variable->atomstyle(zvar)) zstyle = ATOM;
-    else error->all("Variable for velocity set is invalid style");
+    else error->all(FLERR,"Variable for velocity set is invalid style");
   }
 
   if (xstyle == ATOM || ystyle == ATOM || zstyle == ATOM)
@@ -430,9 +427,9 @@ void Velocity::set(int narg, char **arg)
 
   if (domain->dimension == 2) {
     if (zstyle == CONSTANT && vz != 0.0)
-      error->all("Cannot set non-zero z velocity for 2d simulation");
+      error->all(FLERR,"Cannot set non-zero z velocity for 2d simulation");
     if (zstyle == EQUAL || zstyle == ATOM)
-      error->all("Cannot set variable z velocity for 2d simulation");
+      error->all(FLERR,"Cannot set variable z velocity for 2d simulation");
   }
 
   // allocate vfield array if necessary
@@ -527,7 +524,7 @@ void Velocity::scale(int narg, char **arg)
   // warn if groups don't match
 
   if (igroup != temperature->igroup && comm->me == 0)
-    error->warning("Mismatch between velocity and compute groups");
+    error->warning(FLERR,"Mismatch between velocity and compute groups");
   temperature->init();
 
   // scale temp to desired value
@@ -549,7 +546,7 @@ void Velocity::ramp(int narg, char **arg)
   // set scale factors
 
   if (scale_flag && domain->lattice == NULL)
-    error->all("Use of velocity with undefined lattice");
+    error->all(FLERR,"Use of velocity with undefined lattice");
 
   if (scale_flag) {
     xscale = domain->lattice->xlattice;
@@ -564,10 +561,10 @@ void Velocity::ramp(int narg, char **arg)
   if (strcmp(arg[0],"vx") == 0) v_dim = 0;
   else if (strcmp(arg[0],"vy") == 0) v_dim = 1;
   else if (strcmp(arg[0],"vz") == 0) v_dim = 2;
-  else error->all("Illegal velocity command");
+  else error->all(FLERR,"Illegal velocity command");
 
   if (v_dim == 2 && domain->dimension == 2) 
-    error->all("Velocity ramp in z for a 2d problem");
+    error->all(FLERR,"Velocity ramp in z for a 2d problem");
 
   double v_lo,v_hi;
   if (v_dim == 0) {
@@ -585,7 +582,7 @@ void Velocity::ramp(int narg, char **arg)
   if (strcmp(arg[3],"x") == 0) coord_dim = 0;
   else if (strcmp(arg[3],"y") == 0) coord_dim = 1;
   else if (strcmp(arg[3],"z") == 0) coord_dim = 2;
-  else error->all("Illegal velocity command");
+  else error->all(FLERR,"Illegal velocity command");
 
   double coord_lo,coord_hi;
   if (coord_dim == 0) {
@@ -628,7 +625,7 @@ void Velocity::zero(int narg, char **arg)
 {
   if (strcmp(arg[0],"linear") == 0) zero_momentum();
   else if (strcmp(arg[0],"angular") == 0) zero_rotation();
-  else error->all("Illegal velocity command");
+  else error->all(FLERR,"Illegal velocity command");
 }
 
 /* ----------------------------------------------------------------------
@@ -637,7 +634,7 @@ void Velocity::zero(int narg, char **arg)
 
 void Velocity::rescale(double t_old, double t_new)
 {
-  if (t_old == 0.0) error->all("Attempting to rescale a 0.0 temperature");
+  if (t_old == 0.0) error->all(FLERR,"Attempting to rescale a 0.0 temperature");
 
   double factor = sqrt(t_new/t_old);
 
@@ -662,7 +659,7 @@ void Velocity::zero_momentum()
   // cannot have 0 atoms in group
 
   if (group->count(igroup) == 0)
-    error->all("Cannot zero momentum of 0 atoms");
+    error->all(FLERR,"Cannot zero momentum of 0 atoms");
 
   // compute velocity of center-of-mass of group
 
@@ -695,7 +692,7 @@ void Velocity::zero_rotation()
   // cannot have 0 atoms in group
 
   if (group->count(igroup) == 0)
-    error->all("Cannot zero momentum of 0 atoms");
+    error->all(FLERR,"Cannot zero momentum of 0 atoms");
 
   // compute omega (angular velocity) of group around center-of-mass
 
@@ -742,58 +739,58 @@ void Velocity::zero_rotation()
 
 void Velocity::options(int narg, char **arg)
 {
-  if (narg < 0) error->all("Illegal velocity command");
+  if (narg < 0) error->all(FLERR,"Illegal velocity command");
 
   int iarg = 0;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"dist") == 0) {
-      if (iarg+2 > narg) error->all("Illegal velocity command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal velocity command");
       if (strcmp(arg[iarg+1],"uniform") == 0) dist_flag = 0;
       else if (strcmp(arg[iarg+1],"gaussian") == 0) dist_flag = 1;
-      else error->all("Illegal velocity command");
+      else error->all(FLERR,"Illegal velocity command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"sum") == 0) {
-      if (iarg+2 > narg) error->all("Illegal velocity command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal velocity command");
       if (strcmp(arg[iarg+1],"no") == 0) sum_flag = 0;
       else if (strcmp(arg[iarg+1],"yes") == 0) sum_flag = 1;
-      else error->all("Illegal velocity command");
+      else error->all(FLERR,"Illegal velocity command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"mom") == 0) {
-      if (iarg+2 > narg) error->all("Illegal velocity command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal velocity command");
       if (strcmp(arg[iarg+1],"no") == 0) momentum_flag = 0;
       else if (strcmp(arg[iarg+1],"yes") == 0) momentum_flag = 1;
-      else error->all("Illegal velocity command");
+      else error->all(FLERR,"Illegal velocity command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"rot") == 0) {
-      if (iarg+2 > narg) error->all("Illegal velocity command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal velocity command");
       if (strcmp(arg[iarg+1],"no") == 0) rotation_flag = 0;
       else if (strcmp(arg[iarg+1],"yes") == 0) rotation_flag = 1;
-      else error->all("Illegal velocity command");
+      else error->all(FLERR,"Illegal velocity command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"temp") == 0) {
-      if (iarg+2 > narg) error->all("Illegal velocity command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal velocity command");
       int icompute;
       for (icompute = 0; icompute < modify->ncompute; icompute++)
 	if (strcmp(arg[iarg+1],modify->compute[icompute]->id) == 0) break;
       if (icompute == modify->ncompute) 
-	error->all("Could not find velocity temperature ID");
+	error->all(FLERR,"Could not find velocity temperature ID");
       temperature = modify->compute[icompute];
       if (temperature->tempflag == 0)
-	error->all("Velocity temperature ID does not compute temperature");
+	error->all(FLERR,"Velocity temperature ID does not compute temperature");
       iarg += 2;
     } else if (strcmp(arg[iarg],"loop") == 0) {
-      if (iarg+2 > narg) error->all("Illegal velocity command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal velocity command");
       if (strcmp(arg[iarg+1],"all") == 0) loop_flag = ALL;
       else if (strcmp(arg[iarg+1],"local") == 0) loop_flag = LOCAL;
       else if (strcmp(arg[iarg+1],"geom") == 0) loop_flag = GEOM;
-      else error->all("Illegal velocity command");
+      else error->all(FLERR,"Illegal velocity command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"units") == 0) {
-      if (iarg+2 > narg) error->all("Illegal velocity command");
+      if (iarg+2 > narg) error->all(FLERR,"Illegal velocity command");
       if (strcmp(arg[iarg+1],"box") == 0) scale_flag = 0;
       else if (strcmp(arg[iarg+1],"lattice") == 0) scale_flag = 1;
-      else error->all("Illegal velocity command");
+      else error->all(FLERR,"Illegal velocity command");
       iarg += 2;
-    } else error->all("Illegal velocity command");
+    } else error->all(FLERR,"Illegal velocity command");
   }
 }
diff --git a/src/verlet.cpp b/src/verlet.cpp
index 4fc4024f42cf73a401c8d3e361a8c383aff19a58..7e38367400d2cbc4ab94d32ca354c03c81323484 100644
--- a/src/verlet.cpp
+++ b/src/verlet.cpp
@@ -49,7 +49,7 @@ void Verlet::init()
   // warn if no fixes
 
   if (modify->nfix == 0 && comm->me == 0)
-    error->warning("No fixes defined, atoms won't move");
+    error->warning(FLERR,"No fixes defined, atoms won't move");
 
   // virial_style:
   // 1 if computed explicitly by pair->compute via sum over pair interactions
diff --git a/src/write_restart.cpp b/src/write_restart.cpp
index 260dcbe3da5922f2521ea09dc85479df001c94e6..6a909ae107b2b99cb2cd8f683980ef0a63486440 100644
--- a/src/write_restart.cpp
+++ b/src/write_restart.cpp
@@ -38,9 +38,6 @@
 
 using namespace LAMMPS_NS;
 
-#define MIN(A,B) ((A) < (B)) ? (A) : (B)
-#define MAX(A,B) ((A) > (B)) ? (A) : (B)
-
 // same as read_restart.cpp and tools/restart2data.cpp
 
 enum{VERSION,SMALLINT,TAGINT,BIGINT,
@@ -76,8 +73,8 @@ WriteRestart::WriteRestart(LAMMPS *lmp) : Pointers(lmp)
 void WriteRestart::command(int narg, char **arg)
 {
   if (domain->box_exist == 0)
-    error->all("Write_restart command before simulation box is defined");
-  if (narg != 1) error->all("Illegal write_restart command");
+    error->all(FLERR,"Write_restart command before simulation box is defined");
+  if (narg != 1) error->all(FLERR,"Illegal write_restart command");
 
   // if filename contains a "*", replace with current timestep
 
@@ -135,7 +132,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) 
-    error->all("Atom count is inconsistent, cannot write restart file");
+    error->all(FLERR,"Atom count is inconsistent, cannot write restart file");
 
   // check if filename contains "%"
 
@@ -158,7 +155,7 @@ void WriteRestart::write(char *file)
     if (fp == NULL) {
       char str[128];
       sprintf(str,"Cannot open restart file %s",hfile);
-      error->one(str);
+      error->one(FLERR,str);
     }
     if (multiproc) delete [] hfile;
   }
@@ -284,7 +281,7 @@ void WriteRestart::write(char *file)
     if (fp == NULL) {
       char str[128];
       sprintf(str,"Cannot open restart file %s",perproc);
-      error->one(str);
+      error->one(FLERR,str);
     }
     delete [] perproc;
     fwrite(&send_size,sizeof(int),1,fp);