From 1fac1d41fa783b6acce8fe980fd73d09d4878360 Mon Sep 17 00:00:00 2001
From: sjplimp <sjplimp@f3b2605a-c512-4ea7-a41b-209d697bcdaa>
Date: Tue, 15 Apr 2014 15:24:27 +0000
Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11789
 f3b2605a-c512-4ea7-a41b-209d697bcdaa

---
 src/ASPHERE/fix_nve_line.cpp                |   6 +-
 src/ASPHERE/fix_nve_tri.cpp                 |   4 +-
 src/ASPHERE/pair_line_lj.cpp                |   3 +-
 src/BODY/body_nparticle.cpp                 |   2 +-
 src/BODY/compute_body_local.cpp             |   1 -
 src/FLD/pair_lubricate.cpp                  |  16 --
 src/FLD/pair_lubricateU.cpp                 |  81 +------
 src/FLD/pair_lubricateU_poly.cpp            |  46 ----
 src/FLD/pair_lubricate_poly.cpp             |  16 --
 src/GPU/pair_beck_gpu.h                     |   1 -
 src/GPU/pair_born_coul_long_gpu.h           |   1 -
 src/GPU/pair_born_coul_wolf_gpu.h           |   1 -
 src/GPU/pair_born_gpu.h                     |   1 -
 src/GPU/pair_buck_coul_cut_gpu.h            |   1 -
 src/GPU/pair_buck_coul_long_gpu.h           |   1 -
 src/GPU/pair_buck_gpu.h                     |   1 -
 src/GPU/pair_colloid_gpu.h                  |   1 -
 src/GPU/pair_coul_dsf_gpu.cpp               |   5 +-
 src/GPU/pair_coul_dsf_gpu.h                 |   1 -
 src/GPU/pair_coul_long_gpu.cpp              |  11 +-
 src/GPU/pair_coul_long_gpu.h                |   1 -
 src/GPU/pair_dpd_gpu.h                      |   1 -
 src/GPU/pair_dpd_tstat_gpu.h                |   1 -
 src/GPU/pair_eam_gpu.cpp                    |   3 +-
 src/GPU/pair_eam_gpu.h                      |   1 -
 src/GPU/pair_gauss_gpu.cpp                  |   3 +-
 src/GPU/pair_gauss_gpu.h                    |   1 -
 src/GPU/pair_gayberne_gpu.h                 |   1 -
 src/GPU/pair_lj96_cut_gpu.h                 |   1 -
 src/GPU/pair_lj_charmm_coul_long_gpu.h      |   1 -
 src/GPU/pair_lj_class2_coul_long_gpu.h      |   1 -
 src/GPU/pair_lj_class2_gpu.h                |   1 -
 src/GPU/pair_lj_cut_coul_cut_gpu.h          |   1 -
 src/GPU/pair_lj_cut_coul_debye_gpu.h        |   1 -
 src/GPU/pair_lj_cut_coul_dsf_gpu.h          |   1 -
 src/GPU/pair_lj_cut_coul_long_gpu.h         |   1 -
 src/GPU/pair_lj_cut_coul_msm_gpu.h          |   1 -
 src/GPU/pair_lj_cut_dipole_cut_gpu.h        |   1 -
 src/GPU/pair_lj_cut_gpu.h                   |   1 -
 src/GPU/pair_lj_expand_gpu.h                |   1 -
 src/GPU/pair_lj_gromacs_gpu.h               |   1 -
 src/GPU/pair_lj_sdk_coul_long_gpu.h         |   1 -
 src/GPU/pair_lj_sdk_gpu.cpp                 |   2 +-
 src/GPU/pair_lj_sdk_gpu.h                   |   1 -
 src/GPU/pair_lj_sf_dipole_sf_gpu.h          |   1 -
 src/GPU/pair_mie_cut_gpu.h                  |   1 -
 src/GPU/pair_morse_gpu.h                    |   1 -
 src/GPU/pair_resquared_gpu.h                |   1 -
 src/GPU/pair_soft_gpu.h                     |   1 -
 src/GPU/pair_sw_gpu.h                       |   1 -
 src/GPU/pair_table_gpu.h                    |   1 -
 src/GPU/pair_yukawa_colloid_gpu.h           |   1 -
 src/GPU/pair_yukawa_gpu.h                   |   1 -
 src/GRANULAR/pair_gran_hertz_history.cpp    |   3 +-
 src/KSPACE/ewald_disp.cpp                   |   4 -
 src/KSPACE/pair_tip4p_long.cpp              |  10 +-
 src/KSPACE/pppm_stagger.cpp                 |  14 +-
 src/MANYBODY/pair_bop.cpp                   | 244 +++-----------------
 src/MANYBODY/pair_comb.cpp                  |  12 +-
 src/MANYBODY/pair_comb3.cpp                 |  40 ++--
 src/MANYBODY/pair_eam.cpp                   |   2 +-
 src/MANYBODY/pair_eam_alloy.cpp             |   2 +-
 src/MANYBODY/pair_eam_fs.cpp                |   2 +-
 src/MANYBODY/pair_sw.cpp                    |   6 +-
 src/MANYBODY/pair_tersoff.cpp               |   6 +-
 src/MANYBODY/pair_tersoff_mod.cpp           |   6 +-
 src/MANYBODY/pair_tersoff_zbl.cpp           |   6 +-
 src/MC/fix_bond_break.cpp                   |   4 +-
 src/MEAM/pair_meam.cpp                      |   8 +-
 src/MISC/fix_gld.cpp                        |   3 -
 src/MOLECULE/angle_table.cpp                |   2 +-
 src/MOLECULE/bond_fene.cpp                  |   2 +-
 src/MOLECULE/bond_fene_expand.cpp           |   2 +-
 src/MOLECULE/bond_quartic.cpp               |   2 +-
 src/MPIIO/dump_atom_mpiio.cpp               |   2 -
 src/MPIIO/dump_custom_mpiio.cpp             |   1 -
 src/MPIIO/dump_xyz_mpiio.cpp                |   1 -
 src/PERI/fix_peri_neigh.cpp                 |   1 -
 src/USER-CG-CMM/angle_sdk.cpp               |   2 +-
 src/USER-LB/fix_lb_fluid.cpp                |   3 -
 src/USER-LB/fix_lb_pc.cpp                   |   1 -
 src/USER-LB/fix_lb_rigid_pc_sphere.cpp      |  14 +-
 src/USER-MISC/angle_quartic.cpp             |   2 -
 src/USER-MISC/dihedral_cosine_shift_exp.cpp |   6 +-
 src/USER-MISC/dihedral_fourier.cpp          |   9 +-
 src/USER-MISC/dihedral_table.cpp            |   4 +-
 src/USER-MISC/pair_tersoff_table.cpp        |  10 +-
 src/USER-OMP/angle_cosine_squared_omp.cpp   |   1 +
 src/USER-OMP/dihedral_fourier_omp.cpp       |   2 +-
 src/USER-OMP/dihedral_table_omp.cpp         |   2 +-
 src/USER-OMP/pair_coul_wolf_omp.cpp         |   3 +-
 src/USER-OMP/pair_gayberne_omp.cpp          |   1 +
 src/USER-OMP/pair_nb3b_harmonic_omp.cpp     |   3 +-
 src/USER-OMP/pair_table_omp.cpp             |   2 +-
 src/USER-OMP/pair_tersoff_table_omp.cpp     |  10 +-
 src/USER-OMP/pair_tersoff_zbl_omp.cpp       |   6 +-
 src/USER-REAXC/pair_reax_c.cpp              |  32 ++-
 src/VORONOI/compute_voronoi_atom.cpp        |   4 +-
 src/balance.cpp                             |   2 +-
 src/body.cpp                                |   2 +
 100 files changed, 161 insertions(+), 583 deletions(-)

diff --git a/src/ASPHERE/fix_nve_line.cpp b/src/ASPHERE/fix_nve_line.cpp
index 1fd9b545a5..be9b42a7a1 100644
--- a/src/ASPHERE/fix_nve_line.cpp
+++ b/src/ASPHERE/fix_nve_line.cpp
@@ -56,8 +56,6 @@ int FixNVELine::setmask()
 
 void FixNVELine::init()
 {
-  int i,itype;
-
   // error checks
 
   avec = (AtomVecLine *) atom->style_match("line");
@@ -73,7 +71,7 @@ void FixNVELine::init()
   int *mask = atom->mask;
   int nlocal = atom->nlocal;
 
-  for (i = 0; i < nlocal; i++)
+  for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit) {
       if (line[i] < 0) error->one(FLERR,"Fix nve/line requires line particles");
     }
@@ -85,7 +83,7 @@ void FixNVELine::init()
 
 void FixNVELine::initial_integrate(int vflag)
 {
-  double dtfm,dtirotate,delx,dely,length,theta;
+  double dtfm,dtirotate,length,theta;
 
   AtomVecLine::Bonus *bonus = avec->bonus;
   int *line = atom->line;
diff --git a/src/ASPHERE/fix_nve_tri.cpp b/src/ASPHERE/fix_nve_tri.cpp
index a572013f49..71fe4d72dc 100644
--- a/src/ASPHERE/fix_nve_tri.cpp
+++ b/src/ASPHERE/fix_nve_tri.cpp
@@ -50,8 +50,6 @@ int FixNVETri::setmask()
 
 void FixNVETri::init()
 {
-  int i,itype;
-
   // error checks
 
   avec = (AtomVecTri *) atom->style_match("tri");
@@ -67,7 +65,7 @@ void FixNVETri::init()
   int *mask = atom->mask;
   int nlocal = atom->nlocal;
 
-  for (i = 0; i < nlocal; i++)
+  for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit) {
       if (tri[i] < 0) error->one(FLERR,"Fix nve/tri requires tri particles");
     }
diff --git a/src/ASPHERE/pair_line_lj.cpp b/src/ASPHERE/pair_line_lj.cpp
index 27d63e5ddb..219a8ea971 100644
--- a/src/ASPHERE/pair_line_lj.cpp
+++ b/src/ASPHERE/pair_line_lj.cpp
@@ -70,7 +70,7 @@ void PairLineLJ::compute(int eflag, int vflag)
   int ni,nj,npi,npj,ifirst,jfirst;
   double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
   double rsq,r2inv,r6inv,term1,term2,sig,sig3,forcelj;
-  double xi[2],xj[2],fi[2],fj[2],dxi,dxj,dyi,dyj,ti,tj;
+  double xi[2],xj[2],fi[2],fj[2],dxi,dxj,dyi,dyj;
   int *ilist,*jlist,*numneigh,**firstneigh;
 
   evdwl = 0.0;
@@ -441,7 +441,6 @@ void PairLineLJ::discretize(int i, double sigma)
       memory->srealloc(discrete,dmax*sizeof(Discrete),"pair:discrete");
   }
 
-  double *x = atom->x[i];
   sigma = length/n;
   double delta;
 
diff --git a/src/BODY/body_nparticle.cpp b/src/BODY/body_nparticle.cpp
index e2b8c9b020..b8e981e172 100644
--- a/src/BODY/body_nparticle.cpp
+++ b/src/BODY/body_nparticle.cpp
@@ -176,7 +176,7 @@ void BodyNparticle::data_body(int ibonus, int ninteger, int ndouble,
 
   // bonus->dvalue = sub-particle displacements in body frame
 
-  double delta[3],displace[3];
+  double delta[3];
 
   int j = 6;
   int k = 0;
diff --git a/src/BODY/compute_body_local.cpp b/src/BODY/compute_body_local.cpp
index 732b801d0f..3ba146642e 100644
--- a/src/BODY/compute_body_local.cpp
+++ b/src/BODY/compute_body_local.cpp
@@ -174,7 +174,6 @@ int ComputeBodyLocal::compute_body(int flag)
 
       } else {
         ibonus = body[i];
-        AtomVecBody::Bonus *bonus = &avec->bonus[ibonus];
         n = bptr->noutrow(ibonus);
         for (int j = 0; j < n; j++) {
           bptr->output(ibonus,j,values);
diff --git a/src/FLD/pair_lubricate.cpp b/src/FLD/pair_lubricate.cpp
index 19f2b0d8ec..ce6c00c55a 100755
--- a/src/FLD/pair_lubricate.cpp
+++ b/src/FLD/pair_lubricate.cpp
@@ -108,8 +108,6 @@ void PairLubricate::compute(int eflag, int vflag)
   int nlocal = atom->nlocal;
   int newton_pair = force->newton_pair;
 
-  int overlaps = 0;
-
   inum = list->inum;
   ilist = list->ilist;
   numneigh = list->numneigh;
@@ -299,10 +297,6 @@ void PairLubricate::compute(int eflag, int vflag)
 
         h_sep = r - 2.0*radi;
 
-        // check for overlaps
-
-        if (h_sep < 0.0) overlaps++;
-
         // if less than the minimum gap use the minimum gap instead
 
         if (r < cut_inner[itype][jtype])
@@ -445,16 +439,6 @@ void PairLubricate::compute(int eflag, int vflag)
     }
   }
 
-  // to DEBUG: set print_overlaps to 1
-
-  int print_overlaps = 0;
-  if (print_overlaps) {
-    int overlaps_all;
-    MPI_Allreduce(&overlaps,&overlaps_all,1,MPI_INT,MPI_SUM,world);
-    if (overlaps_all && comm->me == 0)
-      printf("Number of overlaps = %d\n",overlaps);
-  }
-
   if (vflag_fdotr) virial_fdotr_compute();
 }
 
diff --git a/src/FLD/pair_lubricateU.cpp b/src/FLD/pair_lubricateU.cpp
index 146b033aa8..5f89f757b2 100644
--- a/src/FLD/pair_lubricateU.cpp
+++ b/src/FLD/pair_lubricateU.cpp
@@ -181,21 +181,17 @@ void PairLubricateU::compute(int eflag, int vflag)
 
 void PairLubricateU::stage_one()
 {
-  int i,j,ii,inum,itype;
+  int i,j,ii,inum;
 
   double **x = atom->x;
   double **v = atom->v;
   double **f = atom->f;
   double **omega = atom->omega;
   double **torque = atom->torque;
-  double *radius = atom->radius;
-  int *type = atom->type;
 
   int newton_pair = force->newton_pair;
   int *ilist;
 
-  double radi;
-
   inum = list->inum;
   ilist = list->ilist;
 
@@ -358,9 +354,6 @@ void PairLubricateU::stage_one()
 
   for (ii=0;ii<inum;ii++) {
     i = ilist[ii];
-    itype = type[i];
-    radi = radius[i];
-
     v[i][0] = v[i][0] + gdot*x[i][1];
     omega[i][2] = omega[i][2] - gdot/2.0;
   }
@@ -390,19 +383,15 @@ void PairLubricateU::intermediates(int nall, double **xl)
 
 void PairLubricateU::stage_two(double **x)
 {
-  int i,j,ii,inum,itype;
+  int i,j,ii,inum;
   double **v = atom->v;
   double **f = atom->f;
   double **omega = atom->omega;
   double **torque = atom->torque;
-  double *radius = atom->radius;
-  int *type = atom->type;
 
   int newton_pair = force->newton_pair;
   int *ilist;
 
-  double radi;
-
   inum = list->inum;
   ilist = list->ilist;
 
@@ -553,9 +542,6 @@ void PairLubricateU::stage_two(double **x)
 
   for (ii=0;ii<inum;ii++) {
     i = ilist[ii];
-    itype = type[i];
-    radi = radius[i];
-
     v[i][0] = v[i][0] + gdot*x[i][1];
     omega[i][2] = omega[i][2] - gdot/2.0;
   }
@@ -570,7 +556,7 @@ void PairLubricateU::compute_Fh(double **x)
 {
   int i,j,ii,jj,inum,jnum,itype,jtype;
   double xtmp,ytmp,ztmp,delx,dely,delz,fx,fy,fz;
-  double rsq,r,h_sep,radi;
+  double rsq,r,h_sep;
   double vr1,vr2,vr3,vnnr,vn1,vn2,vn3;
   double vt1,vt2,vt3;
   int *ilist,*jlist,*numneigh,**firstneigh;
@@ -585,8 +571,9 @@ void PairLubricateU::compute_Fh(double **x)
   int nghost = atom->nghost;
   int newton_pair = force->newton_pair;
 
+  double radi;
+
   double vxmu2f = force->vxmu2f;
-  int overlaps = 0;
   double vi[3],vj[3],wi[3],wj[3],xl[3],a_sq,a_sh;
 
   inum = list->inum;
@@ -750,10 +737,6 @@ void PairLubricateU::compute_Fh(double **x)
 
         h_sep = r - 2.0*radi;
 
-        // check for overlaps
-
-        if (h_sep < 0.0) overlaps++;
-
         // If less than the minimum gap use the minimum gap instead
 
         if (r < cut_inner[itype][jtype])
@@ -823,7 +806,6 @@ void PairLubricateU::compute_RU()
   int newton_pair = force->newton_pair;
 
   double vxmu2f = force->vxmu2f;
-  int overlaps = 0;
   double vi[3],vj[3],wi[3],wj[3],xl[3],a_sq,a_sh,a_pu;
 
   inum = list->inum;
@@ -954,10 +936,6 @@ void PairLubricateU::compute_RU()
 
         h_sep = r - 2.0*radi;
 
-        // check for overlaps
-
-        if(h_sep < 0.0) overlaps++;
-
         // If less than the minimum gap use the minimum gap instead
 
         if (r < cut_inner[itype][jtype])
@@ -1099,7 +1077,6 @@ void PairLubricateU::compute_RU(double **x)
   int newton_pair = force->newton_pair;
 
   double vxmu2f = force->vxmu2f;
-  int overlaps = 0;
   double vi[3],vj[3],wi[3],wj[3],xl[3],a_sq,a_sh,a_pu;
 
   inum = list->inum;
@@ -1230,10 +1207,6 @@ void PairLubricateU::compute_RU(double **x)
 
         h_sep = r - 2.0*radi;
 
-        // check for overlaps
-
-        if(h_sep < 0.0) overlaps++;
-
         // If less than the minimum gap use the minimum gap instead
 
         if (r < cut_inner[itype][jtype])
@@ -1376,8 +1349,7 @@ void PairLubricateU::compute_RE()
   int newton_pair = force->newton_pair;
 
   double vxmu2f = force->vxmu2f;
-  int overlaps = 0;
-  double xl[3],a_sq,a_sh,a_pu;
+  double xl[3],a_sq,a_sh;
 
   inum = list->inum;
   ilist = list->ilist;
@@ -1421,10 +1393,6 @@ void PairLubricateU::compute_RE()
 
         h_sep = r - 2.0*radi;
 
-        // check for overlaps
-
-        if(h_sep < 0.0) overlaps++;
-
         // If less than the minimum gap use the minimum gap instead
 
         if (r < cut_inner[itype][jtype])
@@ -1445,7 +1413,6 @@ void PairLubricateU::compute_RE()
 
         if (flaglog) {
           a_sh = 6*MY_PI*mu*radi*(1.0/6.0*log(1/h_sep));
-          a_pu = 8.0*MY_PI*mu*pow(radi,3.0)*(3.0/160.0*log(1.0/h_sep));
         }
 
         // Relative velocity at the point of closest approach due to Ef only
@@ -1517,16 +1484,10 @@ void PairLubricateU::compute_RE()
             torque[j][1] -= vxmu2f*ty;
             torque[j][2] -= vxmu2f*tz;
           }
-
-          // NOTE No a_pu term needed as they add up to zero
         }
       }
     }
   }
-
-  int print_overlaps = 0;
-  if (print_overlaps && overlaps)
-    printf("Number of overlaps=%d\n",overlaps);
 }
 
 /* ----------------------------------------------------------------------
@@ -1553,8 +1514,7 @@ void PairLubricateU::compute_RE(double **x)
   int newton_pair = force->newton_pair;
 
   double vxmu2f = force->vxmu2f;
-  int overlaps = 0;
-  double xl[3],a_sq,a_sh,a_pu;
+  double xl[3],a_sq,a_sh;
 
   if (!flagHI) return;
 
@@ -1598,10 +1558,6 @@ void PairLubricateU::compute_RE(double **x)
 
         h_sep = r - 2.0*radi;
 
-        // check for overlaps
-
-        if(h_sep < 0.0) overlaps++;
-
         // If less than the minimum gap use the minimum gap instead
 
         if (r < cut_inner[itype][jtype])
@@ -1622,7 +1578,6 @@ void PairLubricateU::compute_RE(double **x)
 
         if (flaglog) {
           a_sh = 6*MY_PI*mu*radi*(1.0/6.0*log(1/h_sep));
-          a_pu = 8.0*MY_PI*mu*pow(radi,3.0)*(3.0/160.0*log(1.0/h_sep));
         }
 
         // Relative velocity at the point of closest approach due to Ef only
@@ -1694,16 +1649,10 @@ void PairLubricateU::compute_RE(double **x)
             torque[j][1] -= vxmu2f*ty;
             torque[j][2] -= vxmu2f*tz;
           }
-
-          // NOTE No a_pu term needed as they add up to zero
         }
       }
     }
   }
-
-  int print_overlaps = 0;
-  if (print_overlaps && overlaps)
-    printf("Number of overlaps=%d\n",overlaps);
 }
 
 
@@ -1829,13 +1778,12 @@ void PairLubricateU::init_style()
   // require that atom radii are identical within each type
   // require monodisperse system with same radii for all types
 
-  double radi, radtype;
+  double radtype;
   for (int i = 1; i <= atom->ntypes; i++) {
     if (!atom->radius_consistency(i,radtype))
       error->all(FLERR,"Pair lubricateU requires monodisperse particles");
     if (i > 1 && radtype != rad)
       error->all(FLERR,"Pair lubricateU requires monodisperse particles");
-    radi = radtype;
   }
 
   // check for fix deform, if exists it must use "remap v"
@@ -2028,21 +1976,10 @@ void PairLubricateU::copy_vec_uo(int inum, double *xcg,
                                  double **v, double **omega)
 {
   int i,j,ii;
-  int *ilist;
-  int itype;
-  double radi;
-  double inertia;
-
-  double *rmass = atom->rmass;
-  int *type = atom->type;
-
-  ilist = list->ilist;
+  int *ilist = list->ilist;
 
   for (ii=0;ii<inum;ii++) {
     i = ilist[ii];
-    itype = type[i];
-    radi = atom->radius[i];
-    inertia = 0.4*rmass[i]*radi*radi;
 
     for (j=0;j<3;j++) {
       v[i][j] = xcg[6*ii+j];
diff --git a/src/FLD/pair_lubricateU_poly.cpp b/src/FLD/pair_lubricateU_poly.cpp
index 545f1e3207..f78d149522 100644
--- a/src/FLD/pair_lubricateU_poly.cpp
+++ b/src/FLD/pair_lubricateU_poly.cpp
@@ -154,7 +154,6 @@ void PairLubricateUPoly::iterate(double **x, int stage)
 
   int inum = list->inum;
   int *ilist = list->ilist;
-  int *type = atom->type;
   int newton_pair = force->newton_pair;
 
   double alpha,beta;
@@ -164,7 +163,6 @@ void PairLubricateUPoly::iterate(double **x, int stage)
   double **v = atom->v;
   double **f = atom->f;
   double **omega = atom->omega;
-  double **angmom = atom->angmom;
   double **torque = atom->torque;
 
   // First compute R_FE*E
@@ -329,7 +327,6 @@ void PairLubricateUPoly::compute_Fh(double **x)
   int nlocal = atom->nlocal;
   int nghost = atom->nghost;
   int newton_pair = force->newton_pair;
-  int overlaps = 0;
 
   double xtmp,ytmp,ztmp,delx,dely,delz,fx,fy,fz;
   double rsq,r,h_sep,radi,radj;
@@ -511,10 +508,6 @@ void PairLubricateUPoly::compute_Fh(double **x)
 
         // Find the scalar resistances a_sq, a_sh and a_pu
 
-        // check for overlaps
-
-        if (h_sep < 0.0) overlaps++;
-
         // If less than the minimum gap use the minimum gap instead
 
         if (r < cut_inner[itype][jtype])
@@ -606,7 +599,6 @@ void PairLubricateUPoly::compute_RU(double **x)
   int *type = atom->type;
   int nlocal = atom->nlocal;
   int nghost = atom->nghost;
-  int overlaps = 0;
 
   double xtmp,ytmp,ztmp,delx,dely,delz,fx,fy,fz,tx,ty,tz;
   double rsq,r,radi,radj,h_sep;
@@ -617,7 +609,6 @@ void PairLubricateUPoly::compute_RU(double **x)
   double **v = atom->v;
   double **f = atom->f;
   double **omega = atom->omega;
-  double **angmom = atom->angmom;
   double **torque = atom->torque;
   double *radius = atom->radius;
 
@@ -760,10 +751,6 @@ void PairLubricateUPoly::compute_RU(double **x)
 
         h_sep = r - radi-radj;
 
-        // check for overlaps
-
-        if(h_sep < 0.0) overlaps++;
-
         // If less than the minimum gap use the minimum gap instead
 
         if (r < cut_inner[itype][jtype])
@@ -913,7 +900,6 @@ void PairLubricateUPoly::compute_RE(double **x)
   int *ilist,*jlist,*numneigh,**firstneigh;
 
   int *type = atom->type;
-  int overlaps = 0;
 
   double xtmp,ytmp,ztmp,delx,dely,delz,fx,fy,fz,tx,ty,tz;
   double rsq,r,h_sep,radi,radj;
@@ -930,7 +916,6 @@ void PairLubricateUPoly::compute_RE(double **x)
   double vxmu2f = force->vxmu2f;
   double a_sq = 0.0;
   double a_sh = 0.0;
-  double a_pu = 0.0;
 
   if (!flagHI) return;
 
@@ -976,10 +961,6 @@ void PairLubricateUPoly::compute_RE(double **x)
 
         h_sep = r - radi-radj;
 
-        // check for overlaps
-
-        if (h_sep < 0.0) overlaps++;
-
         // If less than the minimum gap use the minimum gap instead
 
         if (r < cut_inner[itype][jtype])
@@ -1015,28 +996,6 @@ void PairLubricateUPoly::compute_RE(double **x)
           a_sh = pre[0]*((8.0*(beta[0][1]+beta[0][3])+4.0*beta[0][2])/15.0
                 +(64.0-180.0*(beta[0][1]+beta[0][3])+232.0*beta[0][2]
                   +64.0*beta[0][4])*h_sep_beta11/375.0)*log_h_sep_beta13;
-
-          a_pu = pre[1]*((0.4*beta[0][1]+0.1*beta[0][2])*beta[1][1]
-                +(0.128-0.132*beta[0][1]+0.332*beta[0][2]
-                  +0.172*beta[0][3])*h_sep)*log_h_sep_beta13;
-
-          /*//a_sq = 6*MY_PI*mu*radi*(1.0/4.0/h_sep + 9.0/40.0*log(1/h_sep));
-          a_sq = beta0*beta0/beta1/beta1/h_sep
-                  +(1.0+7.0*beta0+beta0*beta0)/5.0/pow(beta1,3)*lhsep;
-          a_sq += (1.0+18.0*beta0-29.0*beta0*beta0+18.0*pow(beta0,3)
-                  +pow(beta0,4))/21.0/pow(beta1,4)*h_sep*lhsep;
-          a_sq *= 6.0*MY_PI*mu*radi;
-
-          a_sh = 4.0*beta0*(2.0+beta0
-                  +2.0*beta0*beta0)/15.0/pow(beta1,3)*log(1.0/h_sep);
-          a_sh += 4.0*(16.0-45.0*beta0+58.0*beta0*beta0-45.0*pow(beta0,3)
-                  +16.0*pow(beta0,4))/375.0/pow(beta1,4)*h_sep*log(1.0/h_sep);
-          a_sh *= 6.0*MY_PI*mu*radi;
-
-          a_pu = beta0*(4.0+beta0)/10.0/beta1/beta1*log(1.0/h_sep);
-          a_pu += (32.0-33.0*beta0+83.0*beta0*beta0
-                  +43.0*pow(beta0,3))/250.0/pow(beta1,3)*h_sep*log(1.0/h_sep);
-          a_pu *= 8.0*MY_PI*mu*pow(radi,3);*/
         } else
           a_sq = pre[0]*(beta[0][1]*beta[0][1]/(beta[1][1]*beta[1][1]*h_sep));
 
@@ -1098,15 +1057,10 @@ void PairLubricateUPoly::compute_RE(double **x)
           torque[i][1] -= vxmu2f*ty;
           torque[i][2] -= vxmu2f*tz;
 
-          // NOTE No a_pu term needed as they add up to zero
         }
       }
     }
   }
-
-  int print_overlaps = 0;
-  if (print_overlaps && overlaps)
-    printf("Number of overlaps=%d\n",overlaps);
 }
 
 /*-----------------------------------------------------------------------
diff --git a/src/FLD/pair_lubricate_poly.cpp b/src/FLD/pair_lubricate_poly.cpp
index d37cc4c005..5f368f4786 100644
--- a/src/FLD/pair_lubricate_poly.cpp
+++ b/src/FLD/pair_lubricate_poly.cpp
@@ -93,8 +93,6 @@ void PairLubricatePoly::compute(int eflag, int vflag)
   int nlocal = atom->nlocal;
   int newton_pair = force->newton_pair;
 
-  int overlaps = 0;
-
   inum = list->inum;
   ilist = list->ilist;
   numneigh = list->numneigh;
@@ -285,10 +283,6 @@ void PairLubricatePoly::compute(int eflag, int vflag)
 
         h_sep = r - radi-radj;
 
-        // check for overlaps
-
-        if (h_sep < 0.0) overlaps++;
-
         // if less than the minimum gap use the minimum gap instead
 
         if (r < cut_inner[itype][jtype])
@@ -429,16 +423,6 @@ void PairLubricatePoly::compute(int eflag, int vflag)
       omega[i][2] -= 0.5*h_rate[5];
     }
   }
-
-  // to DEBUG: set print_overlaps to 1
-
-  int print_overlaps = 0;
-  if (print_overlaps) {
-    int overlaps_all;
-    MPI_Allreduce(&overlaps,&overlaps_all,1,MPI_INT,MPI_SUM,world);
-    if (overlaps_all && comm->me == 0)
-      printf("Number of overlaps = %d\n",overlaps);
-  }
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/GPU/pair_beck_gpu.h b/src/GPU/pair_beck_gpu.h
index 87c4cd57b2..d498f33866 100644
--- a/src/GPU/pair_beck_gpu.h
+++ b/src/GPU/pair_beck_gpu.h
@@ -38,7 +38,6 @@ class PairBeckGPU : public PairBeck {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_born_coul_long_gpu.h b/src/GPU/pair_born_coul_long_gpu.h
index 5fc5a716fa..2a70e29284 100644
--- a/src/GPU/pair_born_coul_long_gpu.h
+++ b/src/GPU/pair_born_coul_long_gpu.h
@@ -38,7 +38,6 @@ class PairBornCoulLongGPU : public PairBornCoulLong {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_born_coul_wolf_gpu.h b/src/GPU/pair_born_coul_wolf_gpu.h
index 290d7a6fbf..2f5dd032a1 100644
--- a/src/GPU/pair_born_coul_wolf_gpu.h
+++ b/src/GPU/pair_born_coul_wolf_gpu.h
@@ -38,7 +38,6 @@ class PairBornCoulWolfGPU : public PairBornCoulWolf {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_born_gpu.h b/src/GPU/pair_born_gpu.h
index de1dd54d04..215ef2fa66 100644
--- a/src/GPU/pair_born_gpu.h
+++ b/src/GPU/pair_born_gpu.h
@@ -38,7 +38,6 @@ class PairBornGPU : public PairBorn {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_buck_coul_cut_gpu.h b/src/GPU/pair_buck_coul_cut_gpu.h
index e4535a197b..412dea6d96 100644
--- a/src/GPU/pair_buck_coul_cut_gpu.h
+++ b/src/GPU/pair_buck_coul_cut_gpu.h
@@ -38,7 +38,6 @@ class PairBuckCoulCutGPU : public PairBuckCoulCut {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_buck_coul_long_gpu.h b/src/GPU/pair_buck_coul_long_gpu.h
index 8c8315b1c9..3342190a29 100644
--- a/src/GPU/pair_buck_coul_long_gpu.h
+++ b/src/GPU/pair_buck_coul_long_gpu.h
@@ -38,7 +38,6 @@ class PairBuckCoulLongGPU : public PairBuckCoulLong {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_buck_gpu.h b/src/GPU/pair_buck_gpu.h
index 8f8daab983..b907bd501f 100644
--- a/src/GPU/pair_buck_gpu.h
+++ b/src/GPU/pair_buck_gpu.h
@@ -38,7 +38,6 @@ class PairBuckGPU : public PairBuck {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_colloid_gpu.h b/src/GPU/pair_colloid_gpu.h
index 861bc0a6bd..41939557af 100644
--- a/src/GPU/pair_colloid_gpu.h
+++ b/src/GPU/pair_colloid_gpu.h
@@ -38,7 +38,6 @@ class PairColloidGPU : public PairColloid {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_coul_dsf_gpu.cpp b/src/GPU/pair_coul_dsf_gpu.cpp
index dc7e8a1d23..4b5e2b5bfe 100644
--- a/src/GPU/pair_coul_dsf_gpu.cpp
+++ b/src/GPU/pair_coul_dsf_gpu.cpp
@@ -199,7 +199,7 @@ void PairCoulDSFGPU::cpu_compute(int start, int inum, int eflag, int vflag,
                                  int *ilist, int *numneigh,
                                  int **firstneigh)
 {
-  int i,j,ii,jj,jnum,itype,jtype;
+  int i,j,ii,jj,jnum;
   double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,ecoul,fpair;
   double r,rsq,r2inv,forcecoul,factor_coul;
   double prefactor,erfcc,erfcd,e_self,t;
@@ -210,7 +210,6 @@ void PairCoulDSFGPU::cpu_compute(int start, int inum, int eflag, int vflag,
   double **x = atom->x;
   double **f = atom->f;
   double *q = atom->q;
-  int *type = atom->type;
   int nlocal = atom->nlocal;
   double *special_coul = force->special_coul;
   double qqrd2e = force->qqrd2e;
@@ -223,7 +222,6 @@ void PairCoulDSFGPU::cpu_compute(int start, int inum, int eflag, int vflag,
     xtmp = x[i][0];
     ytmp = x[i][1];
     ztmp = x[i][2];
-    itype = type[i];
     jlist = firstneigh[i];
     jnum = numneigh[i];
 
@@ -241,7 +239,6 @@ void PairCoulDSFGPU::cpu_compute(int start, int inum, int eflag, int vflag,
       dely = ytmp - x[j][1];
       delz = ztmp - x[j][2];
       rsq = delx*delx + dely*dely + delz*delz;
-      jtype = type[j];
 
       if (rsq < cut_coulsq) {
         r2inv = 1.0/rsq;
diff --git a/src/GPU/pair_coul_dsf_gpu.h b/src/GPU/pair_coul_dsf_gpu.h
index e98962e528..6b873823b6 100644
--- a/src/GPU/pair_coul_dsf_gpu.h
+++ b/src/GPU/pair_coul_dsf_gpu.h
@@ -38,7 +38,6 @@ class PairCoulDSFGPU : public PairCoulDSF {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_coul_long_gpu.cpp b/src/GPU/pair_coul_long_gpu.cpp
index 5acad5aa88..62264f62cd 100644
--- a/src/GPU/pair_coul_long_gpu.cpp
+++ b/src/GPU/pair_coul_long_gpu.cpp
@@ -187,20 +187,19 @@ void PairCoulLongGPU::cpu_compute(int start, int inum, int eflag,
                                   int vflag, int *ilist, int *numneigh,
                                   int **firstneigh)
 {
-  int i,j,ii,jj,jnum,itype,jtype,itable;
-  double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul,fpair;
+  int i,j,ii,jj,jnum,itable;
+  double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,ecoul,fpair;
   double fraction,table;
-  double r,r2inv,r6inv,forcecoul,forcelj,factor_coul,factor_lj;
+  double r,r2inv,r6inv,forcecoul,factor_coul;
   double grij,expm2,prefactor,t,erfc;
   int *jlist;
   double rsq;
 
-  evdwl = ecoul = 0.0;
+  ecoul = 0.0;
 
   double **x = atom->x;
   double **f = atom->f;
   double *q = atom->q;
-  int *type = atom->type;
   double *special_coul = force->special_coul;
   double qqrd2e = force->qqrd2e;
 
@@ -212,7 +211,6 @@ void PairCoulLongGPU::cpu_compute(int start, int inum, int eflag,
     xtmp = x[i][0];
     ytmp = x[i][1];
     ztmp = x[i][2];
-    itype = type[i];
     jlist = firstneigh[i];
     jnum = numneigh[i];
 
@@ -225,7 +223,6 @@ void PairCoulLongGPU::cpu_compute(int start, int inum, int eflag,
       dely = ytmp - x[j][1];
       delz = ztmp - x[j][2];
       rsq = delx*delx + dely*dely + delz*delz;
-      jtype = type[j];
 
       r2inv = 1.0/rsq;
 
diff --git a/src/GPU/pair_coul_long_gpu.h b/src/GPU/pair_coul_long_gpu.h
index 42285481ab..a8eabd2a49 100644
--- a/src/GPU/pair_coul_long_gpu.h
+++ b/src/GPU/pair_coul_long_gpu.h
@@ -38,7 +38,6 @@ class PairCoulLongGPU : public PairCoulLong {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_dpd_gpu.h b/src/GPU/pair_dpd_gpu.h
index e3e5fc508a..cfe26f830a 100644
--- a/src/GPU/pair_dpd_gpu.h
+++ b/src/GPU/pair_dpd_gpu.h
@@ -38,7 +38,6 @@ class PairDPDGPU : public PairDPD {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_dpd_tstat_gpu.h b/src/GPU/pair_dpd_tstat_gpu.h
index ce4f07494e..2217b509d6 100644
--- a/src/GPU/pair_dpd_tstat_gpu.h
+++ b/src/GPU/pair_dpd_tstat_gpu.h
@@ -38,7 +38,6 @@ class PairDPDTstatGPU : public PairDPDTstat {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_eam_gpu.cpp b/src/GPU/pair_eam_gpu.cpp
index 847391ea51..e917ba56b5 100644
--- a/src/GPU/pair_eam_gpu.cpp
+++ b/src/GPU/pair_eam_gpu.cpp
@@ -94,8 +94,7 @@ double PairEAMGPU::memory_usage()
 
 void PairEAMGPU::compute(int eflag, int vflag)
 {
-  int i,j,ii,jj,m,jnum,itype,jtype;
-  double evdwl,*coeff;
+  double evdwl;
 
   evdwl = 0.0;
   if (eflag || vflag) ev_setup(eflag,vflag);
diff --git a/src/GPU/pair_eam_gpu.h b/src/GPU/pair_eam_gpu.h
index 8766e5a5bb..0efc1a79f0 100644
--- a/src/GPU/pair_eam_gpu.h
+++ b/src/GPU/pair_eam_gpu.h
@@ -43,7 +43,6 @@ class PairEAMGPU : public PairEAM {
  protected:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
   void *fp_pinned;
   bool fp_single;
 };
diff --git a/src/GPU/pair_gauss_gpu.cpp b/src/GPU/pair_gauss_gpu.cpp
index 8ea04d403b..65837728c6 100644
--- a/src/GPU/pair_gauss_gpu.cpp
+++ b/src/GPU/pair_gauss_gpu.cpp
@@ -172,7 +172,7 @@ void PairGaussGPU::cpu_compute(int start, int inum, int eflag, int vflag,
                                int *ilist, int *numneigh, int **firstneigh) {
   int i,j,ii,jj,jnum,itype,jtype;
   double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
-  double r,rsq,r2inv,forcelj,factor_lj;
+  double rsq,r2inv,forcelj,factor_lj;
   int *jlist;
 
   double **x = atom->x;
@@ -204,7 +204,6 @@ void PairGaussGPU::cpu_compute(int start, int inum, int eflag, int vflag,
 
       if (rsq < cutsq[itype][jtype]) {
         r2inv = 1.0/rsq;
-        r = sqrt(rsq);
         forcelj = - 2.0*a[itype][jtype]*b[itype][jtype] * rsq * 
           exp(-b[itype][jtype]*rsq); 
         fpair = factor_lj*forcelj*r2inv;
diff --git a/src/GPU/pair_gauss_gpu.h b/src/GPU/pair_gauss_gpu.h
index 6334ac9852..39ce13e6a1 100644
--- a/src/GPU/pair_gauss_gpu.h
+++ b/src/GPU/pair_gauss_gpu.h
@@ -38,7 +38,6 @@ class PairGaussGPU : public PairGauss {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_gayberne_gpu.h b/src/GPU/pair_gayberne_gpu.h
index 4c64376482..e6e7a75788 100644
--- a/src/GPU/pair_gayberne_gpu.h
+++ b/src/GPU/pair_gayberne_gpu.h
@@ -38,7 +38,6 @@ class PairGayBerneGPU : public PairGayBerne {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
   int quat_nmax;
   double **quat;
 };
diff --git a/src/GPU/pair_lj96_cut_gpu.h b/src/GPU/pair_lj96_cut_gpu.h
index 43c63354dc..55c1834167 100644
--- a/src/GPU/pair_lj96_cut_gpu.h
+++ b/src/GPU/pair_lj96_cut_gpu.h
@@ -38,7 +38,6 @@ class PairLJ96CutGPU : public PairLJ96Cut {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_lj_charmm_coul_long_gpu.h b/src/GPU/pair_lj_charmm_coul_long_gpu.h
index a4a2799521..f904c774e3 100644
--- a/src/GPU/pair_lj_charmm_coul_long_gpu.h
+++ b/src/GPU/pair_lj_charmm_coul_long_gpu.h
@@ -38,7 +38,6 @@ class PairLJCharmmCoulLongGPU : public PairLJCharmmCoulLong {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_lj_class2_coul_long_gpu.h b/src/GPU/pair_lj_class2_coul_long_gpu.h
index 096ae41860..5f235ea1ee 100644
--- a/src/GPU/pair_lj_class2_coul_long_gpu.h
+++ b/src/GPU/pair_lj_class2_coul_long_gpu.h
@@ -38,7 +38,6 @@ class PairLJClass2CoulLongGPU : public PairLJClass2CoulLong {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_lj_class2_gpu.h b/src/GPU/pair_lj_class2_gpu.h
index 2512a6cdba..1f4cc74e3f 100644
--- a/src/GPU/pair_lj_class2_gpu.h
+++ b/src/GPU/pair_lj_class2_gpu.h
@@ -38,7 +38,6 @@ class PairLJClass2GPU : public PairLJClass2 {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_lj_cut_coul_cut_gpu.h b/src/GPU/pair_lj_cut_coul_cut_gpu.h
index 036b084549..f0e71e3c76 100644
--- a/src/GPU/pair_lj_cut_coul_cut_gpu.h
+++ b/src/GPU/pair_lj_cut_coul_cut_gpu.h
@@ -38,7 +38,6 @@ class PairLJCutCoulCutGPU : public PairLJCutCoulCut {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_lj_cut_coul_debye_gpu.h b/src/GPU/pair_lj_cut_coul_debye_gpu.h
index 25a94bf404..2f396974ef 100644
--- a/src/GPU/pair_lj_cut_coul_debye_gpu.h
+++ b/src/GPU/pair_lj_cut_coul_debye_gpu.h
@@ -38,7 +38,6 @@ class PairLJCutCoulDebyeGPU : public PairLJCutCoulDebye {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_lj_cut_coul_dsf_gpu.h b/src/GPU/pair_lj_cut_coul_dsf_gpu.h
index 0454d362cf..c52f8c8102 100644
--- a/src/GPU/pair_lj_cut_coul_dsf_gpu.h
+++ b/src/GPU/pair_lj_cut_coul_dsf_gpu.h
@@ -38,7 +38,6 @@ class PairLJCutCoulDSFGPU : public PairLJCutCoulDSF {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_lj_cut_coul_long_gpu.h b/src/GPU/pair_lj_cut_coul_long_gpu.h
index 1904203925..760c1a8baf 100644
--- a/src/GPU/pair_lj_cut_coul_long_gpu.h
+++ b/src/GPU/pair_lj_cut_coul_long_gpu.h
@@ -38,7 +38,6 @@ class PairLJCutCoulLongGPU : public PairLJCutCoulLong {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_lj_cut_coul_msm_gpu.h b/src/GPU/pair_lj_cut_coul_msm_gpu.h
index c125edcd6d..2a601f6dd8 100644
--- a/src/GPU/pair_lj_cut_coul_msm_gpu.h
+++ b/src/GPU/pair_lj_cut_coul_msm_gpu.h
@@ -38,7 +38,6 @@ class PairLJCutCoulMSMGPU : public PairLJCutCoulMSM {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_lj_cut_dipole_cut_gpu.h b/src/GPU/pair_lj_cut_dipole_cut_gpu.h
index ba0827b23f..70612a20e6 100755
--- a/src/GPU/pair_lj_cut_dipole_cut_gpu.h
+++ b/src/GPU/pair_lj_cut_dipole_cut_gpu.h
@@ -38,7 +38,6 @@ class PairLJCutDipoleCutGPU : public PairLJCutDipoleCut {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_lj_cut_gpu.h b/src/GPU/pair_lj_cut_gpu.h
index 0229adc62b..5f26e24461 100644
--- a/src/GPU/pair_lj_cut_gpu.h
+++ b/src/GPU/pair_lj_cut_gpu.h
@@ -38,7 +38,6 @@ class PairLJCutGPU : public PairLJCut {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_lj_expand_gpu.h b/src/GPU/pair_lj_expand_gpu.h
index 2187ab254f..c0821b9ebd 100644
--- a/src/GPU/pair_lj_expand_gpu.h
+++ b/src/GPU/pair_lj_expand_gpu.h
@@ -38,7 +38,6 @@ class PairLJExpandGPU : public PairLJExpand {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_lj_gromacs_gpu.h b/src/GPU/pair_lj_gromacs_gpu.h
index 011da3e291..9eca2c8864 100644
--- a/src/GPU/pair_lj_gromacs_gpu.h
+++ b/src/GPU/pair_lj_gromacs_gpu.h
@@ -38,7 +38,6 @@ class PairLJGromacsGPU : public PairLJGromacs {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_lj_sdk_coul_long_gpu.h b/src/GPU/pair_lj_sdk_coul_long_gpu.h
index f8530bf352..61de272979 100644
--- a/src/GPU/pair_lj_sdk_coul_long_gpu.h
+++ b/src/GPU/pair_lj_sdk_coul_long_gpu.h
@@ -40,7 +40,6 @@ class PairLJSDKCoulLongGPU : public PairLJSDKCoulLong {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_lj_sdk_gpu.cpp b/src/GPU/pair_lj_sdk_gpu.cpp
index 8adfd1f3dd..b50bbe1e3b 100644
--- a/src/GPU/pair_lj_sdk_gpu.cpp
+++ b/src/GPU/pair_lj_sdk_gpu.cpp
@@ -186,9 +186,9 @@ void PairLJSDKGPU::cpu_compute(int start, int inum, int *ilist,
   const double * const * const x = atom->x;
   double * const * const f = atom->f;
   const int * const type = atom->type;
-  const int nlocal = atom->nlocal;
   const double * const special_lj = force->special_lj;
   double fxtmp,fytmp,fztmp;
+  evdwl=0.0;
 
   // loop over neighbors of my atoms
 
diff --git a/src/GPU/pair_lj_sdk_gpu.h b/src/GPU/pair_lj_sdk_gpu.h
index c99ea363bc..610fb8b0e4 100644
--- a/src/GPU/pair_lj_sdk_gpu.h
+++ b/src/GPU/pair_lj_sdk_gpu.h
@@ -40,7 +40,6 @@ class PairLJSDKGPU : public PairLJSDK {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_lj_sf_dipole_sf_gpu.h b/src/GPU/pair_lj_sf_dipole_sf_gpu.h
index 21452f8f85..ba37f97694 100755
--- a/src/GPU/pair_lj_sf_dipole_sf_gpu.h
+++ b/src/GPU/pair_lj_sf_dipole_sf_gpu.h
@@ -38,7 +38,6 @@ class PairLJSFDipoleSFGPU : public PairLJSFDipoleSF {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_mie_cut_gpu.h b/src/GPU/pair_mie_cut_gpu.h
index 8ee084ccdd..fc5223fb7c 100644
--- a/src/GPU/pair_mie_cut_gpu.h
+++ b/src/GPU/pair_mie_cut_gpu.h
@@ -38,7 +38,6 @@ class PairMIECutGPU : public PairMIECut {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_morse_gpu.h b/src/GPU/pair_morse_gpu.h
index 13dd0ab796..5a5c2de892 100644
--- a/src/GPU/pair_morse_gpu.h
+++ b/src/GPU/pair_morse_gpu.h
@@ -38,7 +38,6 @@ class PairMorseGPU : public PairMorse {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_resquared_gpu.h b/src/GPU/pair_resquared_gpu.h
index 7250886167..42e8dbc4f1 100644
--- a/src/GPU/pair_resquared_gpu.h
+++ b/src/GPU/pair_resquared_gpu.h
@@ -38,7 +38,6 @@ class PairRESquaredGPU : public PairRESquared {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
   int quat_nmax;
   double **quat;
 };
diff --git a/src/GPU/pair_soft_gpu.h b/src/GPU/pair_soft_gpu.h
index ccb800990c..fcc8372336 100644
--- a/src/GPU/pair_soft_gpu.h
+++ b/src/GPU/pair_soft_gpu.h
@@ -38,7 +38,6 @@ class PairSoftGPU : public PairSoft {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_sw_gpu.h b/src/GPU/pair_sw_gpu.h
index 6b49a4937e..559c4f70cc 100644
--- a/src/GPU/pair_sw_gpu.h
+++ b/src/GPU/pair_sw_gpu.h
@@ -39,7 +39,6 @@ class PairSWGPU : public PairSW {
 
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_table_gpu.h b/src/GPU/pair_table_gpu.h
index 4e6640abd3..11ce514cbd 100644
--- a/src/GPU/pair_table_gpu.h
+++ b/src/GPU/pair_table_gpu.h
@@ -38,7 +38,6 @@ class PairTableGPU : public PairTable {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_yukawa_colloid_gpu.h b/src/GPU/pair_yukawa_colloid_gpu.h
index c845a8d87d..cea1c8e0d6 100644
--- a/src/GPU/pair_yukawa_colloid_gpu.h
+++ b/src/GPU/pair_yukawa_colloid_gpu.h
@@ -38,7 +38,6 @@ class PairYukawaColloidGPU : public PairYukawaColloid {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GPU/pair_yukawa_gpu.h b/src/GPU/pair_yukawa_gpu.h
index 85bc3d0b70..bdf87a78b4 100644
--- a/src/GPU/pair_yukawa_gpu.h
+++ b/src/GPU/pair_yukawa_gpu.h
@@ -38,7 +38,6 @@ class PairYukawaGPU : public PairYukawa {
  private:
   int gpu_mode;
   double cpu_time;
-  int *gpulist;
 };
 
 }
diff --git a/src/GRANULAR/pair_gran_hertz_history.cpp b/src/GRANULAR/pair_gran_hertz_history.cpp
index 0e19bec724..0a0d7c5926 100644
--- a/src/GRANULAR/pair_gran_hertz_history.cpp
+++ b/src/GRANULAR/pair_gran_hertz_history.cpp
@@ -41,7 +41,7 @@ PairGranHertzHistory::PairGranHertzHistory(LAMMPS *lmp) :
 
 void PairGranHertzHistory::compute(int eflag, int vflag)
 {
-  int i,j,ii,jj,inum,jnum,itype,jtype;
+  int i,j,ii,jj,inum,jnum;
   double xtmp,ytmp,ztmp,delx,dely,delz,fx,fy,fz;
   double radi,radj,radsum,rsq,r,rinv,rsqinv;
   double vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3;
@@ -417,7 +417,6 @@ double PairGranHertzHistory::single(int i, int j, int itype, int jtype,
   // start from neighprev, since will typically be next neighbor
   // reset neighprev to 0 as necessary
 
-  int *jlist = list->firstneigh[i];
   int jnum = list->numneigh[i];
   int *touch = list->listgranhistory->firstneigh[i];
   double *allshear = list->listgranhistory->firstdouble[i];
diff --git a/src/KSPACE/ewald_disp.cpp b/src/KSPACE/ewald_disp.cpp
index 39951b8b0c..e576c13c16 100644
--- a/src/KSPACE/ewald_disp.cpp
+++ b/src/KSPACE/ewald_disp.cpp
@@ -119,7 +119,6 @@ void EwaldDisp::init()
   for (int i=0; i<=EWALD_NORDER; ++i)                        // transcribe order
     if (ewald_order&(1<<i)) {                                // from pair_style
       int n[] = EWALD_NSUMS, k = 0;
-      char str[128];
       switch (i) {
         case 1:
           k = 0; break;
@@ -767,7 +766,6 @@ void EwaldDisp::compute_force()
   double *ke, c[EWALD_NFUNCS] = {
     8.0*MY_PI*qscale/volume, 2.0*MY_PI*MY_PIS/(12.0*volume),
     2.0*MY_PI*MY_PIS/(192.0*volume), 8.0*MY_PI*mumurd2e/volume};
-  double kt = 4.0*cube(g_ewald)/3.0/MY_PIS/c[3];
   int i, kx, ky, lbytes = (2*nbox+1)*sizeof(cvector), *type = atom->type;
   int func[EWALD_NFUNCS];
 
@@ -1103,7 +1101,6 @@ void EwaldDisp::compute_virial_dipole()
 {
   if (!function[3]) return;
   if (!vflag_atom && !vflag_global) return;
-  double test = 0.0;
   kvector *k;
   hvector *h, *nh;
   cvector *z = ekr_local;
@@ -1119,7 +1116,6 @@ void EwaldDisp::compute_virial_dipole()
   double *ke, c[EWALD_NFUNCS] = {
     8.0*MY_PI*qscale/volume, 2.0*MY_PI*MY_PIS/(12.0*volume),
     2.0*MY_PI*MY_PIS/(192.0*volume), 8.0*MY_PI*mumurd2e/volume};
-  double kt = 4.0*cube(g_ewald)/3.0/MY_PIS/c[3];
   int i, kx, ky, lbytes = (2*nbox+1)*sizeof(cvector), *type = atom->type;
   int func[EWALD_NFUNCS];
 
diff --git a/src/KSPACE/pair_tip4p_long.cpp b/src/KSPACE/pair_tip4p_long.cpp
index c08b422229..fbe146ecf2 100644
--- a/src/KSPACE/pair_tip4p_long.cpp
+++ b/src/KSPACE/pair_tip4p_long.cpp
@@ -79,18 +79,17 @@ void PairTIP4PLong::compute(int eflag, int vflag)
   int i,j,ii,jj,inum,jnum,itype,jtype,itable,key;
   int n,vlist[6];
   int iH1,iH2,jH1,jH2;
-  double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul;
+  double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,ecoul;
   double fraction,table;
-  double delxOM, delyOM, delzOM;
   double r,r2inv,forcecoul,cforce;
   double factor_coul;
-  double grij,expm2,prefactor,t,erfc,ddotf;
-  double xiM[3],xjM[3],fO[3],fH[3],fd[3],f1[3],v[6],xH1[3],xH2[3];
+  double grij,expm2,prefactor,t,erfc;
+  double fO[3],fH[3],fd[3],v[6],xH1[3],xH2[3];
   double *x1,*x2;
   int *ilist,*jlist,*numneigh,**firstneigh;
   double rsq;
 
-  evdwl = ecoul = 0.0;
+  ecoul = 0.0;
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
 
@@ -118,7 +117,6 @@ void PairTIP4PLong::compute(int eflag, int vflag)
   tagint *tag = atom->tag;
   int *type = atom->type;
   double *special_coul = force->special_coul;
-  int newton_pair = force->newton_pair;
   double qqrd2e = force->qqrd2e;
   double cut_coulsqplus = (cut_coul+2.0*qdist) * (cut_coul+2.0*qdist);
 
diff --git a/src/KSPACE/pppm_stagger.cpp b/src/KSPACE/pppm_stagger.cpp
index 23c55b8cee..530418fab1 100755
--- a/src/KSPACE/pppm_stagger.cpp
+++ b/src/KSPACE/pppm_stagger.cpp
@@ -294,7 +294,7 @@ double PPPMStagger::compute_qopt()
   double numerator,denominator;
   double u1,u2,u3,sqk;
 
-  int k,l,m,n,nx,ny,nz,kper,lper,mper;
+  int k,l,m,nx,ny,nz,kper,lper,mper;
 
   const int nbx = 2;
   const int nby = 2;
@@ -302,7 +302,6 @@ double PPPMStagger::compute_qopt()
 
   const int twoorder = 2*order;
 
-  n = 0;
   for (m = nzlo_fft; m <= nzhi_fft; m++) {
     mper = m - nz_pppm*(2*m/nz_pppm);
     snz = square(sin(0.5*unitkz*mper*zprd_slab/nz_pppm));
@@ -381,13 +380,11 @@ double PPPMStagger::compute_qopt_ad()
   const double unitky = (MY_2PI/yprd);
   const double unitkz = (MY_2PI/zprd_slab);
 
-  double snx,sny,snz;
-  double cnx,cny,cnz;
   double argx,argy,argz,wx,wy,wz,sx,sy,sz,qx,qy,qz;
   double sum1,sum2,sum3,sum4,sum5,sum6,dot2;
   double u1,u2,sqk;
 
-  int k,l,m,n,nx,ny,nz,kper,lper,mper;
+  int k,l,m,nx,ny,nz,kper,lper,mper;
 
   const int nbx = 2;
   const int nby = 2;
@@ -395,21 +392,14 @@ double PPPMStagger::compute_qopt_ad()
 
   const int twoorder = 2*order;
 
-  n = 0;
   for (m = nzlo_fft; m <= nzhi_fft; m++) {
     mper = m - nz_pppm*(2*m/nz_pppm);
-    snz = square(sin(0.5*unitkz*mper*zprd_slab/nz_pppm));
-    cnz = cos(0.5*unitkz*mper*zprd_slab/nz_pppm);
 
     for (l = nylo_fft; l <= nyhi_fft; l++) {
       lper = l - ny_pppm*(2*l/ny_pppm);
-      sny = square(sin(0.5*unitky*lper*yprd/ny_pppm));
-      cny = cos(0.5*unitky*lper*yprd/ny_pppm);
 
       for (k = nxlo_fft; k <= nxhi_fft; k++) {
         kper = k - nx_pppm*(2*k/nx_pppm);
-        snx = square(sin(0.5*unitkx*kper*xprd/nx_pppm));
-        cnx = cos(0.5*unitkx*kper*xprd/nx_pppm);
 
         sqk = square(unitkx*kper) + square(unitky*lper) + square(unitkz*mper);
 
diff --git a/src/MANYBODY/pair_bop.cpp b/src/MANYBODY/pair_bop.cpp
index 6bfabaf3e0..81bd1e2f12 100644
--- a/src/MANYBODY/pair_bop.cpp
+++ b/src/MANYBODY/pair_bop.cpp
@@ -655,7 +655,6 @@ void PairBOP::gneigh()
 {
   int i,ii;
   int *ilist,*numneigh;
-  int **firstneigh;
   int nlocal = atom->nlocal;
   int nall = nlocal + atom->nghost;
 
@@ -671,7 +670,6 @@ void PairBOP::gneigh()
   }
   ilist = list->ilist;
   numneigh = list->numneigh;
-  firstneigh = list->firstneigh;
   if(bop_step==0) {
     maxneigh=0;
     maxnall=0;
@@ -700,7 +698,7 @@ void PairBOP::gneigh()
 
 void PairBOP::theta()
 {
-  int i,j,k,ii,jj,kk;
+  int i,j,ii,jj,kk;
   int itype,jtype,i12;
   int temp_ij,temp_ik,temp_ijk;
   int n,nlocal,nall,ks;
@@ -708,7 +706,7 @@ void PairBOP::theta()
   int *iilist;
   int **firstneigh;
   double rj2,rk2,rsq,ps;
-  double rj1k1,rj2k2,rj2k1,rj1k2;
+  double rj1k1,rj2k2;
   double **x = atom->x;
   int *type = atom->type;
 
@@ -799,9 +797,6 @@ void PairBOP::theta()
         rk2=rij[temp_ik]*rij[temp_ik];
         rj1k1=rij[temp_ij]*rij[temp_ik];
         rj2k2=rj1k1*rj1k1;
-        rj2k1=rj1k1*rij[temp_ij];
-        rj1k2=rj1k1*rij[temp_ik];
-        k=iilist[kk];
         if(temp_ijk>=cos_total) {
           error->one(FLERR,"Too many atom triplets for pair bop");
         }
@@ -858,14 +853,14 @@ void PairBOP::sigmaBo()
   int new1,new2,nlocal;
   int inum,*ilist,*iilist,*jlist,*klist,*kplist;
   int **firstneigh,*numneigh;
-  int temp_ji,temp_ikp,temp_ki,temp_kkp;
+  int temp_ji,temp_ikp,temp_kkp;
   int temp_ij,temp_ik,temp_jkp,temp_kk,temp_jk;
   int ang_ijkp,ang_ikkp,ang_jkpk,ang_kjkp;
   int ang_ijk,ang_ikj,ang_jikp,ang_jkkp;
   int ang_jik,ang_kikp;
   int nb_ij,nb_ik,nb_ikp;
   int nb_jk,nb_jkp,nb_kkp;
-  int kp_nsearch,nsearch;
+  int nsearch;
   int sig_flag,setting,ncmp,ks;
   int itype,jtype,ktype,kptype;
   int bt_i,bt_j,bt_ij;
@@ -952,7 +947,6 @@ void PairBOP::sigmaBo()
         j=iilist[jtmp];
         jlist=firstneigh[j];
         for(ki=0;ki<numneigh[j];ki++) {
-          temp_ki=BOP_index[j]+ki;
           if(x[jlist[ki]][0]==x[i][0]) {
             if(x[jlist[ki]][1]==x[i][1]) {
               if(x[jlist[ki]][2]==x[i][2]) {
@@ -1039,7 +1033,6 @@ void PairBOP::sigmaBo()
 
                 klist=firstneigh[k];
                 for(kNeii=0;kNeii<numneigh[k];kNeii++) {
-                  temp_ki=BOP_index[k]+kNeii;
                   if(x[klist[kNeii]][0]==x[i][0]) {
                     if(x[klist[kNeii]][1]==x[i][1]) {
                       if(x[klist[kNeii]][2]==x[i][2]) {
@@ -1572,7 +1565,6 @@ void PairBOP::sigmaBo()
                       }
                       if(sig_flag==1) {
                         for(nsearch=0;nsearch<numneigh[kp];nsearch++) {
-                          kp_nsearch=BOP_index[kp]+nsearch;
                           ncmp=kplist[nsearch];
                           if(x[ncmp][0]==x[j][0]) {
                             if(x[ncmp][1]==x[j][1]) {
@@ -2402,7 +2394,7 @@ void PairBOP::sigmaBo_noa()
   int iij,ji,ki;
   int itmp,jtmp,ktmp,ltmp,mtmp;
   tagint i_tag,j_tag;
-  int ngi,ngj,ngk,ngli,nglj,ngl;
+  int ngi,ngj,ngk;
   int ngji,ngjk,nikj,ngki,ngkj;
   int njik,nijk,nikkp,nkp,nijkp;
   int nkikp,njikp,nk0,nkjkp,njkkp;
@@ -2410,7 +2402,7 @@ void PairBOP::sigmaBo_noa()
   int new1,new2,nlocal,nsearch;
   int inum,*ilist,*iilist,*jlist,*klist;
   int **firstneigh,*numneigh;
-  int temp_ji,temp_ikp,temp_ki,temp_kkp;
+  int temp_ji,temp_ikp,temp_kkp;
   int temp_ij,temp_ik,temp_jkp,temp_kk,temp_jk;
   int ang_ijkp,ang_ikkp,ang_kjkp;
   int ang_ijk,ang_ikj,ang_jikp,ang_jkkp;
@@ -2422,11 +2414,11 @@ void PairBOP::sigmaBo_noa()
   int kp_index,same_ikp,same_jkp;
   double AA,BB,CC,DD,EE1,FF;
   double AAC,BBC,CCC,DDC,EEC;
-  double UT,bndtmp,UTcom;
+  double UT,bndtmp;
   double amean,gmean0,gmean1,gmean2,ps;
   double gfactor1,gprime1,gsqprime;
   double gfactorsq,gfactor2,gprime2;
-  double gfactorsq2,gsqprime2;
+  double gfactorsq2;
   double gfactor3,gprime3,gfactor,rfactor;
   double rfactorrt,rfactor1rt,rfactor1;
   double rcm1,rcm2,gcm1,gcm2,gcm3;
@@ -2488,7 +2480,6 @@ void PairBOP::sigmaBo_noa()
         j=iilist[jtmp];
         jlist=firstneigh[j];
         for(ki=0;ki<numneigh[j];ki++) {
-          temp_ki=BOP_index[j]+ki;
           if(x[jlist[ki]][0]==x[i][0]) {
             if(x[jlist[ki]][1]==x[i][1]) {
               if(x[jlist[ki]][2]==x[i][2]) {
@@ -2573,7 +2564,6 @@ void PairBOP::sigmaBo_noa()
 
                 klist=firstneigh[k];
                 for(kNeii=0;kNeii<numneigh[k];kNeii++) {
-                  temp_ki=BOP_index[k]+kNeii;
                   if(x[klist[kNeii]][0]==x[i][0]) {
                     if(x[klist[kNeii]][1]==x[i][1]) {
                       if(x[klist[kNeii]][2]==x[i][2]) {
@@ -2831,18 +2821,12 @@ void PairBOP::sigmaBo_noa()
                       }
                       if(jtmp<ltmp) {
                         njikp=jtmp*(2*numneigh[i]-jtmp-1)/2+(ltmp-jtmp)-1;
-                        nglj=0;
-                        ngl=1;
-                      }
-                      else {
+                      } else {
                         njikp=ltmp*(2*numneigh[i]-ltmp-1)/2+(jtmp-ltmp)-1;
-                        nglj=1;
-                        ngl=0;
                       }
                       if(ktmp<ltmp) {
                         nkikp=ktmp*(2*numneigh[i]-ktmp-1)/2+(ltmp-ktmp)-1;
-                      }
-                      else {
+                      } else {
                         nkikp=ltmp*(2*numneigh[i]-ltmp-1)/2+(ktmp-ltmp)-1;
                       }
                       ang_jikp=cos_index[i]+njikp;
@@ -2904,11 +2888,8 @@ void PairBOP::sigmaBo_noa()
                     if(!same_ikp&&!same_jkp) {
                       if(kNeii<ltmp) {
                         nikkp=kNeii*(2*numneigh[k]-kNeii-1)/2+(ltmp-kNeii)-1;
-                        ngli=0;
-                      }
-                      else {
+                      } else {
                         nikkp=ltmp*(2*numneigh[k]-ltmp-1)/2+(kNeii-ltmp)-1;
-                        ngli=1;
                       }
                       sig_flag=0;
                       for(nsearch=0;nsearch<nSigBk[n];nsearch++) {
@@ -2940,7 +2921,6 @@ void PairBOP::sigmaBo_noa()
                           +gmean2*amean*amean;
                       gprime2=gmean1+2.0*gmean2*amean;
                       gfactorsq2=gfactor2*gfactor2;
-                      gsqprime2=2.0*gfactor2*gprime2;
                       gfactor=gfactorsq*gfactorsq2;
                       rfactorrt=betaS[temp_ik]*betaS[temp_kkp];
                       rfactor=rfactorrt*rfactorrt;
@@ -3076,13 +3056,8 @@ void PairBOP::sigmaBo_noa()
                       }
                       if(ji<ltmp) {
                         nijkp=ji*(2*numneigh[j]-ji-1)/2+(ltmp-ji)-1;
-                        ngli=0;
-                        ngl=1;
-                      }
-                      else {
+                      } else {
                         nijkp=ltmp*(2*numneigh[j]-ltmp-1)/2+(ji-ltmp)-1;
-                        ngli=1;
-                        ngl=0;
                       }
                       if(ktmp<ltmp) {
                         nkjkp=ktmp*(2*numneigh[j]-ktmp-1)/2+(ltmp-ktmp)-1;
@@ -3161,11 +3136,8 @@ void PairBOP::sigmaBo_noa()
                       }
                       if(kNeij<ltmp) {
                         njkkp=kNeij*(2*numneigh[k]-kNeij-1)/2+(ltmp-kNeij)-1;
-                        nglj=0;
-                      }
-                      else {
+                      } else {
                         njkkp=ltmp*(2*numneigh[k]-ltmp-1)/2+(kNeij-ltmp)-1;
-                        nglj=1;
                       }
                       sig_flag=0;
                       for(nsearch=0;nsearch<nSigBk[n];nsearch++) {
@@ -3197,7 +3169,6 @@ void PairBOP::sigmaBo_noa()
                           +gmean2*amean*amean;
                       gprime2=gmean1+2.0*gmean2*amean;
                       gfactorsq2=gfactor2*gfactor2;
-                      gsqprime2=2.0*gfactor2*gprime2;
                       gfactor=gfactorsq*gfactorsq2;
                       rfactorrt=betaS[temp_jk]*betaS[temp_kkp];
                       rfactor=rfactorrt*rfactorrt;
@@ -3247,7 +3218,6 @@ void PairBOP::sigmaBo_noa()
 
             bndtmp=(FF+sigma_delta[iij]*sigma_delta[iij])
                 +sigma_c[iij]*AAC+small4;
-            UTcom=-0.5*UT*UT*UT;
             psign=1.0;
             bndtmp0=1.0/sqrt(bndtmp);
             sigB1[n]=psign*betaS[temp_ij]*bndtmp0;
@@ -3390,11 +3360,11 @@ void PairBOP::sigmaBo_otf()
   int inum,*ilist,*iilist,*jlist,*klist,*kplist;
   int **firstneigh,*numneigh;
   int temp_ij,temp_ik,temp_jkp,temp_kk,temp_jk;
-  int temp_ji,temp_kpj,temp_kkp;
-  int temp_ikp,temp_kpk;
+  int temp_ji,temp_kkp;
+  int temp_ikp;
   int nb_ij,nb_ik,nb_ikp;
   int nb_jk,nb_jkp,nb_kkp;
-  int kp_nsearch,nsearch;
+  int nsearch;
   int sig_flag,setting,ncmp,ks;
   int itype,jtype,ktype,kptype;
   int bt_i,bt_j;
@@ -3418,22 +3388,16 @@ void PairBOP::sigmaBo_otf()
   double bndtmp1,bndtmp2,bndtmp3,bndtmp4,bndtmp5;
   double dis_ij[3],rsq_ij,r_ij;
   double betaS_ij,dBetaS_ij;
-  double betaP_ij,dBetaP_ij;
   double dis_ik[3],rsq_ik,r_ik;
   double betaS_ik,dBetaS_ik;
-  double betaP_ik,dBetaP_ik;
   double dis_ikp[3],rsq_ikp,r_ikp;
   double betaS_ikp,dBetaS_ikp;
-  double betaP_ikp,dBetaP_ikp;
   double dis_jk[3],rsq_jk,r_jk;
   double betaS_jk,dBetaS_jk;
-  double betaP_jk,dBetaP_jk;
   double dis_jkp[3],rsq_jkp,r_jkp;
   double betaS_jkp,dBetaS_jkp;
-  double betaP_jkp,dBetaP_jkp;
   double dis_kkp[3],rsq_kkp,r_kkp;
   double betaS_kkp,dBetaS_kkp;
-  double betaP_kkp,dBetaP_kkp;
   double cosAng_jik,dcA_jik[3][2];
   double cosAng_jikp,dcA_jikp[3][2];
   double cosAng_kikp,dcA_kikp[3][2];
@@ -3554,10 +3518,6 @@ void PairBOP::sigmaBo_otf()
               +pBetaS1[iij][ks-1])*ps+pBetaS[iij][ks-1];
           dBetaS_ij=(pBetaS6[iij][ks-1]*ps+pBetaS5[iij][ks-1])*ps
               +pBetaS4[iij][ks-1];
-          betaP_ij=((pBetaP3[iij][ks-1]*ps+pBetaP2[iij][ks-1])*ps
-              +pBetaP1[iij][ks-1])*ps+pBetaP[iij][ks-1];
-          dBetaP_ij=(pBetaP6[iij][ks-1]*ps+pBetaP5[iij][ks-1])*ps
-              +pBetaP4[iij][ks-1];
           nSigBk[n]=0;
 
 //AA-EE1 are the components making up Eq. 30 (a)
@@ -3629,10 +3589,6 @@ void PairBOP::sigmaBo_otf()
                     +pBetaS1[iik][ks-1])*ps+pBetaS[iik][ks-1];
                 dBetaS_ik=(pBetaS6[iik][ks-1]*ps+pBetaS5[iik][ks-1])*ps
                     +pBetaS4[iik][ks-1];
-                betaP_ik=((pBetaP3[iik][ks-1]*ps+pBetaP2[iik][ks-1])*ps
-                    +pBetaP1[iik][ks-1])*ps+pBetaP[iik][ks-1];
-                dBetaP_ik=(pBetaP6[iik][ks-1]*ps+pBetaP5[iik][ks-1])*ps
-                    +pBetaP4[iik][ks-1];
 
 //find neighbor of i that is equal to k
 
@@ -3792,7 +3748,6 @@ void PairBOP::sigmaBo_otf()
 //loop over neighbors of k
 
                   for(mtmp=0;mtmp<numneigh[k];mtmp++) {
-                    temp_kpj=BOP_index[k]+mtmp;
                     kp2=klist[mtmp];
                     if(x[kp2][0]==x[k][0]) {
                       if(x[kp2][1]==x[k][1]) {
@@ -3834,10 +3789,6 @@ void PairBOP::sigmaBo_otf()
                         +pBetaS1[ijkp][ks-1])*ps+pBetaS[ijkp][ks-1];
                     dBetaS_jkp=(pBetaS6[ijkp][ks-1]*ps+pBetaS5[ijkp][ks-1])*ps
                         +pBetaS4[ijkp][ks-1];
-                    betaP_jkp=((pBetaP3[ijkp][ks-1]*ps+pBetaP2[ijkp][ks-1])*ps
-                        +pBetaP1[ijkp][ks-1])*ps+pBetaP[ijkp][ks-1];
-                    dBetaP_jkp=(pBetaP6[ijkp][ks-1]*ps+pBetaP5[ijkp][ks-1])*ps
-                        +pBetaP4[ijkp][ks-1];
                     cosAng_ijk=(-dis_ij[0]*dis_jk[0]-dis_ij[1]*dis_jk[1]
                         -dis_ij[2]*dis_jk[2])/(r_ij*r_jk);
                     dcA_ijk[0][0]=(dis_jk[0]*r_ij*r_jk-cosAng_ijk
@@ -3976,10 +3927,6 @@ void PairBOP::sigmaBo_otf()
                           +pBetaS1[iikp][ks-1])*ps+pBetaS[iikp][ks-1];
                       dBetaS_ikp=(pBetaS6[iikp][ks-1]*ps+pBetaS5[iikp][ks-1])*ps
                           +pBetaS4[iikp][ks-1];
-                      betaP_ikp=((pBetaP3[iikp][ks-1]*ps+pBetaP2[iikp][ks-1])*ps
-                          +pBetaP1[iikp][ks-1])*ps+pBetaP[iikp][ks-1];
-                      dBetaP_ikp=(pBetaP6[iikp][ks-1]*ps+pBetaP5[iikp][ks-1])*ps
-                          +pBetaP4[iikp][ks-1];
                       nb_ikp=nb_t;
                       nb_t++;
                       if(nb_t>nb_sg) {
@@ -4138,10 +4085,6 @@ void PairBOP::sigmaBo_otf()
                           +pBetaS1[ikkp][ks-1])*ps+pBetaS[ikkp][ks-1];
                       dBetaS_kkp=(pBetaS6[ikkp][ks-1]*ps+pBetaS5[ikkp][ks-1])*ps
                           +pBetaS4[ikkp][ks-1];
-                      betaP_kkp=((pBetaP3[ikkp][ks-1]*ps+pBetaP2[ikkp][ks-1])*ps
-                          +pBetaP1[ikkp][ks-1])*ps+pBetaP[ikkp][ks-1];
-                      dBetaP_kkp=(pBetaP6[ikkp][ks-1]*ps+pBetaP5[ikkp][ks-1])*ps
-                          +pBetaP4[ikkp][ks-1];
                       sig_flag=0;
                       for(nsearch=0;nsearch<nSigBk[n];nsearch++) {
                         ncmp=itypeSigBk[n][nsearch];
@@ -4257,7 +4200,6 @@ void PairBOP::sigmaBo_otf()
                   same_jkpj=0;
 
                   for(kpNeij=0;kpNeij<numneigh[kp];kpNeij++) {
-                    temp_kpj=BOP_index[kp]+kpNeij;
                     kpj=kplist[kpNeij];
                     if(x[j][0]==x[kpj][0]) {
                       if(x[j][1]==x[kpj][1]) {
@@ -4269,7 +4211,6 @@ void PairBOP::sigmaBo_otf()
                     }
                   }
                   for(kpNeik=0;kpNeik<numneigh[kp];kpNeik++) {
-                    temp_kpk=BOP_index[kp]+kpNeik;
                     kpk=kplist[kpNeik];
                     if(x[k][0]==x[kpk][0]) {
                       if(x[k][1]==x[kpk][1]) {
@@ -4296,7 +4237,6 @@ void PairBOP::sigmaBo_otf()
                     }
                     if(sig_flag==1) {
                       for(nsearch=0;nsearch<numneigh[kp];nsearch++) {
-                        kp_nsearch=BOP_index[kp]+nsearch;
                         ncmp=kplist[nsearch];
                         if(x[ncmp][0]==x[j][0]) {
                           if(x[ncmp][1]==x[j][1]) {
@@ -4344,10 +4284,6 @@ void PairBOP::sigmaBo_otf()
                           +pBetaS1[ijkp][ks-1])*ps+pBetaS[ijkp][ks-1];
                       dBetaS_jkp=(pBetaS6[ijkp][ks-1]*ps+pBetaS5[ijkp][ks-1])*ps
                           +pBetaS4[ijkp][ks-1];
-                      betaP_jkp=((pBetaP3[ijkp][ks-1]*ps+pBetaP2[ijkp][ks-1])*ps
-                          +pBetaP1[ijkp][ks-1])*ps+pBetaP[ijkp][ks-1];
-                      dBetaP_jkp=(pBetaP6[ijkp][ks-1]*ps+pBetaP5[ijkp][ks-1])*ps
-                          +pBetaP4[ijkp][ks-1];
                       dis_kkp[0]=x[kp][0]-x[k][0];
                       dis_kkp[1]=x[kp][1]-x[k][1];
                       dis_kkp[2]=x[kp][2]-x[k][2];
@@ -4366,10 +4302,6 @@ void PairBOP::sigmaBo_otf()
                           +pBetaS1[ikkp][ks-1])*ps+pBetaS[ikkp][ks-1];
                       dBetaS_kkp=(pBetaS6[ikkp][ks-1]*ps+pBetaS5[ikkp][ks-1])*ps
                           +pBetaS4[ikkp][ks-1];
-                      betaP_kkp=((pBetaP3[ikkp][ks-1]*ps+pBetaP2[ikkp][ks-1])*ps
-                          +pBetaP1[ikkp][ks-1])*ps+pBetaP[ikkp][ks-1];
-                      dBetaP_kkp=(pBetaP6[ikkp][ks-1]*ps+pBetaP5[ikkp][ks-1])*ps
-                          +pBetaP4[ikkp][ks-1];
                       cosAng_ijkp=(-dis_ij[0]*dis_jkp[0]-dis_ij[1]*dis_jkp[1]
                           -dis_ij[2]*dis_jkp[2])/(r_ij*r_jkp);
                       dcA_ijkp[0][0]=(dis_jkp[0]*r_ij*r_jkp-cosAng_ijkp
@@ -4430,7 +4362,6 @@ void PairBOP::sigmaBo_otf()
                         nkp=nSigBk[n]-1;
                         itypeSigBk[n][nkp]=kp;
                       }
-                      temp_kpk=BOP_index[kp]+kpNeik;
                       nb_jkp=nb_t;
                       nb_t++;
                       if(nb_t>nb_sg) {
@@ -4612,10 +4543,6 @@ void PairBOP::sigmaBo_otf()
                     +pBetaS1[ijk][ks-1])*ps+pBetaS[ijk][ks-1];
                 dBetaS_jk=(pBetaS6[ijk][ks-1]*ps+pBetaS5[ijk][ks-1])*ps
                     +pBetaS4[ijk][ks-1];
-                betaP_jk=((pBetaP3[ijk][ks-1]*ps+pBetaP2[ijk][ks-1])*ps
-                    +pBetaP1[ijk][ks-1])*ps+pBetaP[ijk][ks-1];
-                dBetaP_jk=(pBetaP6[ijk][ks-1]*ps+pBetaP5[ijk][ks-1])*ps
-                    +pBetaP4[ijk][ks-1];
                 cosAng_ijk=(-dis_ij[0]*dis_jk[0]-dis_ij[1]*dis_jk[1]
                     -dis_ij[2]*dis_jk[2])/(r_ij*r_jk);
                 dcA_ijk[0][0]=(dis_jk[0]*r_ij*r_jk-cosAng_ijk
@@ -4739,10 +4666,6 @@ void PairBOP::sigmaBo_otf()
                         +pBetaS1[ijkp][ks-1])*ps+pBetaS[ijkp][ks-1];
                       dBetaS_jkp=(pBetaS6[ijkp][ks-1]*ps+pBetaS5[ijkp][ks-1])*ps
                         +pBetaS4[ijkp][ks-1];
-                      betaP_jkp=((pBetaP3[ijkp][ks-1]*ps+pBetaP2[ijkp][ks-1])*ps
-                        +pBetaP1[ijkp][ks-1])*ps+pBetaP[ijkp][ks-1];
-                      dBetaP_jkp=(pBetaP6[ijkp][ks-1]*ps+pBetaP5[ijkp][ks-1])*ps
-                        +pBetaP4[ijkp][ks-1];
                       cosAng_ijkp=(-dis_ij[0]*dis_jkp[0]-dis_ij[1]*dis_jkp[1]
                         -dis_ij[2]*dis_jkp[2])/(r_ij*r_jkp);
                       dcA_ijkp[0][0]=(dis_jkp[0]*r_ij*r_jkp-cosAng_ijkp
@@ -4930,10 +4853,6 @@ void PairBOP::sigmaBo_otf()
                           +pBetaS1[ikkp][ks-1])*ps+pBetaS[ikkp][ks-1];
                       dBetaS_kkp=(pBetaS6[ikkp][ks-1]*ps+pBetaS5[ikkp][ks-1])*ps
                           +pBetaS4[ikkp][ks-1];
-                      betaP_kkp=((pBetaP3[ikkp][ks-1]*ps+pBetaP2[ikkp][ks-1])*ps
-                          +pBetaP1[ikkp][ks-1])*ps+pBetaP[ikkp][ks-1];
-                      dBetaP_kkp=(pBetaP6[ikkp][ks-1]*ps+pBetaP5[ikkp][ks-1])*ps
-                          +pBetaP4[ikkp][ks-1];
                       cosAng_jkkp=(-dis_jk[0]*dis_kkp[0]-dis_jk[1]*dis_kkp[1]
                           -dis_jk[2]*dis_kkp[2])/(r_jk*r_kkp);
                       dcA_jkkp[0][0]=(dis_kkp[0]*r_jk*r_kkp-cosAng_jkkp
@@ -5319,15 +5238,15 @@ void PairBOP::sigmaBo_noa_otf()
   int nsearch;
   int sig_flag,setting,ncmp,ks;
   int itype,jtype,ktype,kptype;
-  int bt_i,bt_j,bt_ij;
+  int bt_i,bt_j;
   int same_ikp,same_jkp,same_kpk;
-  double AA,BB,CC,DD,EE,EE1,FF;
-  double AAC,BBC,CCC,DDC,EEC,FFC,GGC;
-  double UT,bndtmp,UTcom;
+  double AA,BB,CC,DD,EE1,FF;
+  double AAC,BBC,CCC,DDC,EEC;
+  double UT,bndtmp;
   double amean,gmean0,gmean1,gmean2,ps;
   double gfactor1,gprime1,gsqprime;
   double gfactorsq,gfactor2,gprime2;
-  double gfactorsq2,gsqprime2;
+  double gfactorsq2;
   double gfactor3,gprime3,gfactor,rfactor;
   double rfactorrt,rfactor1rt,rfactor1;
   double rcm1,rcm2,gcm1,gcm2,gcm3;
@@ -5338,31 +5257,25 @@ void PairBOP::sigmaBo_noa_otf()
   double bndtmp1,bndtmp2;
   double dis_ij[3],rsq_ij,r_ij;
   double betaS_ij,dBetaS_ij;
-  double betaP_ij,dBetaP_ij;
   double dis_ik[3],rsq_ik,r_ik;
   double betaS_ik,dBetaS_ik;
-  double betaP_ik,dBetaP_ik;
   double dis_ikp[3],rsq_ikp,r_ikp;
-  double betaS_ikp,dBetaS_ikp;
-  double betaP_ikp,dBetaP_ikp;
+  double betaS_ikp;
   double dis_jk[3],rsq_jk,r_jk;
   double betaS_jk,dBetaS_jk;
-  double betaP_jk,dBetaP_jk;
   double dis_jkp[3],rsq_jkp,r_jkp;
   double betaS_jkp,dBetaS_jkp;
-  double betaP_jkp,dBetaP_jkp;
   double dis_kkp[3],rsq_kkp,r_kkp;
-  double betaS_kkp,dBetaS_kkp;
-  double betaP_kkp,dBetaP_kkp;
+  double betaS_kkp;
   double cosAng_jik,dcA_jik[3][2];
   double cosAng_jikp;
   double cosAng_kikp;
   double cosAng_ijk,dcA_ijk[3][2];
-  double cosAng_ijkp,dcA_ijkp[3][2];
-  double cosAng_kjkp,dcA_kjkp[3][2];
+  double cosAng_ijkp;
+  double cosAng_kjkp;
   double cosAng_ikj,dcA_ikj[3][2];
   double cosAng_ikkp;
-  double cosAng_jkkp,dcA_jkkp[3][2];
+  double cosAng_jkkp;
 
 
   double ftmp[3],xtmp[3];
@@ -5463,10 +5376,6 @@ void PairBOP::sigmaBo_noa_otf()
               +pBetaS1[iij][ks-1])*ps+pBetaS[iij][ks-1];
           dBetaS_ij=(pBetaS6[iij][ks-1]*ps+pBetaS5[iij][ks-1])*ps
               +pBetaS4[iij][ks-1];
-          betaP_ij=((pBetaP3[iij][ks-1]*ps+pBetaP2[iij][ks-1])*ps
-              +pBetaP1[iij][ks-1])*ps+pBetaP[iij][ks-1];
-          dBetaP_ij=(pBetaP6[iij][ks-1]*ps+pBetaP5[iij][ks-1])*ps
-              +pBetaP4[iij][ks-1];
           nSigBk[n]=0;
 
 //AA-EE1 are the components making up Eq. 30 (a)
@@ -5475,7 +5384,6 @@ void PairBOP::sigmaBo_noa_otf()
           BB=0.0;
           CC=0.0;
           DD=0.0;
-          EE=0.0;
           EE1=0.0;
 
 //FF is the Beta_sigma^2 term
@@ -5538,10 +5446,6 @@ void PairBOP::sigmaBo_noa_otf()
                     +pBetaS1[iik][ks-1])*ps+pBetaS[iik][ks-1];
                 dBetaS_ik=(pBetaS6[iik][ks-1]*ps+pBetaS5[iik][ks-1])*ps
                     +pBetaS4[iik][ks-1];
-                betaP_ik=((pBetaP3[iik][ks-1]*ps+pBetaP2[iik][ks-1])*ps
-                    +pBetaP1[iik][ks-1])*ps+pBetaP[iik][ks-1];
-                dBetaP_ik=(pBetaP6[iik][ks-1]*ps+pBetaP5[iik][ks-1])*ps
-                    +pBetaP4[iik][ks-1];
 
 //find neighbor of i that is equal to k
 
@@ -5727,10 +5631,6 @@ void PairBOP::sigmaBo_noa_otf()
                         +pBetaS1[ijkp][ks-1])*ps+pBetaS[ijkp][ks-1];
                     dBetaS_jkp=(pBetaS6[ijkp][ks-1]*ps+pBetaS5[ijkp][ks-1])*ps
                         +pBetaS4[ijkp][ks-1];
-                    betaP_jkp=((pBetaP3[ijkp][ks-1]*ps+pBetaP2[ijkp][ks-1])*ps
-                        +pBetaP1[ijkp][ks-1])*ps+pBetaP[ijkp][ks-1];
-                    dBetaP_jkp=(pBetaP6[ijkp][ks-1]*ps+pBetaP5[ijkp][ks-1])*ps
-                        +pBetaP4[ijkp][ks-1];
                     cosAng_ijk=(-dis_ij[0]*dis_jk[0]-dis_ij[1]*dis_jk[1]
                         -dis_ij[2]*dis_jk[2])/(r_ij*r_jk);
                     dcA_ijk[0][0]=(dis_jk[0]*r_ij*r_jk-cosAng_ijk
@@ -5866,12 +5766,6 @@ void PairBOP::sigmaBo_noa_otf()
                         ps=1.0;
                       betaS_ikp=((pBetaS3[iikp][ks-1]*ps+pBetaS2[iikp][ks-1])*ps
                           +pBetaS1[iikp][ks-1])*ps+pBetaS[iikp][ks-1];
-                      dBetaS_ikp=(pBetaS6[iikp][ks-1]*ps+pBetaS5[iikp][ks-1])*ps
-                          +pBetaS4[iikp][ks-1];
-                      betaP_ikp=((pBetaP3[iikp][ks-1]*ps+pBetaP2[iikp][ks-1])*ps
-                          +pBetaP1[iikp][ks-1])*ps+pBetaP[iikp][ks-1];
-                      dBetaP_ikp=(pBetaP6[iikp][ks-1]*ps+pBetaP5[iikp][ks-1])*ps
-                          +pBetaP4[iikp][ks-1];
                       gmean0=sigma_g0[jtype-1][itype-1][kptype-1];
                       gmean1=sigma_g1[jtype-1][itype-1][kptype-1];
                       gmean2=sigma_g2[jtype-1][itype-1][kptype-1];
@@ -5947,12 +5841,6 @@ void PairBOP::sigmaBo_noa_otf()
                         ps=1.0;
                       betaS_kkp=((pBetaS3[ikkp][ks-1]*ps+pBetaS2[ikkp][ks-1])*ps
                           +pBetaS1[ikkp][ks-1])*ps+pBetaS[ikkp][ks-1];
-                      dBetaS_kkp=(pBetaS6[ikkp][ks-1]*ps+pBetaS5[ikkp][ks-1])*ps
-                          +pBetaS4[ikkp][ks-1];
-                      betaP_kkp=((pBetaP3[ikkp][ks-1]*ps+pBetaP2[ikkp][ks-1])*ps
-                          +pBetaP1[ikkp][ks-1])*ps+pBetaP[ikkp][ks-1];
-                      dBetaP_kkp=(pBetaP6[ikkp][ks-1]*ps+pBetaP5[ikkp][ks-1])*ps
-                          +pBetaP4[ikkp][ks-1];
                       sig_flag=0;
                       for(nsearch=0;nsearch<nSigBk[n];nsearch++) {
                         ncmp=itypeSigBk[n][nsearch];
@@ -5981,7 +5869,6 @@ void PairBOP::sigmaBo_noa_otf()
                           +gmean2*amean*amean;
                       gprime2=gmean1+2.0*gmean2*amean;
                       gfactorsq2=gfactor2*gfactor2;
-                      gsqprime2=2.0*gfactor2*gprime2;
                       gfactor=gfactorsq*gfactorsq2;
                       rfactorrt=betaS_ik*betaS_kkp;
                       rfactor=rfactorrt*rfactorrt;
@@ -6057,10 +5944,6 @@ void PairBOP::sigmaBo_noa_otf()
                     +pBetaS1[ijk][ks-1])*ps+pBetaS[ijk][ks-1];
                 dBetaS_jk=(pBetaS6[ijk][ks-1]*ps+pBetaS5[ijk][ks-1])*ps
                     +pBetaS4[ijk][ks-1];
-                betaP_jk=((pBetaP3[ijk][ks-1]*ps+pBetaP2[ijk][ks-1])*ps
-                    +pBetaP1[ijk][ks-1])*ps+pBetaP[ijk][ks-1];
-                dBetaP_jk=(pBetaP6[ijk][ks-1]*ps+pBetaP5[ijk][ks-1])*ps
-                    +pBetaP4[ijk][ks-1];
                 cosAng_ijk=(-dis_ij[0]*dis_jk[0]-dis_ij[1]*dis_jk[1]
                     -dis_ij[2]*dis_jk[2])/(r_ij*r_jk);
                 dcA_ijk[0][0]=(dis_jk[0]*r_ij*r_jk-cosAng_ijk
@@ -6167,38 +6050,10 @@ void PairBOP::sigmaBo_noa_otf()
                         +pBetaS1[ijkp][ks-1])*ps+pBetaS[ijkp][ks-1];
                       dBetaS_jkp=(pBetaS6[ijkp][ks-1]*ps+pBetaS5[ijkp][ks-1])*ps
                         +pBetaS4[ijkp][ks-1];
-                      betaP_jkp=((pBetaP3[ijkp][ks-1]*ps+pBetaP2[ijkp][ks-1])*ps
-                        +pBetaP1[ijkp][ks-1])*ps+pBetaP[ijkp][ks-1];
-                      dBetaP_jkp=(pBetaP6[ijkp][ks-1]*ps+pBetaP5[ijkp][ks-1])*ps
-                        +pBetaP4[ijkp][ks-1];
                       cosAng_ijkp=(-dis_ij[0]*dis_jkp[0]-dis_ij[1]*dis_jkp[1]
                         -dis_ij[2]*dis_jkp[2])/(r_ij*r_jkp);
-                      dcA_ijkp[0][0]=(dis_jkp[0]*r_ij*r_jkp-cosAng_ijkp
-                        *-dis_ij[0]*r_jkp*r_jkp)/(r_ij*r_ij*r_jkp*r_jkp);
-                      dcA_ijkp[1][0]=(dis_jkp[1]*r_ij*r_jkp-cosAng_ijkp
-                        *-dis_ij[1]*r_jkp*r_jkp)/(r_ij*r_ij*r_jkp*r_jkp);
-                      dcA_ijkp[2][0]=(dis_jkp[2]*r_ij*r_jkp-cosAng_ijkp
-                        *-dis_ij[2]*r_jkp*r_jkp)/(r_ij*r_ij*r_jkp*r_jkp);
-                      dcA_ijkp[0][1]=(-dis_ij[0]*r_ij*r_jkp-cosAng_ijkp
-                        *dis_jkp[0]*r_ij*r_ij)/(r_ij*r_ij*r_jkp*r_jkp);
-                      dcA_ijkp[1][1]=(-dis_ij[1]*r_ij*r_jkp-cosAng_ijkp
-                        *dis_jkp[1]*r_ij*r_ij)/(r_ij*r_ij*r_jkp*r_jkp);
-                      dcA_ijkp[2][1]=(-dis_ij[2]*r_ij*r_jkp-cosAng_ijkp
-                        *dis_jkp[2]*r_ij*r_ij)/(r_ij*r_ij*r_jkp*r_jkp);
                       cosAng_kjkp=(dis_jk[0]*dis_jkp[0]+dis_jk[1]*dis_jkp[1]
                         +dis_jk[2]*dis_jkp[2])/(r_jk*r_jkp);
-                      dcA_kjkp[0][0]=(dis_jkp[0]*r_jk*r_jkp-cosAng_kjkp
-                        *dis_jk[0]*r_jkp*r_jkp)/(r_jk*r_jk*r_jkp*r_jkp);
-                      dcA_kjkp[1][0]=(dis_jkp[1]*r_jk*r_jkp-cosAng_kjkp
-                        *dis_jk[1]*r_jkp*r_jkp)/(r_jk*r_jk*r_jkp*r_jkp);
-                      dcA_kjkp[2][0]=(dis_jkp[2]*r_jk*r_jkp-cosAng_kjkp
-                        *dis_jk[2]*r_jkp*r_jkp)/(r_jk*r_jk*r_jkp*r_jkp);
-                      dcA_kjkp[0][1]=(dis_jk[0]*r_jk*r_jkp-cosAng_kjkp
-                        *dis_jkp[0]*r_jk*r_jk)/(r_jk*r_jk*r_jkp*r_jkp);
-                      dcA_kjkp[1][1]=(dis_jk[1]*r_jk*r_jkp-cosAng_kjkp
-                        *dis_jkp[1]*r_jk*r_jk)/(r_jk*r_jk*r_jkp*r_jkp);
-                      dcA_kjkp[2][1]=(dis_jk[2]*r_jk*r_jkp-cosAng_kjkp
-                        *dis_jkp[2]*r_jk*r_jk)/(r_jk*r_jk*r_jkp*r_jkp);
                       nb_jkp=nb_t;
                       nb_t++;
                       if(nb_t>nb_sg) {
@@ -6308,26 +6163,8 @@ void PairBOP::sigmaBo_noa_otf()
                         ps=1.0;
                       betaS_kkp=((pBetaS3[ikkp][ks-1]*ps+pBetaS2[ikkp][ks-1])*ps
                           +pBetaS1[ikkp][ks-1])*ps+pBetaS[ikkp][ks-1];
-                      dBetaS_kkp=(pBetaS6[ikkp][ks-1]*ps+pBetaS5[ikkp][ks-1])*ps
-                          +pBetaS4[ikkp][ks-1];
-                      betaP_kkp=((pBetaP3[ikkp][ks-1]*ps+pBetaP2[ikkp][ks-1])*ps
-                          +pBetaP1[ikkp][ks-1])*ps+pBetaP[ikkp][ks-1];
-                      dBetaP_kkp=(pBetaP6[ikkp][ks-1]*ps+pBetaP5[ikkp][ks-1])*ps
-                          +pBetaP4[ikkp][ks-1];
                       cosAng_jkkp=(-dis_jk[0]*dis_kkp[0]-dis_jk[1]*dis_kkp[1]
                           -dis_jk[2]*dis_kkp[2])/(r_jk*r_kkp);
-                      dcA_jkkp[0][0]=(dis_kkp[0]*r_jk*r_kkp-cosAng_jkkp
-                          *-dis_jk[0]*r_kkp*r_kkp)/(r_jk*r_jk*r_kkp*r_kkp);
-                      dcA_jkkp[1][0]=(dis_kkp[1]*r_jk*r_kkp-cosAng_jkkp
-                          *-dis_jk[1]*r_kkp*r_kkp)/(r_jk*r_jk*r_kkp*r_kkp);
-                      dcA_jkkp[2][0]=(dis_kkp[2]*r_jk*r_kkp-cosAng_jkkp
-                          *-dis_jk[2]*r_kkp*r_kkp)/(r_jk*r_jk*r_kkp*r_kkp);
-                      dcA_jkkp[0][1]=(-dis_jk[0]*r_jk*r_kkp-cosAng_jkkp
-                          *dis_kkp[0]*r_jk*r_jk)/(r_jk*r_jk*r_kkp*r_kkp);
-                      dcA_jkkp[1][1]=(-dis_jk[1]*r_jk*r_kkp-cosAng_jkkp
-                          *dis_kkp[1]*r_jk*r_jk)/(r_jk*r_jk*r_kkp*r_kkp);
-                      dcA_jkkp[2][1]=(-dis_jk[2]*r_jk*r_kkp-cosAng_jkkp
-                          *dis_kkp[2]*r_jk*r_jk)/(r_jk*r_jk*r_kkp*r_kkp);
                       nb_kkp=nb_t;
                       nb_t++;
                       if(nb_t>nb_sg) {
@@ -6346,7 +6183,6 @@ void PairBOP::sigmaBo_noa_otf()
                           +gmean2*amean*amean;
                       gprime2=gmean1+2.0*gmean2*amean;
                       gfactorsq2=gfactor2*gfactor2;
-                      gsqprime2=2.0*gfactor2*gprime2;
                       gfactor=gfactorsq*gfactorsq2;
                       rfactorrt=betaS_jk*betaS_kkp;
                       rfactor=rfactorrt*rfactorrt;
@@ -6400,15 +6236,10 @@ void PairBOP::sigmaBo_noa_otf()
             UT=EEC*FF+BBC+small3[iij];
             UT=1.0/sqrt(UT);
 
-// FFC is slightly modified form of (a) Eq. 31
-// GGC is slightly modified form of (a) Eq. 32
 // bndtmp is a slightly modified form of (a) Eq. 30 and (b) Eq. 8
 
-            FFC=BBC*UT;
-            GGC=EEC*UT;
             bndtmp=(FF+sigma_delta[iij]*sigma_delta[iij])
                 +sigma_c[iij]*AAC+small4;
-            UTcom=-0.5*UT*UT*UT;
             psign=1.0;
             bndtmp0=1.0/sqrt(bndtmp);
             sigB1[n]=psign*betaS_ij*bndtmp0;
@@ -6501,7 +6332,6 @@ void PairBOP::sigmaBo_noa_otf()
             for(m=0;m<nb_t;m++) {
               if((bt_sg[m].i>-1)&&(bt_sg[m].j>-1)) {
                 temp_kk=bt_sg[m].temp;
-                bt_ij=bt_sg[m].temp;
                 bt_i=bt_sg[m].i;
                 bt_j=bt_sg[m].j;
                 xtmp[0]=x[bt_j][0]-x[bt_i][0];
@@ -6550,15 +6380,15 @@ void PairBOP::PiBo()
   int **firstneigh,*numneigh;
   int itype,jtype;
   int temp_ij,temp_ik,temp_ikp;
-  int temp_ji,temp_jki,temp_jk,temp_jkp;
+  int temp_jk,temp_jkp;
   int ang_jikp,ang_kikp,ang_ijk;
   int ang_ijkp,ang_kjkp,ang_jik;
   int nb_ij,nb_ik,nb_jk,nb_ikp,nb_jkp;
   int bt_ij,bt_i,bt_j;
-  double AA,BB,CC,DD,EE,FF;
+  double AA,BB,CC;
   double cosSq,sinFactor,cosFactor;
   double cosSq1,dotV,BBrt,AB1,AB2;
-  double BBrtR,ABrtR,ABrtR1,ABrtR2;
+  double BBrtR,ABrtR1,ABrtR2;
   double angFactor,angFactor1,angFactor2;
   double angFactor3,angFactor4,angRfactor;
   double dAngR1,dAngR2,agpdpr3;
@@ -6643,7 +6473,6 @@ void PairBOP::PiBo()
           BB=0.0;
           nPiBk[n]=0;
           for(ji=0;ji<numneigh[j];ji++) {
-            temp_ji=BOP_index[j]+ji;
             if(x[jlist[ji]][0]==x[i][0]) {
               if(x[jlist[ji]][1]==x[i][1]) {
                 if(x[jlist[ji]][2]==x[i][2]) {
@@ -6861,7 +6690,6 @@ void PairBOP::PiBo()
 //j is a neighbor of i and k is a neighbor of j and equal to i
 
           for(ki=0;ki<numneigh[j];ki++) {
-            temp_jki=BOP_index[j]+ki;
             k=jlist[ki];
             if(x[k][0]==x[i][0]) {
               if(x[k][1]==x[i][1]) {
@@ -7276,10 +7104,10 @@ void PairBOP::PiBo_otf()
   int temp_jk,temp_jkp;
   int nb_ij,nb_ik,nb_jk,nb_ikp,nb_jkp;
   int bt_i,bt_j;
-  double AA,BB,CC,DD,EE,FF;
+  double AA,BB,CC;
   double cosSq,sinFactor,cosFactor;
   double cosSq1,dotV,BBrt,AB1,AB2;
-  double BBrtR,ABrtR,ABrtR1,ABrtR2;
+  double BBrtR,ABrtR1,ABrtR2;
   double angFactor,angFactor1,angFactor2;
   double angFactor3,angFactor4,angRfactor;
   double dAngR1,dAngR2,agpdpr3;
@@ -9290,11 +9118,6 @@ double PairBOP::memory_usage()
 
 void PairBOP::memory_theta_create()
 {
-  int nlocal,nghost,nall;
-
-  nlocal = atom->nlocal;
-  nghost = atom->nghost;
-  nall = nlocal + nghost;
   if(maxneigh<8)
     neigh_ct=(maxneigh-1)*(maxneigh-1)*(maxneigh-1);
   else
@@ -9328,11 +9151,6 @@ void PairBOP::memory_theta_create()
 
 void PairBOP::memory_theta_grow()
 {
-  int nlocal,nghost,nall;
-
-  nlocal = atom->nlocal;
-  nghost = atom->nghost;
-  nall = nlocal + nghost;
   if(maxneigh<8)
     neigh_ct=(maxneigh-1)*(maxneigh-1)*(maxneigh-1);
   else
diff --git a/src/MANYBODY/pair_comb.cpp b/src/MANYBODY/pair_comb.cpp
index 7632afa172..8168844718 100644
--- a/src/MANYBODY/pair_comb.cpp
+++ b/src/MANYBODY/pair_comb.cpp
@@ -622,7 +622,7 @@ void PairComb::read_file(char *file)
 
     // strip comment, skip line if blank
 
-    if (ptr = strchr(line,'#')) *ptr = '\0';
+    if ((ptr = strchr(line,'#'))) *ptr = '\0';
     nwords = atom->count_words(line);
     if (nwords == 0) continue;
 
@@ -641,7 +641,7 @@ void PairComb::read_file(char *file)
       if (eof) break;
       MPI_Bcast(&n,1,MPI_INT,0,world);
       MPI_Bcast(line,n,MPI_CHAR,0,world);
-      if (ptr = strchr(line,'#')) *ptr = '\0';
+      if ((ptr = strchr(line,'#'))) *ptr = '\0';
       nwords = atom->count_words(line);
     }
 
@@ -652,7 +652,7 @@ void PairComb::read_file(char *file)
 
     nwords = 0;
     words[nwords++] = strtok(line," \t\n\r\f");
-    while (words[nwords++] = strtok(NULL," \t\n\r\f")) continue;
+    while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue;
 
     // ielement,jelement,kelement = 1st args
     // if all 3 args are in element list, then parse this line
@@ -2047,16 +2047,14 @@ void PairComb::unpack_reverse_comm(int n, int *list, double *buf)
 
 void PairComb::Short_neigh()
 {
-  int nj,itype,jtype,iparam_ij;
+  int nj,itype,jtype;
   int inum,jnum,i,j,ii,jj;
   int *neighptrj,*ilist,*jlist,*numneigh;
   int **firstneigh;
-  double xtmp,ytmp,ztmp,rr,rsq,delrj[3];
+  double xtmp,ytmp,ztmp,rsq,delrj[3];
 
   double **x = atom->x;
   int *type  = atom->type;
-  int nlocal = atom->nlocal;
-  int ntype = atom->ntypes;
 
   if (atom->nmax > nmax) {
     memory->sfree(sht_first);
diff --git a/src/MANYBODY/pair_comb3.cpp b/src/MANYBODY/pair_comb3.cpp
index eebf9fee45..9371ed6a68 100644
--- a/src/MANYBODY/pair_comb3.cpp
+++ b/src/MANYBODY/pair_comb3.cpp
@@ -331,7 +331,7 @@ void PairComb3::read_lib()
     fgets(s,maxlib,fp);
     nwords = 0;
     words1[nwords++] = strtok(s," \t\n\r\f");
-    while (words1[nwords++] = strtok(NULL," \t\n\r\f"))continue;
+    while ((words1[nwords++] = strtok(NULL," \t\n\r\f")))continue;
     ccutoff[0] = atof(words1[0]);
     ccutoff[1] = atof(words1[1]);
     ccutoff[2] = atof(words1[2]); 
@@ -342,7 +342,7 @@ void PairComb3::read_lib()
     fgets(s,maxlib,fp);
     nwords = 0;
     words1[nwords++] = strtok(s," \t\n\r\f");
-    while (words1[nwords++] = strtok(NULL," \t\n\r\f"))continue;
+    while ((words1[nwords++] = strtok(NULL," \t\n\r\f")))continue;
     ch_a[0] = atof(words1[0]);
     ch_a[1] = atof(words1[1]);
     ch_a[2] = atof(words1[2]); 
@@ -354,7 +354,7 @@ void PairComb3::read_lib()
     fgets(s,maxlib,fp);
     nwords = 0;
     words1[nwords++] = strtok(s," \t\n\r\f");
-    while (words1[nwords++] = strtok(NULL," \t\n\r\f"))continue;
+    while ((words1[nwords++] = strtok(NULL," \t\n\r\f")))continue;
     nsplpcn = atoi(words1[0]);
     nsplrad = atoi(words1[1]);
     nspltor = atoi(words1[2]);
@@ -362,7 +362,7 @@ void PairComb3::read_lib()
     fgets(s,maxlib,fp);
     nwords = 0;
     words1[nwords++] = strtok(s," \t\n\r\f");
-    while (words1[nwords++] = strtok(NULL," \t\n\r\f"))continue;
+    while ((words1[nwords++] = strtok(NULL," \t\n\r\f")))continue;
     maxx = atoi(words1[0]);
     maxy = atoi(words1[1]);
     maxz = atoi(words1[2]);
@@ -370,7 +370,7 @@ void PairComb3::read_lib()
     fgets(s,maxlib,fp);
     nwords = 0;
     words1[nwords++] = strtok(s," \t\n\r\f");
-    while (words1[nwords++] = strtok(NULL," \t\n\r\f"))continue;
+    while ((words1[nwords++] = strtok(NULL," \t\n\r\f")))continue;
     maxxc = atoi(words1[0]);
     maxyc = atoi(words1[1]);
     maxconj = atoi(words1[2]);
@@ -379,7 +379,7 @@ void PairComb3::read_lib()
       fgets(s,maxlib,fp);
       nwords = 0;
       words1[nwords++] = strtok(s," \t\n\r\f");
-      while (words1[nwords++] = strtok(NULL," \t\n\r\f"))continue;
+      while ((words1[nwords++] = strtok(NULL," \t\n\r\f")))continue;
       maxxcn[l] = atoi(words1[1]);
       vmaxxcn[l] = atof(words1[2]);
       dvmaxxcn[l] = atof(words1[3]);
@@ -388,14 +388,14 @@ void PairComb3::read_lib()
     fgets(s,maxlib,fp);
     nwords = 0;
     words1[nwords++] = strtok(s," \t\n\r\f");
-    while (words1[nwords++] = strtok(NULL," \t\n\r\f"))continue;
+    while ((words1[nwords++] = strtok(NULL," \t\n\r\f")))continue;
     ntab = atoi(words1[0]);
 
     for (i=0; i<ntab+1; i++){
       fgets(s,maxlib,fp); 
       nwords = 0;
       words1[nwords++] = strtok(s," \t\n\r\f");
-      while (words1[nwords++] = strtok(NULL," \t\n\r\f"))continue;
+      while ((words1[nwords++] = strtok(NULL," \t\n\r\f")))continue;
       pang[i]    = atof(words1[1]);
       dpang[i]   = atof(words1[2]);
       ddpang[i]  = atof(words1[3]);
@@ -408,7 +408,7 @@ void PairComb3::read_lib()
             fgets(s,maxlib,fp); 
             nwords = 0;
             words1[nwords++] = strtok(s," \t\n\r\f");
-            while (words1[nwords++] = strtok(NULL," \t\n\r\f"))continue; 
+            while ((words1[nwords++] = strtok(NULL," \t\n\r\f")))continue; 
             ll = atoi(words1[0])-1;
             ii = atoi(words1[1]);
             jj = atoi(words1[2]);
@@ -426,7 +426,7 @@ void PairComb3::read_lib()
             fgets(s,maxlib,fp); 
             nwords = 0;
             words1[nwords++] = strtok(s," \t\n\r\f");
-            while (words1[nwords++] = strtok(NULL," \t\n\r\f"))continue;
+            while ((words1[nwords++] = strtok(NULL," \t\n\r\f")))continue;
            ll = atoi(words1[0])-1;
            ii = atoi(words1[1]);
            jj = atoi(words1[2]);
@@ -435,7 +435,7 @@ void PairComb3::read_lib()
              fgets(s,maxlib,fp); 
              nwords = 0;
              words1[nwords++] = strtok(s," \t\n\r\f");
-             while (words1[nwords++] = strtok(NULL," \t\n\r\f"))continue;
+             while ((words1[nwords++] = strtok(NULL," \t\n\r\f")))continue;
              for(m=0; m<32 ; m++) {
                mm=iii*32+m;
                pcn_cubs[ll][ii][jj][kk][mm] = atof(words1[m]);
@@ -450,7 +450,7 @@ void PairComb3::read_lib()
             fgets(s,maxlib,fp); 
             nwords = 0;
             words1[nwords++] = strtok(s," \t\n\r\f");
-            while (words1[nwords++] = strtok(NULL," \t\n\r\f"))continue;
+            while ((words1[nwords++] = strtok(NULL," \t\n\r\f")))continue;
             ll = atoi(words1[0])-1;
             ii = atoi(words1[1]);
             jj = atoi(words1[2]);
@@ -468,7 +468,7 @@ void PairComb3::read_lib()
             fgets(s,maxlib,fp); 
             nwords = 0;
             words1[nwords++] = strtok(s," \t\n\r\f");
-            while (words1[nwords++] = strtok(NULL," \t\n\r\f"))continue;
+            while ((words1[nwords++] = strtok(NULL," \t\n\r\f")))continue;
             ll = atoi(words1[0])-1;
             ii = atoi(words1[1]);
             jj = atoi(words1[2]);
@@ -477,7 +477,7 @@ void PairComb3::read_lib()
               fgets(s,maxlib,fp);
               nwords = 0;
               words1[nwords++] = strtok(s," \t\n\r\f");
-              while (words1[nwords++] = strtok(NULL," \t\n\r\f"))continue;
+              while ((words1[nwords++] = strtok(NULL," \t\n\r\f")))continue;
               for(m=0; m<32 ; m++){
                 mm=iii*32+m;
                 rad_spl[ll][ii][jj][kk][mm] = atof(words1[m]);
@@ -492,7 +492,7 @@ void PairComb3::read_lib()
             fgets(s,maxlib,fp); 
             nwords = 0;
             words1[nwords++] = strtok(s," \t\n\r\f");
-            while (words1[nwords++] = strtok(NULL," \t\n\r\f"))continue;
+            while ((words1[nwords++] = strtok(NULL," \t\n\r\f")))continue;
             ll = atoi(words1[0])-1;
             ii = atoi(words1[1]);
             jj = atoi(words1[2]);
@@ -510,7 +510,7 @@ void PairComb3::read_lib()
             fgets(s,maxlib,fp); 
             nwords = 0;
             words1[nwords++] = strtok(s," \t\n\r\f");
-            while (words1[nwords++] = strtok(NULL," \t\n\r\f"))continue;
+            while ((words1[nwords++] = strtok(NULL," \t\n\r\f")))continue;
             ll = atoi(words1[0])-1;
             ii = atoi(words1[1]);
             jj = atoi(words1[2]);
@@ -519,7 +519,7 @@ void PairComb3::read_lib()
               fgets(s,maxlib,fp);
               nwords = 0;
               words1[nwords++] = strtok(s," \t\n\r\f");
-              while (words1[nwords++] = strtok(NULL," \t\n\r\f"))continue;
+              while ((words1[nwords++] = strtok(NULL," \t\n\r\f")))continue;
               for (m=0; m<32 ; m++){
                 mm=iii*32+m;
                 tor_spl[ll][ii][jj][kk][mm] = atof(words1[m]);
@@ -633,7 +633,7 @@ void PairComb3::read_file(char *file)
 
     // strip comment, skip line if blank
 
-    if (ptr = strchr(line,'#')) *ptr = '\0';
+    if ((ptr = strchr(line,'#'))) *ptr = '\0';
 
     nwords = atom->count_words(line);
     if (nwords == 0) continue;
@@ -654,7 +654,7 @@ void PairComb3::read_file(char *file)
       if (eof) break;
       MPI_Bcast(&n,1,MPI_INT,0,world);
       MPI_Bcast(line,n,MPI_CHAR,0,world);
-      if (ptr = strchr(line,'#')) *ptr = '\0';
+      if ((ptr = strchr(line,'#'))) *ptr = '\0';
       nwords = atom->count_words(line);
     }
     if (nwords != params_per_line){
@@ -664,7 +664,7 @@ void PairComb3::read_file(char *file)
 
     nwords = 0;
     words[nwords++] = strtok(line," \t\n\r\f");
-    while (words[nwords++] = strtok(NULL," \t\n\r\f")) continue;
+    while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue;
 
     // ielement,jelement,kelement = 1st args
     // if all 3 args are in element list, then parse this line
diff --git a/src/MANYBODY/pair_eam.cpp b/src/MANYBODY/pair_eam.cpp
index e38c2caa66..892551b430 100644
--- a/src/MANYBODY/pair_eam.cpp
+++ b/src/MANYBODY/pair_eam.cpp
@@ -766,7 +766,7 @@ void PairEAM::grab(FILE *fptr, int n, double *list)
     fgets(line,MAXLINE,fptr);
     ptr = strtok(line," \t\n\r\f");
     list[i++] = atof(ptr);
-    while (ptr = strtok(NULL," \t\n\r\f")) list[i++] = atof(ptr);
+    while ((ptr = strtok(NULL," \t\n\r\f"))) list[i++] = atof(ptr);
   }
 }
 
diff --git a/src/MANYBODY/pair_eam_alloy.cpp b/src/MANYBODY/pair_eam_alloy.cpp
index cdb7d54ecb..13336ef823 100644
--- a/src/MANYBODY/pair_eam_alloy.cpp
+++ b/src/MANYBODY/pair_eam_alloy.cpp
@@ -153,7 +153,7 @@ void PairEAMAlloy::read_file(char *filename)
   char **words = new char*[file->nelements+1];
   nwords = 0;
   strtok(line," \t\n\r\f");
-  while (words[nwords++] = strtok(NULL," \t\n\r\f")) continue;
+  while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue;
 
   file->elements = new char*[file->nelements];
   for (int i = 0; i < file->nelements; i++) {
diff --git a/src/MANYBODY/pair_eam_fs.cpp b/src/MANYBODY/pair_eam_fs.cpp
index 894c9d89a6..16f017c64b 100644
--- a/src/MANYBODY/pair_eam_fs.cpp
+++ b/src/MANYBODY/pair_eam_fs.cpp
@@ -153,7 +153,7 @@ void PairEAMFS::read_file(char *filename)
   char **words = new char*[file->nelements+1];
   nwords = 0;
   strtok(line," \t\n\r\f");
-  while (words[nwords++] = strtok(NULL," \t\n\r\f")) continue;
+  while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue;
 
   file->elements = new char*[file->nelements];
   for (int i = 0; i < file->nelements; i++) {
diff --git a/src/MANYBODY/pair_sw.cpp b/src/MANYBODY/pair_sw.cpp
index 00c8461c01..554d524f0d 100755
--- a/src/MANYBODY/pair_sw.cpp
+++ b/src/MANYBODY/pair_sw.cpp
@@ -368,7 +368,7 @@ void PairSW::read_file(char *file)
 
     // strip comment, skip line if blank
 
-    if (ptr = strchr(line,'#')) *ptr = '\0';
+    if ((ptr = strchr(line,'#'))) *ptr = '\0';
     nwords = atom->count_words(line);
     if (nwords == 0) continue;
 
@@ -387,7 +387,7 @@ void PairSW::read_file(char *file)
       if (eof) break;
       MPI_Bcast(&n,1,MPI_INT,0,world);
       MPI_Bcast(line,n,MPI_CHAR,0,world);
-      if (ptr = strchr(line,'#')) *ptr = '\0';
+      if ((ptr = strchr(line,'#'))) *ptr = '\0';
       nwords = atom->count_words(line);
     }
 
@@ -398,7 +398,7 @@ void PairSW::read_file(char *file)
 
     nwords = 0;
     words[nwords++] = strtok(line," \t\n\r\f");
-    while (words[nwords++] = strtok(NULL," \t\n\r\f")) continue;
+    while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue;
 
     // ielement,jelement,kelement = 1st args
     // if all 3 args are in element list, then parse this line
diff --git a/src/MANYBODY/pair_tersoff.cpp b/src/MANYBODY/pair_tersoff.cpp
index be85d2e634..8982521939 100755
--- a/src/MANYBODY/pair_tersoff.cpp
+++ b/src/MANYBODY/pair_tersoff.cpp
@@ -407,7 +407,7 @@ void PairTersoff::read_file(char *file)
 
     // strip comment, skip line if blank
 
-    if (ptr = strchr(line,'#')) *ptr = '\0';
+    if ((ptr = strchr(line,'#'))) *ptr = '\0';
     nwords = atom->count_words(line);
     if (nwords == 0) continue;
 
@@ -426,7 +426,7 @@ void PairTersoff::read_file(char *file)
       if (eof) break;
       MPI_Bcast(&n,1,MPI_INT,0,world);
       MPI_Bcast(line,n,MPI_CHAR,0,world);
-      if (ptr = strchr(line,'#')) *ptr = '\0';
+      if ((ptr = strchr(line,'#'))) *ptr = '\0';
       nwords = atom->count_words(line);
     }
 
@@ -437,7 +437,7 @@ void PairTersoff::read_file(char *file)
 
     nwords = 0;
     words[nwords++] = strtok(line," \t\n\r\f");
-    while (words[nwords++] = strtok(NULL," \t\n\r\f")) continue;
+    while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue;
 
     // ielement,jelement,kelement = 1st args
     // if all 3 args are in element list, then parse this line
diff --git a/src/MANYBODY/pair_tersoff_mod.cpp b/src/MANYBODY/pair_tersoff_mod.cpp
index b19c843a16..558e96de37 100644
--- a/src/MANYBODY/pair_tersoff_mod.cpp
+++ b/src/MANYBODY/pair_tersoff_mod.cpp
@@ -87,7 +87,7 @@ void PairTersoffMOD::read_file(char *file)
 
     // strip comment, skip line if blank
 
-    if (ptr = strchr(line,'#')) *ptr = '\0';
+    if ((ptr = strchr(line,'#'))) *ptr = '\0';
     nwords = atom->count_words(line);
     if (nwords == 0) continue;
 
@@ -106,7 +106,7 @@ void PairTersoffMOD::read_file(char *file)
       if (eof) break;
       MPI_Bcast(&n,1,MPI_INT,0,world);
       MPI_Bcast(line,n,MPI_CHAR,0,world);
-      if (ptr = strchr(line,'#')) *ptr = '\0';
+      if ((ptr = strchr(line,'#'))) *ptr = '\0';
       nwords = atom->count_words(line);
     }
 
@@ -117,7 +117,7 @@ void PairTersoffMOD::read_file(char *file)
 
     nwords = 0;
     words[nwords++] = strtok(line," \t\n\r\f");
-    while (words[nwords++] = strtok(NULL," \t\n\r\f")) continue;
+    while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue;
 
     // ielement,jelement,kelement = 1st args
     // if all 3 args are in element list, then parse this line
diff --git a/src/MANYBODY/pair_tersoff_zbl.cpp b/src/MANYBODY/pair_tersoff_zbl.cpp
index 2d55e11517..95c3dd711c 100644
--- a/src/MANYBODY/pair_tersoff_zbl.cpp
+++ b/src/MANYBODY/pair_tersoff_zbl.cpp
@@ -104,7 +104,7 @@ void PairTersoffZBL::read_file(char *file)
 
     // strip comment, skip line if blank
 
-    if (ptr = strchr(line,'#')) *ptr = '\0';
+    if ((ptr = strchr(line,'#'))) *ptr = '\0';
     nwords = atom->count_words(line);
     if (nwords == 0) continue;
 
@@ -123,7 +123,7 @@ void PairTersoffZBL::read_file(char *file)
       if (eof) break;
       MPI_Bcast(&n,1,MPI_INT,0,world);
       MPI_Bcast(line,n,MPI_CHAR,0,world);
-      if (ptr = strchr(line,'#')) *ptr = '\0';
+      if ((ptr = strchr(line,'#'))) *ptr = '\0';
       nwords = atom->count_words(line);
     }
 
@@ -134,7 +134,7 @@ void PairTersoffZBL::read_file(char *file)
 
     nwords = 0;
     words[nwords++] = strtok(line," \t\n\r\f");
-    while (words[nwords++] = strtok(NULL," \t\n\r\f")) continue;
+    while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue;
 
     // ielement,jelement,kelement = 1st args
     // if all 3 args are in element list, then parse this line
diff --git a/src/MC/fix_bond_break.cpp b/src/MC/fix_bond_break.cpp
index 99f78db824..9bdede2bab 100755
--- a/src/MC/fix_bond_break.cpp
+++ b/src/MC/fix_bond_break.cpp
@@ -185,7 +185,7 @@ void FixBondBreak::init()
 
 void FixBondBreak::post_integrate()
 {
-  int i,j,k,m,n,i1,i2,n1,n2,n3,type;
+  int i,j,k,m,n,i1,i2,n1,n3,type;
   double delx,dely,delz,rsq;
   tagint *slist;
 
@@ -511,7 +511,7 @@ void FixBondBreak::update_topology()
 
 void FixBondBreak::rebuild_special(int m, tagint id1, tagint id2)
 {
-  int i,j,n,n1,n2,n3,cn1,cn2,cn3;
+  int i,j,n,n1,cn1,cn2,cn3;
   tagint *slist;
 
   tagint *tag = atom->tag;
diff --git a/src/MEAM/pair_meam.cpp b/src/MEAM/pair_meam.cpp
index ab883d4c75..c3d4ad7005 100644
--- a/src/MEAM/pair_meam.cpp
+++ b/src/MEAM/pair_meam.cpp
@@ -520,7 +520,7 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
 
     // strip comment, skip line if blank
 
-    if (ptr = strchr(line,'#')) *ptr = '\0';
+    if ((ptr = strchr(line,'#'))) *ptr = '\0';
     nwords = atom->count_words(line);
     if (nwords == 0) continue;
 
@@ -539,7 +539,7 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
       if (eof) break;
       MPI_Bcast(&n,1,MPI_INT,0,world);
       MPI_Bcast(line,n,MPI_CHAR,0,world);
-      if (ptr = strchr(line,'#')) *ptr = '\0';
+      if ((ptr = strchr(line,'#'))) *ptr = '\0';
       nwords = atom->count_words(line);
     }
 
@@ -551,7 +551,7 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
 
     nwords = 0;
     words[nwords++] = strtok(line,"' \t\n\r\f");
-    while (words[nwords++] = strtok(NULL,"' \t\n\r\f")) continue;
+    while ((words[nwords++] = strtok(NULL,"' \t\n\r\f"))) continue;
 
     // skip if element name isn't in element list
 
@@ -676,7 +676,7 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
 
     // strip comment, skip line if blank
 
-    if (ptr = strchr(line,'#')) *ptr = '\0';
+    if ((ptr = strchr(line,'#'))) *ptr = '\0';
     nparams = atom->count_words(line);
     if (nparams == 0) continue;
 
diff --git a/src/MISC/fix_gld.cpp b/src/MISC/fix_gld.cpp
index 177b291934..66944502f7 100644
--- a/src/MISC/fix_gld.cpp
+++ b/src/MISC/fix_gld.cpp
@@ -533,8 +533,6 @@ int FixGLD::pack_exchange(int i, double *buf)
 
 int FixGLD::unpack_exchange(int nlocal, double *buf)
 {
-  double **extra = atom->extra;
-
   int m = 0;
   for (int k = 0; k < 3*prony_terms; k++) {
     s_gld[nlocal][k] = buf[m++];
@@ -612,7 +610,6 @@ int FixGLD::maxsize_restart()
 void FixGLD::init_s_gld()
 {
   int icoeff;
-  int *type = atom->type;
   double eq_sdev=0.0;
 
   // set kT to the temperature in mvvv units
diff --git a/src/MOLECULE/angle_table.cpp b/src/MOLECULE/angle_table.cpp
index 682ee4f8ae..cf8b62cc9b 100644
--- a/src/MOLECULE/angle_table.cpp
+++ b/src/MOLECULE/angle_table.cpp
@@ -322,7 +322,7 @@ double AngleTable::single(int type, int i1, int i2, int i3)
   if (c < -1.0) c = -1.0;
 
   double theta = acos(c);
-  double u;
+  double u=0.0;
   u_lookup(type,theta,u);
   return u;
 }
diff --git a/src/MOLECULE/bond_fene.cpp b/src/MOLECULE/bond_fene.cpp
index fb69de6e56..1554c77195 100644
--- a/src/MOLECULE/bond_fene.cpp
+++ b/src/MOLECULE/bond_fene.cpp
@@ -53,7 +53,7 @@ void BondFENE::compute(int eflag, int vflag)
   double delx,dely,delz,ebond,fbond;
   double rsq,r0sq,rlogarg,sr2,sr6;
 
-  ebond = 0.0;
+  ebond = sr6 = 0.0;
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = 0;
 
diff --git a/src/MOLECULE/bond_fene_expand.cpp b/src/MOLECULE/bond_fene_expand.cpp
index 439b09a5a7..6f616b98dd 100644
--- a/src/MOLECULE/bond_fene_expand.cpp
+++ b/src/MOLECULE/bond_fene_expand.cpp
@@ -55,7 +55,7 @@ void BondFENEExpand::compute(int eflag, int vflag)
   double rsq,r0sq,rlogarg,sr2,sr6;
   double r,rshift,rshiftsq;
 
-  ebond = 0.0;
+  ebond = sr6 = 0.0;
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = 0;
 
diff --git a/src/MOLECULE/bond_quartic.cpp b/src/MOLECULE/bond_quartic.cpp
index a0d2e5b702..84a82c9bb4 100755
--- a/src/MOLECULE/bond_quartic.cpp
+++ b/src/MOLECULE/bond_quartic.cpp
@@ -59,7 +59,7 @@ void BondQuartic::compute(int eflag, int vflag)
   double delx,dely,delz,ebond,fbond,evdwl,fpair;
   double r,rsq,dr,r2,ra,rb,sr2,sr6;
 
-  ebond = evdwl = 0.0;
+  ebond = evdwl = sr6 = 0.0;
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = 0;
 
diff --git a/src/MPIIO/dump_atom_mpiio.cpp b/src/MPIIO/dump_atom_mpiio.cpp
index a867b34eeb..2767847a6a 100644
--- a/src/MPIIO/dump_atom_mpiio.cpp
+++ b/src/MPIIO/dump_atom_mpiio.cpp
@@ -552,7 +552,6 @@ int DumpAtomMPIIO::convert_string_omp(int n, double *mybuf)
 
 int DumpAtomMPIIO::convert_image_omp(int n, double *mybuf)
 {
-  MPI_Status mpiStatus;
   char **mpifh_buffer_line_per_thread;
   int mpifhStringCount;
   int *mpifhStringCountPerThread, *bufOffset, *bufRange, *bufLength;
@@ -643,7 +642,6 @@ int DumpAtomMPIIO::convert_image_omp(int n, double *mybuf)
 
 int DumpAtomMPIIO::convert_noimage_omp(int n, double *mybuf)
 {
-  MPI_Status mpiStatus;
   char **mpifh_buffer_line_per_thread;
   int mpifhStringCount;
   int *mpifhStringCountPerThread, *bufOffset, *bufRange, *bufLength;
diff --git a/src/MPIIO/dump_custom_mpiio.cpp b/src/MPIIO/dump_custom_mpiio.cpp
index dc313cc02f..2922ad30c0 100644
--- a/src/MPIIO/dump_custom_mpiio.cpp
+++ b/src/MPIIO/dump_custom_mpiio.cpp
@@ -573,7 +573,6 @@ void DumpCustomMPIIO::write_string(int n, double *mybuf)
 
 int DumpCustomMPIIO::convert_string_omp(int n, double *mybuf)
 {
-  MPI_Status mpiStatus;
   char **mpifh_buffer_line_per_thread;
   int mpifhStringCount;
   int *mpifhStringCountPerThread, *bufOffset, *bufRange, *bufLength;
diff --git a/src/MPIIO/dump_xyz_mpiio.cpp b/src/MPIIO/dump_xyz_mpiio.cpp
index e6fa259920..108ab8dfee 100644
--- a/src/MPIIO/dump_xyz_mpiio.cpp
+++ b/src/MPIIO/dump_xyz_mpiio.cpp
@@ -315,7 +315,6 @@ void DumpXYZMPIIO::write_string(int n, double *mybuf)
 
 int DumpXYZMPIIO::convert_string_omp(int n, double *mybuf)
 {
-  MPI_Status mpiStatus;
   char **mpifh_buffer_line_per_thread;
   int mpifhStringCount;
   int *mpifhStringCountPerThread, *bufOffset, *bufRange, *bufLength;
diff --git a/src/PERI/fix_peri_neigh.cpp b/src/PERI/fix_peri_neigh.cpp
index ffde6a84c4..967cd24610 100644
--- a/src/PERI/fix_peri_neigh.cpp
+++ b/src/PERI/fix_peri_neigh.cpp
@@ -303,7 +303,6 @@ void FixPeriNeigh::setup(int vflag)
   double half_lc = 0.5*(domain->lattice->xlattice);
   double vfrac_scale;
   PairPeriLPS *pairlps = static_cast<PairPeriLPS*>(anypair);
-  PairPeriPMB *pairpmb = static_cast<PairPeriPMB*>(anypair);
   PairPeriVES *pairves = static_cast<PairPeriVES*>(anypair);
   PairPeriEPS *paireps = static_cast<PairPeriEPS*>(anypair);
 
diff --git a/src/USER-CG-CMM/angle_sdk.cpp b/src/USER-CG-CMM/angle_sdk.cpp
index 0ee3f47749..9b76fcacdd 100644
--- a/src/USER-CG-CMM/angle_sdk.cpp
+++ b/src/USER-CG-CMM/angle_sdk.cpp
@@ -244,7 +244,7 @@ void AngleSDK::coeff(int narg, char **arg)
 
   double k_one = force->numeric(FLERR,arg[1]);
   double theta0_one = force->numeric(FLERR,arg[2]);
-  double repscale_one;
+  double repscale_one=1.0;
 
   // backward compatibility with old cg/cmm style input:
   // this had <lj_type> <epsilon> <sigma>
diff --git a/src/USER-LB/fix_lb_fluid.cpp b/src/USER-LB/fix_lb_fluid.cpp
index e5680ccf1e..d8a47dcde7 100755
--- a/src/USER-LB/fix_lb_fluid.cpp
+++ b/src/USER-LB/fix_lb_fluid.cpp
@@ -779,7 +779,6 @@ void FixLbFluid::calc_fluidforce(void)
   MPI_Status statuses[20];
   double forceloc[3],force[3];
   double torqueloc[3],torque[3];
-  int numrequests;
   
   //--------------------------------------------------------------------------
   // Zero out arrays
@@ -2531,8 +2530,6 @@ void FixLbFluid::update_periodic(int xstart, int xend, int ystart, int yend, int
 void FixLbFluid::streamout(void)
 {
   int i,j,k;
-  double mass,massloc;
-  double momentumloc[3],momentum[3];
   int istart,jstart,kstart;
   int iend,jend,kend;
   int w,iproc;
diff --git a/src/USER-LB/fix_lb_pc.cpp b/src/USER-LB/fix_lb_pc.cpp
index abd61a8f88..c8c518f039 100755
--- a/src/USER-LB/fix_lb_pc.cpp
+++ b/src/USER-LB/fix_lb_pc.cpp
@@ -68,7 +68,6 @@ FixLbPC::FixLbPC(LAMMPS *lmp, int narg, char **arg) :
 
   int *mask = atom->mask;
   int nlocal = atom->nlocal;
-  int print_warning = 0;
   for(int j=0; j<nlocal; j++){
     if((mask[j] & groupbit) && !(mask[j] & groupbit_lb_fluid))
       error->one(FLERR,"can only use the lb/pc fix for an atom if also using the lb/fluid fix for that atom");
diff --git a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp
index abc104cb1f..c031d1b782 100755
--- a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp
+++ b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp
@@ -455,7 +455,7 @@ int FixLbRigidPCSphere::setmask()
 
 void FixLbRigidPCSphere::init()
 {
-  int i,itype,ibody;
+  int i,ibody;
 
   // warn if more than one rigid fix
 
@@ -649,7 +649,7 @@ void FixLbRigidPCSphere::init()
 void FixLbRigidPCSphere::setup(int vflag)
 {
   int i,n,ibody;
-  double massone,radone;
+  double massone;
   
   // vcm = velocity of center-of-mass of each rigid body
   // fcm = force on center-of-mass of each rigid body
@@ -663,7 +663,6 @@ void FixLbRigidPCSphere::setup(int vflag)
   int nlocal = atom->nlocal;
 
   imageint *image = atom->image;
-  int *periodicity = domain->periodicity;
 
   double unwrap[3];
   double dx,dy,dz;
@@ -761,12 +760,11 @@ void FixLbRigidPCSphere::initial_integrate(int vflag)
 {
   double dtfm;
 
-  int i,n,ibody;
+  int i,ibody;
 
-  double massone,radone;
+  double massone;
   double **x = atom->x;
   double **v = atom->v;
-  double **f = atom->f;
   double *rmass = atom->rmass;
   double *mass = atom->mass;
   int *type = atom->type;
@@ -953,14 +951,12 @@ void FixLbRigidPCSphere::initial_integrate(int vflag)
 void FixLbRigidPCSphere::final_integrate()
 {
   int i,ibody;
-  double xy,xz,yz;
 
   // sum over atoms to get force and torque on rigid body
   double massone;
   imageint *image = atom->image;
   double **x = atom->x;
   double **f = atom->f;
-  double **v = atom->v;
   double *rmass = atom->rmass;
   double *mass = atom->mass;
   int *type = atom->type;
@@ -1565,7 +1561,7 @@ double FixLbRigidPCSphere::compute_array(int i, int j)
    int *mask = atom->mask;
    int nlocal = atom->nlocal;
    double **x = atom->x;
-   int i,j,k,p,m;
+   int i,k;
    int ix,iy,iz;
    int ixp,iyp,izp;
    double dx1,dy1,dz1;
diff --git a/src/USER-MISC/angle_quartic.cpp b/src/USER-MISC/angle_quartic.cpp
index c6ba466ef2..cb0072373e 100644
--- a/src/USER-MISC/angle_quartic.cpp
+++ b/src/USER-MISC/angle_quartic.cpp
@@ -283,7 +283,5 @@ double AngleQuartic::single(int type, int i1, int i2, int i3)
   double dtheta2 = dtheta * dtheta;
   double dtheta3 = dtheta2 * dtheta;
   double dtheta4 = dtheta3 * dtheta;
-  double tk = 2.0 * k2[type] * dtheta + 3.0 * k3[type] * dtheta2 + 
-    4.0 * k4[type] * dtheta3;
   return k2[type] * dtheta2 + k3[type] * dtheta3 + k4[type] * dtheta4;
 }
diff --git a/src/USER-MISC/dihedral_cosine_shift_exp.cpp b/src/USER-MISC/dihedral_cosine_shift_exp.cpp
index ec6cc01fb9..90034330ee 100644
--- a/src/USER-MISC/dihedral_cosine_shift_exp.cpp
+++ b/src/USER-MISC/dihedral_cosine_shift_exp.cpp
@@ -58,13 +58,13 @@ DihedralCosineShiftExp::~DihedralCosineShiftExp()
 
 void DihedralCosineShiftExp::compute(int eflag, int vflag)
 {
-  int i1,i2,i3,i4,i,m,n,type;
+  int i1,i2,i3,i4,n,type;
   double vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,vb2xm,vb2ym,vb2zm;
   double edihedral,f1[3],f2[3],f3[3],f4[3];
   double ax,ay,az,bx,by,bz,rasq,rbsq,rgsq,rg,rginv,ra2inv,rb2inv,rabinv;
-  double df,df1,ddf1,fg,hg,fga,hgb,gaa,gbb;
+  double df,fg,hg,fga,hgb,gaa,gbb;
   double dtfx,dtfy,dtfz,dtgx,dtgy,dtgz,dthx,dthy,dthz;
-  double c,s,p,sx2,sy2,sz2;
+  double c,s,sx2,sy2,sz2;
   double cccpsss,cssmscc,exp2;
 
   edihedral = 0.0;
diff --git a/src/USER-MISC/dihedral_fourier.cpp b/src/USER-MISC/dihedral_fourier.cpp
index c00dcfcfa5..4a9bb6a1a9 100644
--- a/src/USER-MISC/dihedral_fourier.cpp
+++ b/src/USER-MISC/dihedral_fourier.cpp
@@ -75,22 +75,17 @@ void DihedralFourier::compute(int eflag, int vflag)
   double ax,ay,az,bx,by,bz,rasq,rbsq,rgsq,rg,rginv,ra2inv,rb2inv,rabinv;
   double df,df1_,ddf1_,fg,hg,fga,hgb,gaa,gbb;
   double dtfx,dtfy,dtfz,dtgx,dtgy,dtgz,dthx,dthy,dthz;  
-  double c,s,p,p_,sx2,sy2,sz2;
-  int itype,jtype;
-  double delx,dely,delz,rsq,r2inv,r6inv;
+  double c,s,p_,sx2,sy2,sz2;
 
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = 0;
 
   double **x = atom->x;
   double **f = atom->f;
-  double *q = atom->q;
-  int *atomtype = atom->type;
   int **dihedrallist = neighbor->dihedrallist;
   int ndihedrallist = neighbor->ndihedrallist;
   int nlocal = atom->nlocal;
   int newton_bond = force->newton_bond;
-  double qqrd2e = force->qqrd2e;
 
   for (n = 0; n < ndihedrallist; n++) {
     i1 = dihedrallist[n][0];
@@ -178,7 +173,7 @@ void DihedralFourier::compute(int eflag, int vflag)
     {
       m = multiplicity[type][j];
       p_ = 1.0;
-      df1_ = 0.0;
+      ddf1_ = df1_ = 0.0;
     
       for (i = 0; i < m; i++) {
         ddf1_ = p_*c - df1_*s;
diff --git a/src/USER-MISC/dihedral_table.cpp b/src/USER-MISC/dihedral_table.cpp
index 5d7163cb53..1e486b2809 100644
--- a/src/USER-MISC/dihedral_table.cpp
+++ b/src/USER-MISC/dihedral_table.cpp
@@ -622,7 +622,7 @@ void DihedralTable::compute(int eflag, int vflag)
     // ----- Step 3: Calculate the energy and force in the phi direction -----
 
     // tabulated force & energy
-    double u, m_du_dphi; //u = energy.   m_du_dphi = "minus" du/dphi
+    double u=0.0, m_du_dphi=0.0; //u = energy.   m_du_dphi = "minus" du/dphi
     uf_lookup(type, phi, u, m_du_dphi);
 
     if (eflag) edihedral = u;
@@ -696,7 +696,7 @@ double DihedralTable::single(int type, int i1, int i2, int i3, int i4)
   double phi = Phi(x[i1], x[i2], x[i3], x[i4], domain,
                    vb12, vb23, vb34, n123, n234);
 
-  double u;
+  double u=0.0;
   u_lookup(type, phi, u); //Calculate the energy, and store it in "u"
 
   return u;
diff --git a/src/USER-MISC/pair_tersoff_table.cpp b/src/USER-MISC/pair_tersoff_table.cpp
index 343ff189c7..1652385fcf 100644
--- a/src/USER-MISC/pair_tersoff_table.cpp
+++ b/src/USER-MISC/pair_tersoff_table.cpp
@@ -238,7 +238,7 @@ void PairTersoffTable::compute(int eflag, int vflag)
     } // loop on J
 
 
-    // loop over neighbours of atom i
+    // loop over neighbors of atom i
     for (int neighbor_j = 0; neighbor_j < jnum; neighbor_j++) {
 
       double dr_ij[3], r_ij, f_ij[3];
@@ -289,7 +289,7 @@ void PairTersoffTable::compute(int eflag, int vflag)
 
       zeta = 0.0;
 
-      // first loop over neighbours of atom i except j - part 1/2
+      // first loop over neighbors of atom i except j - part 1/2
       for (int neighbor_k = 0; neighbor_k < neighbor_j; neighbor_k++) {
         double dr_ik[3], r_ik;
 
@@ -318,7 +318,7 @@ void PairTersoffTable::compute(int eflag, int vflag)
 
       }
 
-      // first loop over neighbours of atom i except j - part 2/2
+      // first loop over neighbors of atom i except j - part 2/2
       for (int neighbor_k = neighbor_j+1; neighbor_k < jnum; neighbor_k++) {
         double dr_ik[3], r_ik;
 
@@ -384,7 +384,7 @@ void PairTersoffTable::compute(int eflag, int vflag)
 
       factor_force_tot= 0.5*cutoffFunctionIJ*attractivePotential*betaZetaPowerDerivedIJK;
 
-      // second loop over neighbours of atom i except j, forces and virial only - part 1/2
+      // second loop over neighbors of atom i except j, forces and virial only - part 1/2
       for (int neighbor_k = 0; neighbor_k < neighbor_j; neighbor_k++) {
         double dr_ik[3], r_ik, f_ik[3];
 
@@ -449,7 +449,7 @@ void PairTersoffTable::compute(int eflag, int vflag)
         if (evflag) ev_tally3(i,j,k,evdwl,0.0,f_ij,f_ik,dr_ij,dr_ik);
       }
 
-      // second loop over neighbours of atom i except j, forces and virial only - part 2/2
+      // second loop over neighbors of atom i except j, forces and virial only - part 2/2
       for (int neighbor_k = neighbor_j+1; neighbor_k < jnum; neighbor_k++) {
         double dr_ik[3], r_ik, f_ik[3];
 
diff --git a/src/USER-OMP/angle_cosine_squared_omp.cpp b/src/USER-OMP/angle_cosine_squared_omp.cpp
index 003b8a71f4..20ba91d1d5 100644
--- a/src/USER-OMP/angle_cosine_squared_omp.cpp
+++ b/src/USER-OMP/angle_cosine_squared_omp.cpp
@@ -94,6 +94,7 @@ void AngleCosineSquaredOMP::eval(int nfrom, int nto, ThrData * const thr)
   dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
   const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0];
   const int nlocal = atom->nlocal;
+  eangle = 0.0;
 
   for (n = nfrom; n < nto; n++) {
     i1 = anglelist[n].a;
diff --git a/src/USER-OMP/dihedral_fourier_omp.cpp b/src/USER-OMP/dihedral_fourier_omp.cpp
index c8ab2bbf57..f63f45c9a8 100644
--- a/src/USER-OMP/dihedral_fourier_omp.cpp
+++ b/src/USER-OMP/dihedral_fourier_omp.cpp
@@ -184,7 +184,7 @@ void DihedralFourierOMP::eval(int nfrom, int nto, ThrData * const thr)
     for (j=0; j<nterms[type]; j++) {
       m = multiplicity[type][j];
       p_ = 1.0;
-      df1_ = 0.0;
+      ddf1_ = df1_ = 0.0;
 
       for (i = 0; i < m; i++) {
         ddf1_ = p_*c - df1_*s;
diff --git a/src/USER-OMP/dihedral_table_omp.cpp b/src/USER-OMP/dihedral_table_omp.cpp
index c69a0bf181..fdc05e7ba0 100644
--- a/src/USER-OMP/dihedral_table_omp.cpp
+++ b/src/USER-OMP/dihedral_table_omp.cpp
@@ -336,7 +336,7 @@ void DihedralTableOMP::eval(int nfrom, int nto, ThrData * const thr)
     // ----- Step 3: Calculate the energy and force in the phi direction -----
 
     // tabulated force & energy
-    double u, m_du_dphi; //u = energy.   m_du_dphi = "minus" du/dphi
+    double u=0.0, m_du_dphi=0.0; //u = energy.   m_du_dphi = "minus" du/dphi
 
     uf_lookup(type, phi, u, m_du_dphi);
 
diff --git a/src/USER-OMP/pair_coul_wolf_omp.cpp b/src/USER-OMP/pair_coul_wolf_omp.cpp
index abfdef1073..a9ad976e4b 100644
--- a/src/USER-OMP/pair_coul_wolf_omp.cpp
+++ b/src/USER-OMP/pair_coul_wolf_omp.cpp
@@ -82,7 +82,7 @@ void PairCoulWolfOMP::eval(int iifrom, int iito, ThrData * const thr)
   double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,ecoul,fpair;
   double rsq,forcecoul,factor_coul;
   double prefactor;
-  double r,rexp;
+  double r;
   int *ilist,*jlist,*numneigh,**firstneigh;
   double erfcc,erfcd,v_sh,dvdrr,e_self,e_shift,f_shift,qisq;
 
@@ -91,7 +91,6 @@ void PairCoulWolfOMP::eval(int iifrom, int iito, ThrData * const thr)
   const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0];
   dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
   const double * _noalias const q = atom->q;
-  const int * _noalias const type = atom->type;
   const int nlocal = atom->nlocal;
   const double * _noalias const special_coul = force->special_coul;
   const double qqrd2e = force->qqrd2e;
diff --git a/src/USER-OMP/pair_gayberne_omp.cpp b/src/USER-OMP/pair_gayberne_omp.cpp
index 11d5d8a233..ed5cc92701 100644
--- a/src/USER-OMP/pair_gayberne_omp.cpp
+++ b/src/USER-OMP/pair_gayberne_omp.cpp
@@ -98,6 +98,7 @@ void PairGayBerneOMP::eval(int iifrom, int iito, ThrData * const thr)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
+  evdwl = 0.0;
 
   // loop over neighbors of my atoms
 
diff --git a/src/USER-OMP/pair_nb3b_harmonic_omp.cpp b/src/USER-OMP/pair_nb3b_harmonic_omp.cpp
index 330c01c799..1877b26fbc 100644
--- a/src/USER-OMP/pair_nb3b_harmonic_omp.cpp
+++ b/src/USER-OMP/pair_nb3b_harmonic_omp.cpp
@@ -72,7 +72,7 @@ void PairNb3bHarmonicOMP::eval(int iifrom, int iito, ThrData * const thr)
   int i,j,k,ii,jj,kk,jnum,jnumm1;
   tagint itag,jtag;
   int itype,jtype,ktype,ijparam,ikparam,ijkparam;
-  double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
+  double xtmp,ytmp,ztmp,delx,dely,delz,evdwl;
   double rsq,rsq1,rsq2;
   double delr1[3],delr2[3],fj[3],fk[3];
   int *ilist,*jlist,*numneigh,**firstneigh;
@@ -83,7 +83,6 @@ void PairNb3bHarmonicOMP::eval(int iifrom, int iito, ThrData * const thr)
   dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0];
   const tagint * _noalias const tag = atom->tag;
   const int * _noalias const type = atom->type;
-  const int nlocal = atom->nlocal;
 
   ilist = list->ilist;
   numneigh = list->numneigh;
diff --git a/src/USER-OMP/pair_table_omp.cpp b/src/USER-OMP/pair_table_omp.cpp
index 811de8d206..9e1340b300 100644
--- a/src/USER-OMP/pair_table_omp.cpp
+++ b/src/USER-OMP/pair_table_omp.cpp
@@ -79,7 +79,7 @@ void PairTableOMP::eval(int iifrom, int iito, ThrData * const thr)
   double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
   double rsq,factor_lj,fraction,value,a,b;
   int *ilist,*jlist,*numneigh,**firstneigh;
-  Table *tb;
+  const Table *tb;
 
   union_int_float_t rsq_lookup;
   int tlm1 = tablength - 1;
diff --git a/src/USER-OMP/pair_tersoff_table_omp.cpp b/src/USER-OMP/pair_tersoff_table_omp.cpp
index 2dac432374..86d8cdecc0 100644
--- a/src/USER-OMP/pair_tersoff_table_omp.cpp
+++ b/src/USER-OMP/pair_tersoff_table_omp.cpp
@@ -227,7 +227,7 @@ void PairTersoffTableOMP::eval(int iifrom, int iito, ThrData * const thr)
     } // loop on J
 
 
-    // loop over neighbours of atom i
+    // loop over neighbors of atom i
     for (int neighbor_j = 0; neighbor_j < jnum; neighbor_j++) {
 
       double dr_ij[3], r_ij, f_ij[3];
@@ -278,7 +278,7 @@ void PairTersoffTableOMP::eval(int iifrom, int iito, ThrData * const thr)
 
       zeta = 0.0;
 
-      // first loop over neighbours of atom i except j - part 1/2
+      // first loop over neighbors of atom i except j - part 1/2
       for (int neighbor_k = 0; neighbor_k < neighbor_j; neighbor_k++) {
         double dr_ik[3], r_ik;
 
@@ -307,7 +307,7 @@ void PairTersoffTableOMP::eval(int iifrom, int iito, ThrData * const thr)
 
       }
 
-      // first loop over neighbours of atom i except j - part 2/2
+      // first loop over neighbors of atom i except j - part 2/2
       for (int neighbor_k = neighbor_j+1; neighbor_k < jnum; neighbor_k++) {
         double dr_ik[3], r_ik;
 
@@ -374,7 +374,7 @@ void PairTersoffTableOMP::eval(int iifrom, int iito, ThrData * const thr)
 
       factor_force_tot= 0.5*cutoffFunctionIJ*attractivePotential*betaZetaPowerDerivedIJK;
 
-      // second loop over neighbours of atom i except j, forces and virial only - part 1/2
+      // second loop over neighbors of atom i except j, forces and virial only - part 1/2
       for (int neighbor_k = 0; neighbor_k < neighbor_j; neighbor_k++) {
         double dr_ik[3], r_ik, f_ik[3];
 
@@ -440,7 +440,7 @@ void PairTersoffTableOMP::eval(int iifrom, int iito, ThrData * const thr)
         if (VFLAG_ATOM) v_tally3_thr(i,j,k,f_ij,f_ik,dr_ij,dr_ik,thr);
       }
 
-      // second loop over neighbours of atom i except j, forces and virial only - part 2/2
+      // second loop over neighbors of atom i except j, forces and virial only - part 2/2
       for (int neighbor_k = neighbor_j+1; neighbor_k < jnum; neighbor_k++) {
         double dr_ik[3], r_ik, f_ik[3];
 
diff --git a/src/USER-OMP/pair_tersoff_zbl_omp.cpp b/src/USER-OMP/pair_tersoff_zbl_omp.cpp
index 7d31f8075a..b92378d50d 100644
--- a/src/USER-OMP/pair_tersoff_zbl_omp.cpp
+++ b/src/USER-OMP/pair_tersoff_zbl_omp.cpp
@@ -124,7 +124,7 @@ void PairTersoffZBLOMP::read_file(char *file)
 
     // strip comment, skip line if blank
 
-    if (ptr = strchr(line,'#')) *ptr = '\0';
+    if ((ptr = strchr(line,'#'))) *ptr = '\0';
     nwords = atom->count_words(line);
     if (nwords == 0) continue;
 
@@ -143,7 +143,7 @@ void PairTersoffZBLOMP::read_file(char *file)
       if (eof) break;
       MPI_Bcast(&n,1,MPI_INT,0,world);
       MPI_Bcast(line,n,MPI_CHAR,0,world);
-      if (ptr = strchr(line,'#')) *ptr = '\0';
+      if ((ptr = strchr(line,'#'))) *ptr = '\0';
       nwords = atom->count_words(line);
     }
 
@@ -154,7 +154,7 @@ void PairTersoffZBLOMP::read_file(char *file)
 
     nwords = 0;
     words[nwords++] = strtok(line," \t\n\r\f");
-    while (words[nwords++] = strtok(NULL," \t\n\r\f")) continue;
+    while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue;
 
     // ielement,jelement,kelement = 1st args
     // if all 3 args are in element list, then parse this line
diff --git a/src/USER-REAXC/pair_reax_c.cpp b/src/USER-REAXC/pair_reax_c.cpp
index b7b2a8238d..c6f98c7f77 100644
--- a/src/USER-REAXC/pair_reax_c.cpp
+++ b/src/USER-REAXC/pair_reax_c.cpp
@@ -609,11 +609,11 @@ void PairReaxC::set_far_nbr( far_neighbor_data *fdest,
 
 int PairReaxC::estimate_reax_lists()
 {
-  int itr_i, itr_j, itr_g, i, j, g;
+  int itr_i, itr_j, i, j;
   int nlocal, nghost, num_nbrs, num_marked;
   int *ilist, *jlist, *numneigh, **firstneigh, *marked;
-  double d_sqr, g_d_sqr;
-  rvec dvec, g_dvec;
+  double d_sqr;
+  rvec dvec;
   double *dist, **x;
   reax_list *far_nbrs;
   far_neighbor_data *far_list;
@@ -636,11 +636,9 @@ int PairReaxC::estimate_reax_lists()
   marked = (int*) calloc( system->N, sizeof(int) );
   dist = (double*) calloc( system->N, sizeof(double) );
 
-  int inum = list->inum;
-  int gnum = list->gnum;
-  int numall = inum + gnum;
+  int numall = list->inum + list->gnum;
 
-  for( itr_i = 0; itr_i < inum+gnum; ++itr_i ){
+  for( itr_i = 0; itr_i < numall; ++itr_i ){
     i = ilist[itr_i];
     marked[i] = 1;
     ++num_marked;
@@ -666,12 +664,12 @@ int PairReaxC::estimate_reax_lists()
 
 int PairReaxC::write_reax_lists()
 {
-  int itr_i, itr_j, itr_g, i, j, g, flag;
+  int itr_i, itr_j, i, j;
   int nlocal, nghost, num_nbrs;
   int *ilist, *jlist, *numneigh, **firstneigh, *marked;
-  double d_sqr, g_d, g_d_sqr;
-  rvec dvec, g_dvec;
-  double *dist, **x, SMALL = 0.0001;
+  double d_sqr;
+  rvec dvec;
+  double *dist, **x;
   reax_list *far_nbrs;
   far_neighbor_data *far_list;
 
@@ -689,11 +687,9 @@ int PairReaxC::write_reax_lists()
   marked = (int*) calloc( system->N, sizeof(int) );
   dist = (double*) calloc( system->N, sizeof(double) );
 
-  int inum = list->inum;
-  int gnum = list->gnum;
-  int numall = inum + gnum;
+  int numall = list->inum + list->gnum;
 
-  for( itr_i = 0; itr_i < inum+gnum; ++itr_i ){
+  for( itr_i = 0; itr_i < numall; ++itr_i ){
     i = ilist[itr_i];
     marked[i] = 1;
     jlist = firstneigh[i];
@@ -775,8 +771,6 @@ double PairReaxC::memory_usage()
   bytes += 19.0 * system->total_cap * sizeof(real);
   bytes += 3.0 * system->total_cap * sizeof(int);
 
-  double mem1 = bytes;
-
   // From reaxc_lists
   bytes += 2.0 * lists->n * sizeof(int);
   bytes += lists->num_intrs * sizeof(three_body_interaction_data);
@@ -796,8 +790,8 @@ double PairReaxC::memory_usage()
 
 void PairReaxC::FindBond()
 {
-  int i, ii, j, pj, nj, jtmp, jj;
-  double bo_tmp, bo_cut, rij, rsq, r_tmp;
+  int i, j, pj, nj;
+  double bo_tmp, bo_cut, r_tmp;
 
   bond_data *bo_ij;
   bo_cut = 0.10;
diff --git a/src/VORONOI/compute_voronoi_atom.cpp b/src/VORONOI/compute_voronoi_atom.cpp
index ba3dc7b9ea..83ce6376a3 100644
--- a/src/VORONOI/compute_voronoi_atom.cpp
+++ b/src/VORONOI/compute_voronoi_atom.cpp
@@ -141,7 +141,7 @@ void ComputeVoronoi::init()
 
 void ComputeVoronoi::compute_peratom()
 {
-  int i, j;
+  int i;
   const double e = 0.01;
 
   invoked_peratom = update->ntimestep;
@@ -182,7 +182,7 @@ void ComputeVoronoi::compute_peratom()
     syz = domain->yz/my;
 
     // cutghost is in lamda coordinates for triclinic boxes, use subxx_lamda
-    double *h = domain->h, cuttri[3];
+    double *h = domain->h;
     sublo_bound[0] = h[0]*sublo_lamda[0] + h[5]*sublo_lamda[1] + h[4]*sublo_lamda[2] + boxlo[0];
     sublo_bound[1] = h[1]*sublo_lamda[1] + h[3]*sublo_lamda[2] + boxlo[1];
     sublo_bound[2] = h[2]*sublo_lamda[2] + boxlo[2];
diff --git a/src/balance.cpp b/src/balance.cpp
index 6073b25b64..459c37febc 100644
--- a/src/balance.cpp
+++ b/src/balance.cpp
@@ -480,7 +480,7 @@ void Balance::dynamic_setup(char *str, int nitermax_in, double thresh_in)
 int Balance::dynamic()
 {
   int i,j,k,m,np,max;
-  double *split;
+  double *split = NULL;
 
   // no balancing if no atoms
 
diff --git a/src/body.cpp b/src/body.cpp
index d7fe8c35ad..20b4416376 100644
--- a/src/body.cpp
+++ b/src/body.cpp
@@ -26,6 +26,8 @@ Body::Body(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
   int n = strlen(arg[0]) + 1;
   style = new char[n];
   strcpy(style,arg[0]);
+  icp = NULL;
+  dcp = NULL;
 }
 
 /* ---------------------------------------------------------------------- */
-- 
GitLab