diff --git a/src/ASPHERE/pair_tri_lj.cpp b/src/ASPHERE/pair_tri_lj.cpp
index a97ebe78ac789549dd0a63a75f55f576a4050ae6..72e6588a2496d768bc7eb392c51214dfe5c6d8dd 100644
--- a/src/ASPHERE/pair_tri_lj.cpp
+++ b/src/ASPHERE/pair_tri_lj.cpp
@@ -515,8 +515,6 @@ double PairTriLJ::init_one(int i, int j)
 void PairTriLJ::discretize(int i, double sigma,
                           double *c1, double *c2, double *c3)
 {
-  double c1c2[3],c2c3[3],c1c3[3];
-
   double centroid[3],dc1[3],dc2[3],dc3[3];
 
   centroid[0] = (c1[0] + c2[0] + c3[0]) / 3.0;
diff --git a/src/COLLOID/fix_wall_colloid.cpp b/src/COLLOID/fix_wall_colloid.cpp
index 1ce2cbabd809da6d36dfd07eddd481cd4d960353..41e8e9740aff2b6d4a55d2047438a00984c42851 100644
--- a/src/COLLOID/fix_wall_colloid.cpp
+++ b/src/COLLOID/fix_wall_colloid.cpp
@@ -78,7 +78,7 @@ void FixWallColloid::wall_particle(int m, int which, double coord)
 {
   double delta,delta2,rinv,r2inv,r4inv,r8inv,fwall;
   double r2,rinv2,r2inv2,r4inv2;
-  double r3,rinv3,r2inv3,r4inv3,r6inv3;
+  double r3,rinv3,r2inv3,r4inv3;
   double rad,rad2,rad4,rad8,diam,new_coeff2;
   double eoffset;
 
@@ -129,7 +129,6 @@ void FixWallColloid::wall_particle(int m, int which, double coord)
       rinv3 = 1.0/r3;
       r2inv3 = rinv3*rinv3;
       r4inv3 = r2inv3*r2inv3;
-      r6inv3 = r4inv3*r2inv3;
       ewall[0] += coeff3[m]*((-3.5*diam+delta)*r4inv2*r2inv2*rinv2
                              + (3.5*diam+delta)*r4inv3*r2inv3*rinv3) -
         coeff4[m]*((diam*delta-r2*r3*(log(-r2)-log(r3)))*
@@ -145,7 +144,6 @@ void FixWallColloid::wall_particle(int m, int which, double coord)
       rinv3 = 1.0/r3;
       r2inv3 = rinv3*rinv3;
       r4inv3 = r2inv3*r2inv3;
-      r6inv3 = r4inv3*r2inv3;
       eoffset = coeff3[m]*((-3.5*diam+cutoff[m])*r4inv2*r2inv2*rinv2
                            + (3.5*diam+cutoff[m])*r4inv3*r2inv3*rinv3) -
         coeff4[m]*((diam*cutoff[m]-r2*r3*(log(-r2)-log(r3)))*
diff --git a/src/COLLOID/pair_yukawa_colloid.cpp b/src/COLLOID/pair_yukawa_colloid.cpp
index 687070c490a58520ccd74b9b38c75367e5d1aabd..b0b33c46eb7c30c42edf0bd7fade5861be6cbcac 100644
--- a/src/COLLOID/pair_yukawa_colloid.cpp
+++ b/src/COLLOID/pair_yukawa_colloid.cpp
@@ -42,7 +42,7 @@ void PairYukawaColloid::compute(int eflag, int vflag)
 {
   int i,j,ii,jj,inum,jnum,itype,jtype;
   double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair,radi,radj;
-  double rsq,r2inv,r,rinv,screening,forceyukawa,factor;
+  double rsq,r,rinv,screening,forceyukawa,factor;
   int *ilist,*jlist,*numneigh,**firstneigh;
 
   evdwl = 0.0;
@@ -87,7 +87,6 @@ void PairYukawaColloid::compute(int eflag, int vflag)
       radj = radius[j];
 
       if (rsq < cutsq[itype][jtype]) {
-        r2inv = 1.0/rsq;
         r = sqrt(rsq);
         rinv = 1.0/r;
         screening = exp(-kappa*(r-(radi+radj)));
@@ -166,9 +165,8 @@ double PairYukawaColloid::single(int i, int j, int itype, int jtype,
                                  double factor_coul, double factor_lj,
                                  double &fforce)
 {
-  double r2inv,r,rinv,screening,forceyukawa,phi;
+  double r,rinv,screening,forceyukawa,phi;
 
-  r2inv = 1.0/rsq;
   r = sqrt(rsq);
   rinv = 1.0/r;
   screening = exp(-kappa*(r-(rad[itype]+rad[jtype])));
diff --git a/src/FLD/pair_brownian.cpp b/src/FLD/pair_brownian.cpp
index 3dd711edd69a680ec5fd433bde7724306c2ba3bc..47281b4c424725a882b99cabf6b64dfb9fc6bc79 100755
--- a/src/FLD/pair_brownian.cpp
+++ b/src/FLD/pair_brownian.cpp
@@ -84,7 +84,6 @@ void PairBrownian::compute(int eflag, int vflag)
   else evflag = vflag_fdotr = 0;
 
   double **x = atom->x;
-  double **v = atom->v;
   double **f = atom->f;
   double **torque = atom->torque;
   double *radius = atom->radius;
@@ -464,13 +463,12 @@ void PairBrownian::init_style()
                    "Pair brownian needs newton pair on for "
                    "momentum conservation");
 
-  int irequest = neighbor->request(this);
+  neighbor->request(this);
 
   // insure all particles are finite-size
   // for pair hybrid, should limit test to types using the pair style
 
   double *radius = atom->radius;
-  int *type = atom->type;
   int nlocal = atom->nlocal;
 
   for (int i = 0; i < nlocal; i++)
diff --git a/src/FLD/pair_brownian_poly.cpp b/src/FLD/pair_brownian_poly.cpp
index 906c62cc6dda7a5d1e5a32642cc1a7198571b818..6c18f87f0bf1c59a9599f9ada4d3601490b002ed 100644
--- a/src/FLD/pair_brownian_poly.cpp
+++ b/src/FLD/pair_brownian_poly.cpp
@@ -70,7 +70,6 @@ void PairBrownianPoly::compute(int eflag, int vflag)
   else evflag = vflag_fdotr = 0;
 
   double **x = atom->x;
-  double **v = atom->v;
   double **f = atom->f;
   double **torque = atom->torque;
   double *radius = atom->radius;
@@ -340,7 +339,6 @@ void PairBrownianPoly::init_style()
   // for pair hybrid, should limit test to types using the pair style
 
   double *radius = atom->radius;
-  int *type = atom->type;
   int nlocal = atom->nlocal;
 
   for (int i = 0; i < nlocal; i++)
diff --git a/src/GPU/pair_born_coul_long_gpu.cpp b/src/GPU/pair_born_coul_long_gpu.cpp
index a9fd7a703e39eddcb075321f30c6a91da63f5d56..7da9440b76c97ce67966f3b0ca2188d8ea568f4f 100644
--- a/src/GPU/pair_born_coul_long_gpu.cpp
+++ b/src/GPU/pair_born_coul_long_gpu.cpp
@@ -210,9 +210,8 @@ void PairBornCoulLongGPU::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;
+  int i,j,ii,jj,jnum,itype,jtype;
   double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul,fpair;
-  double fraction,table;
   double r,rexp,r2inv,r6inv,forcecoul,forceborn,factor_coul,factor_lj;
   double grij,expm2,prefactor,t,erfc;
   int *jlist;
diff --git a/src/GPU/pair_buck_coul_long_gpu.cpp b/src/GPU/pair_buck_coul_long_gpu.cpp
index 752e45e0c382dcd8d927fa5bceb4ae30fa6ac530..27a8095a188fa72aca5162bf108ba22298ff5203 100644
--- a/src/GPU/pair_buck_coul_long_gpu.cpp
+++ b/src/GPU/pair_buck_coul_long_gpu.cpp
@@ -203,9 +203,8 @@ void PairBuckCoulLongGPU::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;
+  int i,j,ii,jj,jnum,itype,jtype;
   double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul,fpair;
-  double fraction,table;
   double r,rexp,r2inv,r6inv,forcecoul,forcebuck,factor_coul,factor_lj;
   double grij,expm2,prefactor,t,erfc;
   int *jlist;
diff --git a/src/GPU/pair_dpd_tstat_gpu.cpp b/src/GPU/pair_dpd_tstat_gpu.cpp
index b9c8bb905bab5f72f076e0c14b0ec72b60dd2c04..a6c7dfb1c66e321599b757751155fde8df5f506e 100644
--- a/src/GPU/pair_dpd_tstat_gpu.cpp
+++ b/src/GPU/pair_dpd_tstat_gpu.cpp
@@ -338,7 +338,7 @@ double PairDPDTstatGPU::memory_usage()
 void PairDPDTstatGPU::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 xtmp,ytmp,ztmp,delx,dely,delz,fpair;
   double vxtmp,vytmp,vztmp,delvx,delvy,delvz;
   double rsq,r,rinv,dot,wd,randnum,factor_dpd;
   int *jlist;
diff --git a/src/GPU/pair_eam_gpu.cpp b/src/GPU/pair_eam_gpu.cpp
index e917ba56b58d679fcbc79dd021bf917dafd332c9..8e5af61f5a61d9e534fa5b58ff3aa68e9410a81f 100644
--- a/src/GPU/pair_eam_gpu.cpp
+++ b/src/GPU/pair_eam_gpu.cpp
@@ -94,18 +94,13 @@ double PairEAMGPU::memory_usage()
 
 void PairEAMGPU::compute(int eflag, int vflag)
 {
-  double evdwl;
-
-  evdwl = 0.0;
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = eflag_global = eflag_atom = 0;
 
-  int nlocal = atom->nlocal;
-  int newton_pair = force->newton_pair;
-
   // compute density on each atom on GPU
 
-  int nall = atom->nlocal + atom->nghost;
+  int nlocal = atom->nlocal;
+  int nall = nlocal + atom->nghost;
   int inum, host_start, inum_dev;
 
   bool success = true;
diff --git a/src/GPU/pair_lj_sdk_coul_long_gpu.cpp b/src/GPU/pair_lj_sdk_coul_long_gpu.cpp
index 2f33c17d029aa4aa5fc9961728aba66314fd478f..e32c9477dd080ecc22ab8d1d612b77e01f275122 100644
--- a/src/GPU/pair_lj_sdk_coul_long_gpu.cpp
+++ b/src/GPU/pair_lj_sdk_coul_long_gpu.cpp
@@ -214,13 +214,12 @@ void PairLJSDKCoulLongGPU::cpu_compute(int start, int inum, int *ilist,
 {
   int i,j,ii,jj;
   double qtmp,xtmp,ytmp,ztmp;
-  double r,rsq,r2inv,r6inv,forcecoul,forcelj,factor_coul,factor_lj;
+  double r2inv,forcecoul,forcelj,factor_coul,factor_lj;
 
   const double * const * const x = atom->x;
   double * const * const f = atom->f;
   const double * const q = atom->q;
   const int * const type = atom->type;
-  const int nlocal = atom->nlocal;
   const double * const special_coul = force->special_coul;
   const double * const special_lj = force->special_lj;
   const double qqrd2e = force->qqrd2e;
diff --git a/src/GRANULAR/fix_pour.cpp b/src/GRANULAR/fix_pour.cpp
index abcd5d7335c53c7f5bb41004057f708d6f62d63b..f878479b722619d28e2f4451a260a6b663eae7cc 100644
--- a/src/GRANULAR/fix_pour.cpp
+++ b/src/GRANULAR/fix_pour.cpp
@@ -447,13 +447,12 @@ void FixPour::pre_exchange()
 
   int success;
   double radtmp,delx,dely,delz,rsq,radsum,rn,h;
-  double coord[3],xcm[3];
+  double coord[3];
 
   int nfix = modify->nfix;
   Fix **fix = modify->fix;
 
-  AtomVec *avec = atom->avec;
-  double denstmp,vxtmp,vytmp,vztmp;
+  double denstmp;
   double *sublo = domain->sublo;
   double *subhi = domain->subhi;
 
@@ -707,11 +706,6 @@ int FixPour::overlap(int i)
   if (mode == ATOM) delta = atom->radius[i] + radius_max;
   else delta = atom->radius[i] + onemol->molradius;
 
-  double *boxlo = domain->boxlo;
-  double *boxhi = domain->boxhi;
-  double *prd = domain->prd;
-  int *periodicity = domain->periodicity;
-
   double *x = atom->x[i];
 
   if (domain->dimension == 3) {
diff --git a/src/GRANULAR/pair_gran_hooke.cpp b/src/GRANULAR/pair_gran_hooke.cpp
index c6b1a832316a703ee442302d7df7ea01d29e5185..7e3f52eedf11b32c477f9aadd3ed40d3b1a1872b 100644
--- a/src/GRANULAR/pair_gran_hooke.cpp
+++ b/src/GRANULAR/pair_gran_hooke.cpp
@@ -41,7 +41,7 @@ PairGranHooke::PairGranHooke(LAMMPS *lmp) : PairGranHookeHistory(lmp)
 
 void PairGranHooke::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;
@@ -235,7 +235,7 @@ double PairGranHooke::single(int i, int j, int itype, int jtype, double rsq,
   double vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3,wr1,wr2,wr3;
   double vtr1,vtr2,vtr3,vrel;
   double mi,mj,meff,damp,ccel;
-  double fn,fs,ft,fs1,fs2,fs3;
+  double fn,fs,ft;
 
   double *radius = atom->radius;
   radi = radius[i];
diff --git a/src/GRANULAR/pair_gran_hooke_history.cpp b/src/GRANULAR/pair_gran_hooke_history.cpp
index 83e232b11ede9a367e3331eae596457bb1569cce..a6312808bff034c005a3e1ccbcbc7695fe499368 100644
--- a/src/GRANULAR/pair_gran_hooke_history.cpp
+++ b/src/GRANULAR/pair_gran_hooke_history.cpp
@@ -86,7 +86,7 @@ PairGranHookeHistory::~PairGranHookeHistory()
 
 void PairGranHookeHistory::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;
@@ -712,7 +712,6 @@ double PairGranHookeHistory::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/pair_lj_cut_tip4p_long.cpp b/src/KSPACE/pair_lj_cut_tip4p_long.cpp
index 05aa14e2c6737dca6c2cfc7c851a70f177390c67..dbcacc0dd810528a3c9ea616b6f7f0e17c11fb46 100644
--- a/src/KSPACE/pair_lj_cut_tip4p_long.cpp
+++ b/src/KSPACE/pair_lj_cut_tip4p_long.cpp
@@ -83,11 +83,10 @@ void PairLJCutTIP4PLong::compute(int eflag, int vflag)
   int iH1,iH2,jH1,jH2;
   double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul;
   double fraction,table;
-  double delxOM, delyOM, delzOM;
   double r,r2inv,r6inv,forcecoul,forcelj,cforce;
   double factor_coul,factor_lj;
-  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;
diff --git a/src/KSPACE/pair_lj_long_coul_long.cpp b/src/KSPACE/pair_lj_long_coul_long.cpp
index 19cfa7d0ae62fa8b7ea33162f7f124cd8e9fb96d..32d962581f0608a0667249474a3452562aa55a1e 100644
--- a/src/KSPACE/pair_lj_long_coul_long.cpp
+++ b/src/KSPACE/pair_lj_long_coul_long.cpp
@@ -221,11 +221,6 @@ void PairLJLongCoulLong::coeff(int narg, char **arg)
 
 void PairLJLongCoulLong::init_style()
 {
-  const char *style1[] = 
-    {"ewald", "ewald/n", "pppm", "pppm_disp", "pppm_disp/tip4p", NULL};
-  const char *style6[] = {"ewald/n", "pppm_disp", "pppm_disp/tip4p", NULL};
-  int i;
-
   // require an atom style with charge defined
 
   if (!atom->q_flag && (ewald_order&(1<<1)))
diff --git a/src/KSPACE/pair_lj_long_tip4p_long.cpp b/src/KSPACE/pair_lj_long_tip4p_long.cpp
index 04723a27a19a1678ca4547b5a5a06775d402d80b..868a5274c7bb40f6884655a81032bcd0df5926aa 100755
--- a/src/KSPACE/pair_lj_long_tip4p_long.cpp
+++ b/src/KSPACE/pair_lj_long_tip4p_long.cpp
@@ -84,9 +84,9 @@ void PairLJLongTIP4PLong::compute(int eflag, int vflag)
   double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul;
   double fraction,table;
   double r,r2inv,forcecoul,forcelj,cforce;
-  double factor_coul,factor_lj;
+  double factor_coul;
   double grij,expm2,prefactor,t,erfc;
-  double xiM[3],xjM[3],fO[3],fH[3],fd[3],v[6],xH1[3],xH2[3];// f1[3];
+  double fO[3],fH[3],fd[3],v[6],xH1[3],xH2[3];// f1[3];
   double *x1,*x2;
   int *ilist,*jlist,*numneigh,**firstneigh;
   double rsq;
@@ -126,7 +126,7 @@ void PairLJLongTIP4PLong::compute(int eflag, int vflag)
 
   int order1 = ewald_order&(1<<1), order6 = ewald_order&(1<<6);
   int ni;
-  double  *cut_ljsqi, *lj1i, *lj2i, *lj3i, *lj4i, *offseti;
+  double  *lj1i, *lj2i, *lj3i, *lj4i, *offseti;
   double g2 = g_ewald_6*g_ewald_6, g6 = g2*g2*g2, g8 = g6*g2;
 
   inum = list->inum;
@@ -172,7 +172,6 @@ void PairLJLongTIP4PLong::compute(int eflag, int vflag)
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       ni = sbmask(j);
-      factor_lj = special_lj[sbmask(j)];
       factor_coul = special_coul[sbmask(j)];
       j &= NEIGHMASK;
 
@@ -460,13 +459,11 @@ void PairLJLongTIP4PLong::compute(int eflag, int vflag)
 
 void PairLJLongTIP4PLong::compute_inner()
 {
-  int i,j,ii,jj,inum,jnum,itype,jtype,itable;
+  int i,j,ii,jj,inum,jnum,itype,jtype;
   int iH1,iH2,jH1,jH2;
-  double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul;
-  double r,r2inv,forcecoul,forcelj,cforce;
-  double factor_coul,factor_lj;
-  double grij,expm2,prefactor,t,erfc;
-  double xiM[3],xjM[3],fO[3],fH[3],fd[3],v[6],xH1[3],xH2[3];// f1[3];
+  double qtmp,xtmp,ytmp,ztmp,delx,dely,delz;
+  double r2inv,forcecoul,forcelj,cforce;
+  double fO[3],fH[3],fd[3];// f1[3];
   double *x1,*x2;
   int *ilist,*jlist,*numneigh,**firstneigh;
   double rsq, qri;
@@ -504,13 +501,12 @@ void PairLJLongTIP4PLong::compute_inner()
   int *type = atom->type;
   double *special_coul = force->special_coul;
   double *special_lj = force->special_lj;
-  int newton_pair = force->newton_pair;
   double qqrd2e = force->qqrd2e;
   double cut_coulsqplus = (cut_coul+2.0*qdist)*(cut_coul+2.0*qdist);
 
   int order1 = ewald_order&(1<<1);
   int ni;
-  double  *cut_ljsqi, *lj1i, *lj2i, *lj3i, *lj4i, *offseti;
+  double *lj1i, *lj2i;
 
   inum = listinner->inum;
   ilist = listinner->ilist;
@@ -549,14 +545,11 @@ void PairLJLongTIP4PLong::compute_inner()
 
     jlist = firstneigh[i];
     jnum = numneigh[i];
-    offseti = offset[itype];
-    lj1i = lj1[itype]; lj2i = lj2[itype]; lj3i = lj3[itype]; lj4i = lj4[itype];
+    lj1i = lj1[itype]; lj2i = lj2[itype];
 
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       ni = sbmask(j);
-      factor_lj = special_lj[sbmask(j)];
-      factor_coul = special_coul[sbmask(j)];
       j &= NEIGHMASK;
 
       delx = xtmp - x[j][0];
@@ -719,13 +712,11 @@ void PairLJLongTIP4PLong::compute_inner()
 
 void PairLJLongTIP4PLong::compute_middle()
 {
-  int i,j,ii,jj,inum,jnum,itype,jtype,itable;
+  int i,j,ii,jj,inum,jnum,itype,jtype;
   int iH1,iH2,jH1,jH2;
-  double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul;
-  double r,r2inv,forcecoul,forcelj,cforce;
-  double factor_coul,factor_lj;
-  double grij,expm2,prefactor,t,erfc;
-  double xiM[3],xjM[3],fO[3],fH[3],fd[3],v[6],xH1[3],xH2[3];// f1[3];
+  double qtmp,xtmp,ytmp,ztmp,delx,dely,delz;
+  double r2inv,forcecoul,forcelj,cforce;
+  double fO[3],fH[3],fd[3];
   double *x1,*x2;
   int *ilist,*jlist,*numneigh,**firstneigh;
   double rsq,qri;
@@ -746,8 +737,6 @@ void PairLJLongTIP4PLong::compute_middle()
   // initialize hneigh[0] to -1 on steps when reneighboring occurred
   // initialize hneigh[2] to 0 every step
 
-  int nlocal = atom->nlocal;
-
   double **f = atom->f;
   double **x = atom->x;
   double *q = atom->q;
@@ -755,14 +744,12 @@ void PairLJLongTIP4PLong::compute_middle()
   int *type = atom->type;
   double *special_coul = force->special_coul;
   double *special_lj = force->special_lj;
-  int newton_pair = force->newton_pair;
   double qqrd2e = force->qqrd2e;
   double cut_coulsqplus = (cut_coul+2.0*qdist)*(cut_coul+2.0*qdist);
 
   int order1 = ewald_order&(1<<1);
   int ni;
-  double  *cut_ljsqi, *lj1i, *lj2i, *lj3i, *lj4i, *offseti;
-  double g2 = g_ewald_6*g_ewald_6, g6 = g2*g2*g2, g8 = g6*g2;
+  double  *lj1i, *lj2i;
 
   inum = listmiddle->inum;
   ilist = listmiddle->ilist;
@@ -801,14 +788,11 @@ void PairLJLongTIP4PLong::compute_middle()
 
     jlist = firstneigh[i];
     jnum = numneigh[i];
-    offseti = offset[itype];
-    lj1i = lj1[itype]; lj2i = lj2[itype]; lj3i = lj3[itype]; lj4i = lj4[itype];
+    lj1i = lj1[itype]; lj2i = lj2[itype];
 
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       ni = sbmask(j);
-      factor_lj = special_lj[sbmask(j)];
-      factor_coul = special_coul[sbmask(j)];
       j &= NEIGHMASK;
 
       delx = xtmp - x[j][0];
@@ -979,16 +963,13 @@ void PairLJLongTIP4PLong::compute_middle()
 
 void PairLJLongTIP4PLong::compute_outer(int eflag, int vflag)
 {
-  int i,j,ii,jj,inum,jnum,itype,jtype,itable;
+  int i,j,ii,jj,inum,jnum,itype,jtype;
   int n,vlist[6];
   int key;
   int iH1,iH2,jH1,jH2;
   double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul;
-  double fraction,table;
-  double r,r2inv,forcecoul,forcelj,cforce, respa_coul, respa_lj, frespa,fvirial;
-  double factor_coul,factor_lj;
-  double grij,expm2,prefactor,t,erfc;
-  double xiM[3],xjM[3],fO[3],fH[3],fd[3],v[6],xH1[3],xH2[3];// f1[3];
+  double r2inv,forcecoul,forcelj,cforce, respa_coul, respa_lj, frespa,fvirial;
+  double fO[3],fH[3],fd[3],v[6],xH1[3],xH2[3];// f1[3];
   double *x1,*x2;
   int *ilist,*jlist,*numneigh,**firstneigh;
   double rsq,qri;
@@ -1030,7 +1011,7 @@ void PairLJLongTIP4PLong::compute_outer(int eflag, int vflag)
 
   int order1 = ewald_order&(1<<1), order6 = ewald_order&(1<<6);
   int ni;
-  double  *cut_ljsqi, *lj1i, *lj2i, *lj3i, *lj4i, *offseti;
+  double *lj1i, *lj2i, *lj3i, *lj4i, *offseti;
   double g2 = g_ewald_6*g_ewald_6, g6 = g2*g2*g2, g8 = g6*g2;
 
   double cut_in_off = cut_respa[2];
@@ -1084,8 +1065,6 @@ void PairLJLongTIP4PLong::compute_outer(int eflag, int vflag)
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       ni = sbmask(j);
-      factor_lj = special_lj[sbmask(j)];
-      factor_coul = special_coul[sbmask(j)];
       j &= NEIGHMASK;
 
       delx = xtmp - x[j][0];
diff --git a/src/KSPACE/remap.cpp b/src/KSPACE/remap.cpp
index 51e4d1d6f2441f90c26e1bf402774dc1b92799cd..17cbe8a88905eecf9cb0dc86750168d858e278ea 100644
--- a/src/KSPACE/remap.cpp
+++ b/src/KSPACE/remap.cpp
@@ -114,12 +114,7 @@ void remap_3d(FFT_SCALAR *in, FFT_SCALAR *out, FFT_SCALAR *buf,
 
   } else { 
     if (plan->commringlen > 0) {
-      MPI_Status status;
-      int i,isend,irecv;
-      FFT_SCALAR *scratch;
-
-      if (plan->memory == 0) scratch = buf;
-      else scratch = plan->scratch;
+      int isend,irecv;
 
       // create send and recv buffers for alltoallv collective
 
@@ -180,9 +175,9 @@ void remap_3d(FFT_SCALAR *in, FFT_SCALAR *out, FFT_SCALAR *buf,
         }
       }
 
-      int mpirc = MPI_Alltoallv(packedSendBuffer, sendcnts, sdispls,
-                                MPI_FFT_SCALAR, packedRecvBuffer, rcvcnts,
-                                rdispls, MPI_FFT_SCALAR, plan->comm);
+      MPI_Alltoallv(packedSendBuffer, sendcnts, sdispls,
+                    MPI_FFT_SCALAR, packedRecvBuffer, rcvcnts,
+                    rdispls, MPI_FFT_SCALAR, plan->comm);
 
       // unpack the data from the recv buffer into out
 
diff --git a/src/MANYBODY/pair_airebo.cpp b/src/MANYBODY/pair_airebo.cpp
index febc3cb308bde23ac89c9bbaa7f8678bc6a9a3c2..98db58ec404a7159ca037f26fda7d814c18b5840 100644
--- a/src/MANYBODY/pair_airebo.cpp
+++ b/src/MANYBODY/pair_airebo.cpp
@@ -318,8 +318,6 @@ void PairAIREBO::REBO_neigh()
 
   double **x = atom->x;
   int *type = atom->type;
-  int nlocal = atom->nlocal;
-  int nall = nlocal + atom->nghost;
 
   if (atom->nmax > maxlocal) {
     maxlocal = atom->nmax;
diff --git a/src/MANYBODY/pair_comb.cpp b/src/MANYBODY/pair_comb.cpp
index 8168844718b8adf87bc8ec3ceacee83ee95d9460..d10307d5f823c933350d4dc7932b948186109c8e 100644
--- a/src/MANYBODY/pair_comb.cpp
+++ b/src/MANYBODY/pair_comb.cpp
@@ -1844,13 +1844,12 @@ void PairComb::qfo_direct(int inty, int mr1, int mr2, int mr3,
 void PairComb::qfo_field(Param *param, double rsq,double iq,double jq,
                          double &fqij, double &fqjj)
 {
- double r,r5,r6,rc,rc5,rc6;
+ double r,r5,rc,rc5,rc6;
  double cmi1,cmi2,cmj1,cmj2,rf5;
 
  fqij = fqjj = 0.0;
  r  = sqrt(rsq);
  r5 = r*r*r*r*r;
- r6 = r5 * r;
  rc = param->lcut;
  rc5 = rc*rc*rc*rc*rc;
  rc6 = rc5 * rc;
@@ -1871,7 +1870,7 @@ void PairComb::qfo_field(Param *param, double rsq,double iq,double jq,
 void PairComb::qfo_short(Param *param, int i, int j, double rsq,
                          double iq, double jq, double &fqij, double &fqjj)
 {
-  double r,tmp_fc,tmp_fc_d,tmp_exp1,tmp_exp2;
+  double r,tmp_fc,tmp_exp1,tmp_exp2;
   double bigA,Asi,Asj,vrcs;
   double romi = param->addrep,rrcs = param->bigr + param->bigd;
   double qi,qj,Di,Dj,bigB,Bsi,Bsj;
@@ -1881,7 +1880,7 @@ void PairComb::qfo_short(Param *param, int i, int j, double rsq,
   double romie = param->romiga;
   double romib = param->romigb;
   double ca1,ca2,ca3,ca4;
-  double rslp,rslp2,rslp4,arr1,arr2,fc2j,fc3j,fcp2j,fcp3j;
+  double rslp,rslp2,rslp4,arr1,arr2,fc2j,fc3j;
 
   qi = iq; qj = jq; r = sqrt(rsq);
   Di = Dj = Asi = Asj = bigA = Bsi = Bsj = bigB = 0.0;
@@ -1890,7 +1889,6 @@ void PairComb::qfo_short(Param *param, int i, int j, double rsq,
   caj = cbj = vrcs = cfqr = cfqs = 0.0;
 
   tmp_fc = comb_fc(r,param);
-  tmp_fc_d = comb_fc_d(r,param);
   tmp_exp1 = exp(-param->rlm1 * r);
   tmp_exp2 = exp(-param->rlm2 * r);
   bij = bbij[i][j]; //comb_bij(zeta_ij,param);
@@ -1898,8 +1896,6 @@ void PairComb::qfo_short(Param *param, int i, int j, double rsq,
   arr1 = 2.22850; arr2 = 1.89350;
   fc2j = comb_fc2(r);
   fc3j = comb_fc3(r);
-  fcp2j = comb_fc2_d(r);
-  fcp3j = comb_fc3_d(r);
 
   vrcs = 0.0;
   if (romi > 0.0) {
@@ -2047,14 +2043,13 @@ void PairComb::unpack_reverse_comm(int n, int *list, double *buf)
 
 void PairComb::Short_neigh()
 {
-  int nj,itype,jtype;
+  int nj;
   int inum,jnum,i,j,ii,jj;
   int *neighptrj,*ilist,*jlist,*numneigh;
   int **firstneigh;
   double xtmp,ytmp,ztmp,rsq,delrj[3];
 
   double **x = atom->x;
-  int *type  = atom->type;
 
   if (atom->nmax > nmax) {
     memory->sfree(sht_first);
@@ -2077,7 +2072,6 @@ void PairComb::Short_neigh()
 
   for (ii = 0; ii < inum; ii++) {
     i = ilist[ii];
-    itype = type[i];
 
     nj = 0;
     neighptrj = ipage->vget();
@@ -2092,7 +2086,6 @@ void PairComb::Short_neigh()
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       j &= NEIGHMASK;
-      jtype = type[j];
 
       delrj[0] = xtmp - x[j][0];
       delrj[1] = ytmp - x[j][1];
diff --git a/src/MANYBODY/pair_lcbop.cpp b/src/MANYBODY/pair_lcbop.cpp
index f6b35d97170af99edd7268dbd5d98271a0ffb994..4f9f897495313698891fc87616488adf93977102 100644
--- a/src/MANYBODY/pair_lcbop.cpp
+++ b/src/MANYBODY/pair_lcbop.cpp
@@ -259,8 +259,6 @@ void PairLCBOP::SR_neigh()
   int *neighptr;
 
   double **x = atom->x;
-  int nlocal = atom->nlocal;
-  int nall = nlocal + atom->nghost;
 
   if (atom->nmax > maxlocal) {  // ensure ther is enough space
     maxlocal = atom->nmax;      // for atoms and ghosts allocated
@@ -360,7 +358,7 @@ void PairLCBOP::FSR(int eflag, int vflag)
   double delx,dely,delz,fpair,xtmp,ytmp,ztmp;
   double r_sq,rijmag,f_c_ij,df_c_ij;
   double VR,dVRdi,VA,Bij,dVAdi,dVA;
-  double d_f_c_ij,del[3];
+  double del[3];
   int *ilist,*SR_neighs;
 
   double **x = atom->x;
@@ -451,7 +449,7 @@ void PairLCBOP::FSR(int eflag, int vflag)
 
 void PairLCBOP::FLR(int eflag, int vflag)
 {
-  int i,j,jj,m,ii;
+  int i,j,jj,ii;
   tagint itag,jtag;
   double delx,dely,delz,fpair,xtmp,ytmp,ztmp;
   double r_sq,rijmag,f_c_ij,df_c_ij;
@@ -556,7 +554,7 @@ void PairLCBOP::FNij( int i, int j, double factor, double **f, int vflag_atom )
       if( riksq > r_1*r_1 ) { // &&  riksq < r_2*r_2, if second condition not fulfilled neighbor would not be in the list
         double rikmag = sqrt(riksq);
         double df_c_ik;
-        double f_c_ik = f_c( rikmag, r_1, r_2, &df_c_ik );
+        f_c( rikmag, r_1, r_2, &df_c_ik );
 
         // F = factor*df_c_ik*(-grad rikmag)
         // grad_i rikmag =  \vec{rik} /rikmag
@@ -967,7 +965,7 @@ double PairLCBOP::F_conj( double N_ij, double N_ji, double N_conj_ij, double *dF
 
 void PairLCBOP::read_file(char *filename)
 {
-  int i,j,k,l,limit;
+  int i,k,l;
   char s[MAXLINE];
 
   MPI_Comm_rank(world,&me);
diff --git a/src/MC/fix_bond_create.cpp b/src/MC/fix_bond_create.cpp
index d514e78112b70581f4917e5163691bb37e577d14..fbc303878ff6bdfdf7629bc97d66027f8018589b 100755
--- a/src/MC/fix_bond_create.cpp
+++ b/src/MC/fix_bond_create.cpp
@@ -623,7 +623,7 @@ void FixBondCreate::check_ghosts()
 
 void FixBondCreate::update_topology()
 {
-  int i,j,k,n,influence,influenced,found;
+  int i,j,k,n,influence,influenced;
   tagint id1,id2;
   tagint *slist;
 
@@ -887,7 +887,7 @@ void FixBondCreate::create_angles(int m)
 
 void FixBondCreate::create_dihedrals(int m)
 {
-  int i,j,k,n,i1local,i2local,i3local,n1,n2,n3,n4;
+  int i,j,k,n,i1local,i2local,i3local,n1,n2,n3;
   tagint i1,i2,i3,i4;
   tagint *s1list,*s2list,*s3list;
 
diff --git a/src/MEAM/pair_meam.cpp b/src/MEAM/pair_meam.cpp
index c3d4ad7005cf03e8825ccb170ba0e8a0207134c8..aea02fde62b2bc4434c7aa82516639428e8efcaa 100644
--- a/src/MEAM/pair_meam.cpp
+++ b/src/MEAM/pair_meam.cpp
@@ -118,11 +118,9 @@ PairMEAM::~PairMEAM()
 void PairMEAM::compute(int eflag, int vflag)
 {
   int i,j,ii,n,inum_half,errorflag;
-  double evdwl;
   int *ilist_half,*numneigh_half,**firstneigh_half;
   int *numneigh_full,**firstneigh_full;
 
-  evdwl = 0.0;
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = eflag_global = vflag_global =
          eflag_atom = vflag_atom = 0;
diff --git a/src/MISC/compute_ti.cpp b/src/MISC/compute_ti.cpp
index f02277d6c61010e5b047431ef8cacbe3ef3f7da3..f24cb1c9500e38980ee3a4b0d848da2e0b0477f3 100644
--- a/src/MISC/compute_ti.cpp
+++ b/src/MISC/compute_ti.cpp
@@ -200,7 +200,7 @@ double ComputeTI::compute_scalar()
           else jt = ilo[m];
           for (; jt <=ihi[m];jt++) {
             if ((force->pair->tail_flag)&&(force->pair->setflag[it][jt])) {
-              double cut = force->pair->init_one(it,jt);
+              force->pair->init_one(it,jt);
               eng += force->pair->etail_ij;
             }
             if (it !=jt) eng += force->pair->etail_ij; 
diff --git a/src/MOLECULE/pair_tip4p_cut.cpp b/src/MOLECULE/pair_tip4p_cut.cpp
index 57bb72da8b6b25faddc6eb5acd1a36a4a32010f0..cd344f246877dc3d584dd91357d608d98cb9be30 100644
--- a/src/MOLECULE/pair_tip4p_cut.cpp
+++ b/src/MOLECULE/pair_tip4p_cut.cpp
@@ -106,7 +106,6 @@ void PairTIP4PCut::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;
 
   inum = list->inum;
diff --git a/src/PERI/pair_peri_eps.cpp b/src/PERI/pair_peri_eps.cpp
index 0bf339933f97ca53a6a3a4f50d5e0fe0bc8dda32..e5b7efbe1386a6f5f08d07bd8d2de953fcb77d88 100644
--- a/src/PERI/pair_peri_eps.cpp
+++ b/src/PERI/pair_peri_eps.cpp
@@ -89,8 +89,8 @@ void PairPeriEPS::compute(int eflag, int vflag)
   int i,j,ii,jj,inum,jnum,itype,jtype;
   double xtmp,ytmp,ztmp,delx,dely,delz;
   double xtmp0,ytmp0,ztmp0,delx0,dely0,delz0,rsq0;
-  double rsq,r,dr,dr1,rk,rkNew,evdwl,fpair,fbond;
-  double ed,fbondElastoPlastic,fbondFinal;
+  double rsq,r,dr,rk,rkNew,evdwl,fpair,fbond;
+  double fbondElastoPlastic,fbondFinal;
   double deltalambda,edpNp1;
   int *ilist,*jlist,*numneigh,**firstneigh;
   double d_ij,delta,stretch;
@@ -104,7 +104,6 @@ void PairPeriEPS::compute(int eflag, int vflag)
   int *type = atom->type;
   int nlocal = atom->nlocal;
 
-  double timestepsize = update->dt;
   double *vfrac = atom->vfrac;
   double *s0 = atom->s0;
   double **x0 = atom->x0;
@@ -259,7 +258,7 @@ void PairPeriEPS::compute(int eflag, int vflag)
   // first = true if this is first neighbor of particle i
 
   bool first;
-  double omega_minus, omega_plus, omega;
+  double omega_minus, omega_plus;
 
   for (i = 0; i < nlocal; i++) {
     xtmp = x[i][0];
@@ -717,17 +716,13 @@ double PairPeriEPS::compute_DeviatoricForceStateNorm(int i)
   double xtmp,ytmp,ztmp,delx,dely,delz;
   double xtmp0,ytmp0,ztmp0,delx0,dely0,delz0;
   double rsq,r,dr;
-  double delta;
   double tdtrial;
   double norm = 0.0;
 
   double **x = atom->x;
   int *type = atom->type;
   double **x0 = atom->x0;
-  double *s0 = atom->s0;
-  int nlocal = atom->nlocal;
   double *vfrac = atom->vfrac;
-  double vfrac_scale = 1.0;
 
   double lc = domain->lattice->xlattice;
   double half_lc = 0.5*lc;
@@ -795,8 +790,6 @@ double PairPeriEPS::compute_DeviatoricForceStateNorm(int i)
       double omega_plus  = influence_function(-1.0*delx0,-1.0*dely0,-1.0*delz0);
       double omega_minus = influence_function(delx0,dely0,delz0);
       
-      double stretch = dr / r0[i][jj];
-      
       tdtrial = ( 15 * shearmodulus[itype][itype]) *
            ((omega_plus * theta[i] / wvolume[i]) +
              ( omega_minus * theta[j] / wvolume[j] ) ) * (ed - edPNP1);
diff --git a/src/PERI/pair_peri_ves.cpp b/src/PERI/pair_peri_ves.cpp
index 6668de9a2ef338c105c6b07018cf1b8f87c9589d..b62130c40d820cdeb316ad9432e48cf7900d2aa6 100644
--- a/src/PERI/pair_peri_ves.cpp
+++ b/src/PERI/pair_peri_ves.cpp
@@ -91,7 +91,7 @@ void PairPeriVES::compute(int eflag, int vflag)
   int i,j,ii,jj,inum,jnum,itype,jtype;
   double xtmp,ytmp,ztmp,delx,dely,delz;
   double xtmp0,ytmp0,ztmp0,delx0,dely0,delz0,rsq0;
-  double rsq,r,dr,dr1,rk,evdwl,fpair,fbond;
+  double rsq,r,dr,rk,evdwl,fpair,fbond;
   double deltaed,fbondViscoElastic,fbondFinal;
   double decay,betai,lambdai,edbNp1,rkNew;
   int *ilist,*jlist,*numneigh,**firstneigh;
diff --git a/src/REPLICA/prd.cpp b/src/REPLICA/prd.cpp
index 6e008840a85c0497b6b41529e08d8c6dd3e4fdca..c2f08d33351e5b06bd73a9e6b9a32913ba974a84 100644
--- a/src/REPLICA/prd.cpp
+++ b/src/REPLICA/prd.cpp
@@ -58,7 +58,7 @@ PRD::PRD(LAMMPS *lmp) : Pointers(lmp) {}
 
 void PRD::command(int narg, char **arg)
 {
-  int flag,ireplica;
+  int ireplica;
 
   // error checks
 
@@ -773,7 +773,7 @@ void PRD::replicate(int ireplica)
 {
   int nreplica = universe->nworlds;
   int nprocs_universe = universe->nprocs;
-  int i,m,flag,commflag;
+  int i,m;
 
   if (nreplica == nprocs_universe) {
     MPI_Bcast(atom->image,atom->nlocal,MPI_INT,ireplica,comm_replica);
@@ -856,17 +856,17 @@ void PRD::options(int narg, char **arg)
   while (iarg < narg) {
     if (strcmp(arg[iarg],"min") == 0) {
       if (iarg+5 > narg) error->all(FLERR,"Illegal prd command");
-      etol = atof(arg[iarg+1]);
-      ftol = atof(arg[iarg+2]);
-      maxiter = atoi(arg[iarg+3]);
-      maxeval = atoi(arg[iarg+4]);
+      etol = force->numeric(FLERR,arg[iarg+1]);
+      ftol = force->numeric(FLERR,arg[iarg+2]);
+      maxiter = force->inumeric(FLERR,arg[iarg+3]);
+      maxeval = force->inumeric(FLERR,arg[iarg+4]);
       if (maxiter < 0) error->all(FLERR,"Illegal prd command");
       iarg += 5;
 
     } else if (strcmp(arg[iarg],"temp") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal prd command");
       temp_flag = 1;
-      temp_dephase = atof(arg[iarg+1]);
+      temp_dephase = force->numeric(FLERR,arg[iarg+1]);
       if (temp_dephase <= 0.0) error->all(FLERR,"Illegal prd command");
       iarg += 2;
 
diff --git a/src/RIGID/fix_shake.cpp b/src/RIGID/fix_shake.cpp
index 8741cf464a2f40998db9a277ce3819cbd7c97a8f..ef397c6e4629e269e305bea7f9941662f4985cef 100644
--- a/src/RIGID/fix_shake.cpp
+++ b/src/RIGID/fix_shake.cpp
@@ -645,7 +645,7 @@ int FixShake::dof(int igroup)
 void FixShake::find_clusters()
 {
   int i,j,m,n,imol,iatom;
-  int flag,flag_all,messtag,loop,nbuf,nbufmax,size;
+  int flag,flag_all,nbuf,size;
   tagint tagprev;
   double massone;
   tagint *buf;
diff --git a/src/SHOCK/fix_wall_piston.cpp b/src/SHOCK/fix_wall_piston.cpp
index 8cfc077e8d3f747365aad7fccb8486ea97cda9e7..8ea5a18af6a5efaeb8c1fadce321ba9a60b84357 100644
--- a/src/SHOCK/fix_wall_piston.cpp
+++ b/src/SHOCK/fix_wall_piston.cpp
@@ -185,7 +185,7 @@ void FixWallPiston::initial_integrate(int vflag)
 
 void FixWallPiston::post_integrate()
 {
-  double xlo, xhi, ylo, yhi, zlo, zhi;
+  double zlo;
 
   double **x = atom->x;
   double **v = atom->v;
diff --git a/src/USER-COLVARS/fix_colvars.cpp b/src/USER-COLVARS/fix_colvars.cpp
index 5927d8f63efd002bc08571aa0f49ffb915b85a53..402de3c6532582d6b929ce69210d1184cccca67b 100644
--- a/src/USER-COLVARS/fix_colvars.cpp
+++ b/src/USER-COLVARS/fix_colvars.cpp
@@ -75,8 +75,6 @@ static int inthash_lookup(void *tptr, int key);
 static int inthash_insert(inthash_t *tptr, int key, int data);
 /* delete the hash table */
 static void inthash_destroy(inthash_t *tptr);
-/* adapted sort for in-place sorting of map indices. */
-static void id_sort(int *idmap, int left, int right);
 
 /************************************************************************
  * integer hash code:
@@ -239,44 +237,6 @@ void inthash_destroy(inthash_t *tptr) {
   }
 }
 
-/************************************************************************
- * integer list sort code:
- ************************************************************************/
-
-/* sort for integer map. initial call  id_sort(idmap, 0, natoms - 1); */
-static void id_sort(int *idmap, int left, int right)
-{
-  int pivot, l_hold, r_hold;
-
-  l_hold = left;
-  r_hold = right;
-  pivot = idmap[left];
-
-  while (left < right) {
-    while ((idmap[right] >= pivot) && (left < right))
-      right--;
-    if (left != right) {
-      idmap[left] = idmap[right];
-      left++;
-    }
-    while ((idmap[left] <= pivot) && (left < right))
-      left++;
-    if (left != right) {
-      idmap[right] = idmap[left];
-      right--;
-    }
-  }
-  idmap[left] = pivot;
-  pivot = left;
-  left = l_hold;
-  right = r_hold;
-
-  if (left < pivot)
-    id_sort(idmap, left, pivot-1);
-  if (right > pivot)
-    id_sort(idmap, pivot+1, right);
-}
-
 /***************************************************************/
 
 using namespace LAMMPS_NS;
diff --git a/src/USER-CUDA/compute_temp_partial_cuda.cpp b/src/USER-CUDA/compute_temp_partial_cuda.cpp
index f3448a407d6b503dd4d9884e6fb7fe98c9ec610f..4d5a2fa9dfcb65431195952325f51331dec5df39 100644
--- a/src/USER-CUDA/compute_temp_partial_cuda.cpp
+++ b/src/USER-CUDA/compute_temp_partial_cuda.cpp
@@ -71,9 +71,9 @@ ComputeTempPartialCuda::ComputeTempPartialCuda(LAMMPS *lmp, int narg, char **arg
   tempflag = 1;
   tempbias = 1;
 
-  xflag = atoi(arg[3]);
-  yflag = atoi(arg[4]);
-  zflag = atoi(arg[5]);
+  xflag = force->inumeric(FLERR,arg[3]);
+  yflag = force->inumeric(FLERR,arg[4]);
+  zflag = force->inumeric(FLERR,arg[5]);
   if (zflag && domain->dimension == 2)
     error->all(FLERR,"Compute temp/partial cannot use vz for 2d systemx");
 
diff --git a/src/USER-EFF/pair_eff_cut.cpp b/src/USER-EFF/pair_eff_cut.cpp
index 121217751c06a588004be639781fabe6459ee1ac..06b5962316341900d648a66fbdd0ff34acc7c94d 100644
--- a/src/USER-EFF/pair_eff_cut.cpp
+++ b/src/USER-EFF/pair_eff_cut.cpp
@@ -867,7 +867,7 @@ void PairEffCut::init_style()
   // add hook to minimizer for eradius and erforce
 
   if (update->whichflag == 2)
-    int ignore = update->minimize->request(this,1,0.01);
+    update->minimize->request(this,1,0.01);
 
   // make sure to use the appropriate timestep when using real units
 
@@ -878,7 +878,7 @@ void PairEffCut::init_style()
 
   // need a half neigh list and optionally a granular history neigh list
 
-  int irequest = neighbor->request(this);
+  neighbor->request(this);
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/USER-EFF/pair_eff_inline.h b/src/USER-EFF/pair_eff_inline.h
index b29f4de66c36d196720523e0be585e373561c095..c93a3803f916f4633ee349b43aabbbe6fdb4f26c 100644
--- a/src/USER-EFF/pair_eff_inline.h
+++ b/src/USER-EFF/pair_eff_inline.h
@@ -314,9 +314,6 @@ inline void ElecElecElec(double rc, double re1, double re2,
 
   re = sqrt(re1 * re1 + re2 * re2);
 
-  double ratio;
-  ratio = rc / re;
-
   /* constants: sqrt(2), 2 / sqrt(pi) */
   a = coeff_a / re;
   arc = a * rc;
@@ -369,7 +366,7 @@ inline void ElecCoreCore(double q, double rc, double re1, double re2,
 {
   double a, arc, re;
   double coeff_a;
-  double E, dEdr, f, fre, df;
+  double E, dEdr, f, df;
 
   coeff_a = 1.4142135623730951;
 
@@ -379,7 +376,6 @@ inline void ElecCoreCore(double q, double rc, double re1, double re2,
 
   f = ierfoverx1(arc, &df);
   dEdr = -q * a * a * df;
-  fre = q * a * (f + arc * df) / (re * re);
   E = q * a * f;
 
   *ecoul += E;
diff --git a/src/USER-MISC/fix_smd.cpp b/src/USER-MISC/fix_smd.cpp
index 86ee3500cd65f0e45129924125c8c44ee62c45ef..6843e24b6932fb727c1d72abcbe5e71cefe323c7 100644
--- a/src/USER-MISC/fix_smd.cpp
+++ b/src/USER-MISC/fix_smd.cpp
@@ -205,8 +205,6 @@ void FixSMD::smd_tether()
   r = sqrt(dx*dx + dy*dy + dz*dz);
   if (styleflag & SMD_CVEL) {
     if(r > SMALL) {
-      double fsign;
-      fsign  = (v_smd<0.0) ? -1.0 : 1.0;
       dr = r - r0 - r_old;
       fx = k_smd*dx*dr/r;
       fy = k_smd*dy*dr/r;
diff --git a/src/USER-MISC/improper_fourier.cpp b/src/USER-MISC/improper_fourier.cpp
index a4be0ea35c33e6457bcc0e9fe16a56880c5fe057..edfd95f20f02a1da94f6c12e86b2c3ce9f525831 100644
--- a/src/USER-MISC/improper_fourier.cpp
+++ b/src/USER-MISC/improper_fourier.cpp
@@ -114,9 +114,8 @@ void ImproperFourier::addone(const int &i1,const int &i2,const int &i3,const int
             const double &vb2x, const double &vb2y, const double &vb2z,
             const double &vb3x, const double &vb3y, const double &vb3z)
 {
-  int n;
   double eimproper,f1[3],f2[3],f3[3],f4[3];
-  double domega,c,c2,a,s,projhfg,dhax,dhay,dhaz,dahx,dahy,dahz,cotphi;
+  double c,c2,a,s,projhfg,dhax,dhay,dhaz,dahx,dahy,dahz,cotphi;
   double ax,ay,az,ra2,rh2,ra,rh,rar,rhr,arx,ary,arz,hrx,hry,hrz;
 
   double **x = atom->x;
diff --git a/src/USER-MISC/pair_coul_diel.cpp b/src/USER-MISC/pair_coul_diel.cpp
index 7613201f206bc1aa59ecf5c7ffdaead7d923a7de..67c09e9b4f6678420858fe26353765ec4117edff 100644
--- a/src/USER-MISC/pair_coul_diel.cpp
+++ b/src/USER-MISC/pair_coul_diel.cpp
@@ -219,7 +219,7 @@ void PairCoulDiel::init_style()
   if (!atom->q_flag)
     error->all(FLERR,"Pair style coul/diel requires atom attribute q");
 
-  int irequest = neighbor->request(this);
+  neighbor->request(this);
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/USER-MISC/pair_lj_sf.cpp b/src/USER-MISC/pair_lj_sf.cpp
index ea4b91e67a77e43761feb387523903f7678fc9d5..6138d0b84739749560c0c5d6f62156401a329b3e 100644
--- a/src/USER-MISC/pair_lj_sf.cpp
+++ b/src/USER-MISC/pair_lj_sf.cpp
@@ -73,7 +73,6 @@ void PairLJShiftedForce::compute(int eflag, int vflag)
   double **f = atom->f;
   int *type = atom->type;
   int nlocal = atom->nlocal;
-  int nall = nlocal + atom->nghost;
   double *special_lj = force->special_lj;
   int newton_pair = force->newton_pair;
 
diff --git a/src/USER-OMP/fix_shear_history_omp.cpp b/src/USER-OMP/fix_shear_history_omp.cpp
index 0f5b82afa2d697a89f6b207b482ae93d0a2f258f..16f5212acf69725640fa2cc07dff733eb9a37126 100644
--- a/src/USER-OMP/fix_shear_history_omp.cpp
+++ b/src/USER-OMP/fix_shear_history_omp.cpp
@@ -39,8 +39,6 @@ using namespace FixConst;
 void FixShearHistoryOMP::pre_exchange()
 {
 
-  const int nlocal = atom->nlocal;
-  const int nghost = atom->nghost;
   const int nthreads = comm->nthreads;
   maxtouch = 0;
 
diff --git a/src/USER-OMP/msm_omp.cpp b/src/USER-OMP/msm_omp.cpp
index 61780c87a2460af5ac7ef57386b4b3627eb42eae..a29fa43f52bad88b0d88e5c33926c2959de1effa 100755
--- a/src/USER-OMP/msm_omp.cpp
+++ b/src/USER-OMP/msm_omp.cpp
@@ -180,15 +180,13 @@ void MSMOMP::direct_eval(const int nn)
       icz += nzlo_inn;
       icy += nylo_inn;
       icx += nxlo_inn;
-      
+
       const int kmax = zper ? nzhi_direct : MIN(nzhi_direct,betazn - icz);
       const int jmin = yper ? nylo_direct : MAX(nylo_direct,alphan - icy);
       const int jmax = yper ? nyhi_direct : MIN(nyhi_direct,betayn - icy);
       const int imin = xper ? nxlo_direct : MAX(nxlo_direct,alphan - icx);
       const int imax = xper ? nxhi_direct : MIN(nxhi_direct,betaxn - icx);
 
-      const double qtmp = qgridn[icz][icy][icx]; // charge on center grid point
-
       esum = 0.0;
       if (VFLAG_GLOBAL || VFLAG_ATOM)
         v0sum = v1sum = v2sum = v3sum = v4sum = v5sum = 0.0;
@@ -357,8 +355,7 @@ void MSMOMP::direct_peratom(const int nn)
   const int yper = domain->yperiodic;
   const int xper = domain->xperiodic;
 
-  const int n=nn;
-  int i,ifrom,ito,tid,icx,icy,icz,ix,iy,iz,k;
+  int i,icx,icy,icz,ix,iy,iz,k;
 
 
   for (i = 0; i < inum; ++i) {
@@ -371,7 +368,7 @@ void MSMOMP::direct_peratom(const int nn)
     icz += nzlo_inn;
     icy += nylo_inn;
     icx += nxlo_inn;
-    
+
     const int kmax = zper ? nzhi_direct : MIN(nzhi_direct,betazn - icz);
     const int jmin = yper ? nylo_direct : MAX(nylo_direct,alphan - icy);
     const int jmax = yper ? nyhi_direct : MIN(nyhi_direct,betayn - icy);
diff --git a/src/USER-OMP/pair_comb_omp.cpp b/src/USER-OMP/pair_comb_omp.cpp
index 5731360bac046900cf1dd47e710ce879e871a728..37237fb162903cb57ab4cc8ed70385366b900fab 100644
--- a/src/USER-OMP/pair_comb_omp.cpp
+++ b/src/USER-OMP/pair_comb_omp.cpp
@@ -567,12 +567,11 @@ void PairCombOMP::Short_neigh_thr()
 #pragma omp parallel default(none)
 #endif
   {
-    int nj,npntj,*neighptrj;
-    int iparam_ij,*ilist,*jlist,*numneigh,**firstneigh;
+    int nj,*neighptrj;
+    int *ilist,*jlist,*numneigh,**firstneigh;
     int jnum,i,j,ii,jj;
     double xtmp,ytmp,ztmp,rsq,delrj[3];
     double **x = atom->x;
-    int *type  = atom->type;
 
     const int inum = list->inum;
     ilist = list->ilist;
diff --git a/src/USER-OMP/pair_eam_alloy_omp.cpp b/src/USER-OMP/pair_eam_alloy_omp.cpp
index 03e6a1058fa4f97bb28923b29fab6c6775969bcc..bee33d9f44f526058d1acb3bd5d0dfe887368ebd 100644
--- a/src/USER-OMP/pair_eam_alloy_omp.cpp
+++ b/src/USER-OMP/pair_eam_alloy_omp.cpp
@@ -152,7 +152,7 @@ void PairEAMAlloyOMP::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/USER-OMP/pair_eam_fs_omp.cpp b/src/USER-OMP/pair_eam_fs_omp.cpp
index fc22bde3ce4e0cefb5c3f6e58d67951680244152..d602ff0215a1ec44728c0f71343da4c0097051cb 100644
--- a/src/USER-OMP/pair_eam_fs_omp.cpp
+++ b/src/USER-OMP/pair_eam_fs_omp.cpp
@@ -152,7 +152,7 @@ void PairEAMFSOMP::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/USER-OMP/pair_edip_omp.cpp b/src/USER-OMP/pair_edip_omp.cpp
index 5ed24436b3a204da42ae2583f4e73cf795249fb1..50ebaae31a78d96ccfdf25de9ad04d5733a2e892 100644
--- a/src/USER-OMP/pair_edip_omp.cpp
+++ b/src/USER-OMP/pair_edip_omp.cpp
@@ -78,8 +78,8 @@ void PairEDIPOMP::compute(int eflag, int vflag)
 template <int EVFLAG, int EFLAG, int VFLAG_ATOM>
 void PairEDIPOMP::eval(int iifrom, int iito, ThrData * const thr)
 {
-  int i,j,k,ii,inum,jnum;
-  int itype,jtype,ktype,ijparam,ikparam,ijkparam;
+  int i,j,k,ii,jnum;
+  int itype,jtype,ktype,ijparam,ikparam;
   double xtmp,ytmp,ztmp,evdwl;
   int *ilist,*jlist,*numneigh,**firstneigh;
   register int preForceCoord_counter;
@@ -115,7 +115,6 @@ void PairEDIPOMP::eval(int iifrom, int iito, ThrData * const thr)
   double exp3B_ik;
   double exp3BDerived_ik;
   double qFunction;
-  double qFunctionDerived;
   double tauFunction;
   double tauFunctionDerived;
   double expMinusBetaZeta_iZeta_i;
@@ -152,7 +151,6 @@ void PairEDIPOMP::eval(int iifrom, int iito, ThrData * const thr)
   const int * _noalias const type = atom->type;
   const int nlocal = atom->nlocal;
 
-  inum = list->inum;
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
@@ -283,8 +281,6 @@ void PairEDIPOMP::eval(int iifrom, int iito, ThrData * const thr)
     tauFunctionDerived = interpolY1 + (interpolY2 - interpolY1) *
       (interpolTMP-interpolIDX);
 
-    qFunctionDerived = -mu * qFunction;
-
     forceModCoord_factor = 2.0 * beta * zeta_i * expMinusBetaZeta_iZeta_i;
 
     forceModCoord = 0.0;
@@ -358,7 +354,6 @@ void PairEDIPOMP::eval(int iifrom, int iito, ThrData * const thr)
           k &= NEIGHMASK;
           ktype = map[type[k]];
           ikparam = elem2param[itype][ktype][ktype];
-          ijkparam = elem2param[itype][jtype][ktype];
 
           dr_ik[0] = x[k].x - xtmp;
           dr_ik[1] = x[k].y - ytmp;
diff --git a/src/USER-OMP/pair_gran_hertz_history_omp.cpp b/src/USER-OMP/pair_gran_hertz_history_omp.cpp
index 6453ea3083210c582fdd09bd6f119b43e6abb4ce..e66b363f4b0efb06e90d17428d6e8abccbd356ae 100644
--- a/src/USER-OMP/pair_gran_hertz_history_omp.cpp
+++ b/src/USER-OMP/pair_gran_hertz_history_omp.cpp
@@ -132,6 +132,7 @@ void PairGranHertzHistoryOMP::eval(int iifrom, int iito, ThrData * const thr)
   for (ii = iifrom; ii < iito; ++ii) {
 
     i = ilist[ii];
+    itype = type[i];
     xtmp = x[i][0];
     ytmp = x[i][1];
     ztmp = x[i][2];
@@ -145,6 +146,7 @@ void PairGranHertzHistoryOMP::eval(int iifrom, int iito, ThrData * const thr)
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       j &= NEIGHMASK;
+      jtype = type[j];
 
       delx = xtmp - x[j][0];
       dely = ytmp - x[j][1];
@@ -201,8 +203,8 @@ void PairGranHertzHistoryOMP::eval(int iifrom, int iito, ThrData * const thr)
           mi = rmass[i];
           mj = rmass[j];
         } else {
-          mi = mass[type[i]];
-          mj = mass[type[j]];
+          mi = mass[itype];
+          mj = mass[jtype];
         }
         if (fix_rigid) {
           if (mass_rigid[i] > 0.0) mi = mass_rigid[i];
diff --git a/src/USER-OMP/pair_lj_long_tip4p_long_omp.cpp b/src/USER-OMP/pair_lj_long_tip4p_long_omp.cpp
index 2c34e54c4da895e0e7dd4e673f14cca1118840aa..cace817fe51f7f8a75d3f04fb09405d0f801125d 100644
--- a/src/USER-OMP/pair_lj_long_tip4p_long_omp.cpp
+++ b/src/USER-OMP/pair_lj_long_tip4p_long_omp.cpp
@@ -715,22 +715,21 @@ void PairLJLongTIP4PLongOMP::eval(int iifrom, int iito, ThrData * const thr)
   const double * const q = atom->q;
   const int * const type = atom->type;
   const int nlocal = atom->nlocal;
-  const int nall = nlocal + atom->nghost;
   const double * const special_coul = force->special_coul;
   const double * const special_lj = force->special_lj;
   const double qqrd2e = force->qqrd2e;
   const double cut_coulsqplus = (cut_coul+2.0*qdist)*(cut_coul+2.0*qdist);
 
-  int i,j,ii,jj,inum,jnum,itype,jtype,itable;
+  int i,j,ii,jj,jnum,itype,jtype,itable;
   int n,vlist[6];
   int key;
   int iH1,iH2,jH1,jH2;
   double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul;
   double fraction,table;
   double r,r2inv,forcecoul,forcelj,cforce;
-  double factor_coul,factor_lj;
+  double factor_coul;
   double grij,expm2,prefactor,t,erfc;
-  double xiM[3],xjM[3],fO[3],fH[3],fd[3],v[6],xH1[3],xH2[3];// f1[3];
+  double fO[3],fH[3],fd[3],v[6],xH1[3],xH2[3];
   dbl3_t x1,x2;
   int *ilist,*jlist,*numneigh,**firstneigh;
   double rsq;
@@ -738,13 +737,13 @@ void PairLJLongTIP4PLongOMP::eval(int iifrom, int iito, ThrData * const thr)
   evdwl = ecoul = 0.0;
 
   int ni;
-  double  *cut_ljsqi, *lj1i, *lj2i, *lj3i, *lj4i, *offseti;
+  double *lj1i, *lj2i, *lj3i, *lj4i, *offseti;
   double g2 = g_ewald_6*g_ewald_6, g6 = g2*g2*g2, g8 = g6*g2;
 
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = iifrom; ii < iito; ++ii) {
@@ -783,7 +782,6 @@ void PairLJLongTIP4PLongOMP::eval(int iifrom, int iito, ThrData * const thr)
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       ni = sbmask(j);
-      factor_lj = special_lj[sbmask(j)];
       factor_coul = special_coul[sbmask(j)];
       j &= NEIGHMASK;
 
@@ -792,7 +790,7 @@ void PairLJLongTIP4PLongOMP::eval(int iifrom, int iito, ThrData * const thr)
       delz = ztmp - x[j].z;
       rsq = delx*delx + dely*dely + delz*delz;
       jtype = type[j];
-        
+
       if (rsq < cut_ljsq[itype][jtype]) {			// lj
         r2inv = 1.0/rsq;
        	if (ORDER6) {					// long-range lj
@@ -810,7 +808,7 @@ void PairLJLongTIP4PLongOMP::eval(int iifrom, int iito, ThrData * const thr)
 	      register double f = special_lj[ni], t = rn*(1.0-f);
 	      forcelj = f*(rn *= rn)*lj1i[jtype]-
 	        g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq+t*lj2i[jtype];
-	      if (EFLAG) 
+	      if (EFLAG)
 	        evdwl = f*rn*lj3i[jtype]-g6*((a2+1.0)*a2+0.5)*x2+t*lj4i[jtype];
 	    }
           }
@@ -857,12 +855,12 @@ void PairLJLongTIP4PLongOMP::eval(int iifrom, int iito, ThrData * const thr)
 				 evdwl,0.0,forcelj,delx,dely,delz,thr);
       }
 
-      
+
       // adjust rsq and delxyz for off-site O charge(s)
       // ADDITIONAL REQEUST REQUIRED HERE!!!!!
 
       if (rsq < cut_coulsqplus) {
-        if (itype == typeO || jtype == typeO) { 
+        if (itype == typeO || jtype == typeO) {
 	  if (jtype == typeO) {
             if (hneigh_thr[j].a < 0) {
               hneigh_thr[j].a = jH1 = atom->map(atom->tag[j] + 1);
@@ -890,7 +888,7 @@ void PairLJLongTIP4PLongOMP::eval(int iifrom, int iito, ThrData * const thr)
         }
 
 	// test current rsq against cutoff and compute Coulombic force
-      
+
         if (rsq < cut_coulsq && ORDER1) {
 	  r2inv = 1.0 / rsq;
 	  if (!CTABLE || rsq <= tabinnersq) {
@@ -902,7 +900,7 @@ void PairLJLongTIP4PLongOMP::eval(int iifrom, int iito, ThrData * const thr)
 	    prefactor = qqrd2e * qtmp*q[j]/r;
 	    forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
 	    if (factor_coul < 1.0) {
-	      forcecoul -= (1.0-factor_coul)*prefactor; 
+	      forcecoul -= (1.0-factor_coul)*prefactor;
 	    }
 	  } else {
 	    union_int_float_t rsq_lookup;
@@ -1020,7 +1018,7 @@ void PairLJLongTIP4PLongOMP::eval(int iifrom, int iito, ThrData * const thr)
 
             fH[0] = 0.5 * alpha * fd[0];
             fH[1] = 0.5 * alpha * fd[1];
-            fH[2] = 0.5 * alpha * fd[2]; 
+            fH[2] = 0.5 * alpha * fd[2];
 
 	    f[j][0] += fO[0];
 	    f[j][1] += fO[1];
@@ -1059,7 +1057,7 @@ void PairLJLongTIP4PLongOMP::eval(int iifrom, int iito, ThrData * const thr)
 	    }
 	    if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
           } else ecoul = 0.0;
- 
+
           if (EVFLAG) ev_tally_list_thr(this,key,vlist,v,ecoul,alpha,thr);
 	}
       }
@@ -1071,17 +1069,15 @@ void PairLJLongTIP4PLongOMP::eval(int iifrom, int iito, ThrData * const thr)
 
 void PairLJLongTIP4PLongOMP::eval_inner(int iifrom, int iito, ThrData * const thr)
 {
-  double r, rsq, r2inv, forcecoul = 0.0, forcelj, cforce, fpair;
+  double rsq, r2inv, forcecoul = 0.0, forcelj, cforce;
 
   const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0];
   double * const * const f = thr->get_f();
   const double * const q = atom->q;
   const int * const type = atom->type;
-  const int nlocal = atom->nlocal;
   const double * const special_coul = force->special_coul;
   const double * const special_lj = force->special_lj;
   const double qqrd2e = force->qqrd2e;
-  const int newton_pair = force->newton_pair;
   const double cut_coulsqplus = (cut_coul+2.0*qdist)*(cut_coul+2.0*qdist);
 
   const double cut_out_on = cut_respa[0];
@@ -1091,26 +1087,23 @@ void PairLJLongTIP4PLongOMP::eval_inner(int iifrom, int iito, ThrData * const th
   const double cut_out_on_sq = cut_out_on*cut_out_on;
   const double cut_out_off_sq = cut_out_off*cut_out_off;
 
-  int *jneigh, *jneighn, typei, typej, ni;
+  int ni;
   const int order1 = (ewald_order|(ewald_off^-1))&(1<<1);
   double qri;
-  vector xi, d;
 
-  int i,j,ii,jj,inum,jnum,itype,jtype,itable;
+  int i,j,ii,jj,jnum,itype,jtype;
   int iH1,iH2,jH1,jH2;
-  double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul;
-  double factor_coul,factor_lj;
-  double grij,expm2,prefactor,t,erfc;
-  double xiM[3],xjM[3],fO[3],fH[3],fd[3],v[6],xH1[3],xH2[3];// f1[3];
+  double qtmp,xtmp,ytmp,ztmp,delx,dely,delz;
+  double fO[3],fH[3],fd[3];
   dbl3_t x1,x2;
   int *ilist,*jlist,*numneigh,**firstneigh;
 
-  double  *cut_ljsqi, *lj1i, *lj2i, *lj3i, *lj4i, *offseti;
+  double *lj1i, *lj2i;
 
   ilist = listinner->ilist;
   numneigh = listinner->numneigh;
   firstneigh = listinner->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = iifrom; ii < iito; ++ii) {
@@ -1143,14 +1136,11 @@ void PairLJLongTIP4PLongOMP::eval_inner(int iifrom, int iito, ThrData * const th
 
     jlist = firstneigh[i];
     jnum = numneigh[i];
-    offseti = offset[itype];
-    lj1i = lj1[itype]; lj2i = lj2[itype]; lj3i = lj3[itype]; lj4i = lj4[itype];
+    lj1i = lj1[itype]; lj2i = lj2[itype];
 
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       ni = sbmask(j);
-      factor_lj = special_lj[sbmask(j)];
-      factor_coul = special_coul[sbmask(j)];
       j &= NEIGHMASK;
 
       delx = xtmp - x[j].x;
@@ -1158,7 +1148,7 @@ void PairLJLongTIP4PLongOMP::eval_inner(int iifrom, int iito, ThrData * const th
       delz = ztmp - x[j].z;
       rsq = delx*delx + dely*dely + delz*delz;
       jtype = type[j];
-        
+
       if (rsq < cut_ljsq[itype][jtype] && rsq < cut_out_off_sq ) {  // lj
         r2inv = 1.0/rsq;				
 	register double rn = r2inv*r2inv*r2inv;
@@ -1182,12 +1172,12 @@ void PairLJLongTIP4PLongOMP::eval_inner(int iifrom, int iito, ThrData * const th
 	f[j][2] -= delz*forcelj;
       }
 
-      
+
       // adjust rsq and delxyz for off-site O charge(s)
       // ADDITIONAL REQEUST REQUIRED HERE!!!!!
 
       if (rsq < cut_coulsqplus && order1) {
-        if (itype == typeO || jtype == typeO) { 
+        if (itype == typeO || jtype == typeO) {
 	  if (jtype == typeO) {
             if (hneigh_thr[j].a < 0) {
               hneigh_thr[j].a = jH1 = atom->map(atom->tag[j] + 1);
@@ -1215,7 +1205,7 @@ void PairLJLongTIP4PLongOMP::eval_inner(int iifrom, int iito, ThrData * const th
         }
 
 	// test current rsq against cutoff and compute Coulombic force
-      
+
         if (rsq < cut_coulsq && rsq < cut_out_off_sq) {
 	  r2inv = 1.0 / rsq;
           qri = qqrd2e*qtmp;
@@ -1289,7 +1279,7 @@ void PairLJLongTIP4PLongOMP::eval_inner(int iifrom, int iito, ThrData * const th
 
             fH[0] = 0.5 * alpha * fd[0];
             fH[1] = 0.5 * alpha * fd[1];
-            fH[2] = 0.5 * alpha * fd[2]; 
+            fH[2] = 0.5 * alpha * fd[2];
 
 	    f[j][0] += fO[0];
 	    f[j][1] += fO[1];
@@ -1313,19 +1303,17 @@ void PairLJLongTIP4PLongOMP::eval_inner(int iifrom, int iito, ThrData * const th
 
 void PairLJLongTIP4PLongOMP::eval_middle(int iifrom, int iito, ThrData * const thr)
 {
-  double r, rsq, r2inv, forcecoul,forcelj, cforce, fpair;
+  double rsq, r2inv, forcecoul,forcelj, cforce;
 
   const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0];
   double * const * const f = thr->get_f();
   const double * const q = atom->q;
   const int * const type = atom->type;
-  const int nlocal = atom->nlocal;
   const double * const special_coul = force->special_coul;
   const double * const special_lj = force->special_lj;
   const double qqrd2e = force->qqrd2e;
 
   const double cut_coulsqplus = (cut_coul+2.0*qdist)*(cut_coul+2.0*qdist);
-  const int newton_pair = force->newton_pair;
   const int order1 = (ewald_order|(ewald_off^-1))&(1<<1);
 
   const double cut_in_off = cut_respa[0];
@@ -1340,24 +1328,21 @@ void PairLJLongTIP4PLongOMP::eval_middle(int iifrom, int iito, ThrData * const t
   const double cut_out_on_sq = cut_out_on*cut_out_on;
   const double cut_out_off_sq = cut_out_off*cut_out_off;
 
-  int i,j,ii,jj,inum,jnum,itype,jtype,itable;
+  int i,j,ii,jj,jnum,itype,jtype;
   int iH1,iH2,jH1,jH2;
-  double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul;
-  double factor_coul,factor_lj;
-  double grij,expm2,prefactor,t,erfc;
-  double xiM[3],xjM[3],fO[3],fH[3],fd[3],v[6],xH1[3],xH2[3];// f1[3];
+  double qtmp,xtmp,ytmp,ztmp,delx,dely,delz;
+  double fO[3],fH[3],fd[3];
   dbl3_t x1,x2;
   int *ilist,*jlist,*numneigh,**firstneigh;
   double qri;
 
   int ni;
-  double  *cut_ljsqi, *lj1i, *lj2i, *lj3i, *lj4i, *offseti;
-  double g2 = g_ewald_6*g_ewald_6, g6 = g2*g2*g2, g8 = g6*g2;
+  double *lj1i, *lj2i;
 
   ilist = listmiddle->ilist;
   numneigh = listmiddle->numneigh;
   firstneigh = listmiddle->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = iifrom; ii < iito; ++ii) {
@@ -1390,14 +1375,11 @@ void PairLJLongTIP4PLongOMP::eval_middle(int iifrom, int iito, ThrData * const t
 
     jlist = firstneigh[i];
     jnum = numneigh[i];
-    offseti = offset[itype];
-    lj1i = lj1[itype]; lj2i = lj2[itype]; lj3i = lj3[itype]; lj4i = lj4[itype];
+    lj1i = lj1[itype]; lj2i = lj2[itype];
 
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       ni = sbmask(j);
-      factor_lj = special_lj[sbmask(j)];
-      factor_coul = special_coul[sbmask(j)];
       j &= NEIGHMASK;
 
       delx = xtmp - x[j].x;
@@ -1405,7 +1387,7 @@ void PairLJLongTIP4PLongOMP::eval_middle(int iifrom, int iito, ThrData * const t
       delz = ztmp - x[j].z;
       rsq = delx*delx + dely*dely + delz*delz;
       jtype = type[j];
-        
+
       if (rsq < cut_ljsq[itype][jtype] && rsq >= cut_in_off_sq && rsq <= cut_out_off_sq ) {  // lj
         r2inv = 1.0/rsq;				
 	register double rn = r2inv*r2inv*r2inv;
@@ -1433,12 +1415,12 @@ void PairLJLongTIP4PLongOMP::eval_middle(int iifrom, int iito, ThrData * const t
 	f[j][2] -= delz*forcelj;
       }
 
-      
+
       // adjust rsq and delxyz for off-site O charge(s)
       // ADDITIONAL REQEUST REQUIRED HERE!!!!!
 
       if (rsq < cut_coulsqplus && order1) {
-        if (itype == typeO || jtype == typeO) { 
+        if (itype == typeO || jtype == typeO) {
 	  if (jtype == typeO) {
             if (hneigh_thr[j].a < 0) {
               hneigh_thr[j].a = jH1 = atom->map(atom->tag[j] + 1);
@@ -1466,7 +1448,7 @@ void PairLJLongTIP4PLongOMP::eval_middle(int iifrom, int iito, ThrData * const t
         }
 
 	// test current rsq against cutoff and compute Coulombic force
-      
+
         if (rsq < cut_coulsq &&  rsq >= cut_in_off_sq && rsq <= cut_out_off_sq) {
 	  r2inv = 1.0 / rsq;
           qri = qqrd2e*qtmp;
@@ -1544,7 +1526,7 @@ void PairLJLongTIP4PLongOMP::eval_middle(int iifrom, int iito, ThrData * const t
 
             fH[0] = 0.5 * alpha * fd[0];
             fH[1] = 0.5 * alpha * fd[1];
-            fH[2] = 0.5 * alpha * fd[2]; 
+            fH[2] = 0.5 * alpha * fd[2];
 
 	    f[j][0] += fO[0];
 	    f[j][1] += fO[1];
@@ -1570,7 +1552,7 @@ template < const int EVFLAG, const int EFLAG,
            const int NEWTON_PAIR, const int CTABLE, const int LJTABLE, const int ORDER1, const int ORDER6 >
 void PairLJLongTIP4PLongOMP::eval_outer(int iifrom, int iito, ThrData * const thr)
 {
-  double evdwl,ecoul,fvirial,fpair;
+  double evdwl,ecoul,fvirial;
   evdwl = ecoul = 0.0;
 
   const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0];
@@ -1583,28 +1565,25 @@ void PairLJLongTIP4PLongOMP::eval_outer(int iifrom, int iito, ThrData * const th
   const double qqrd2e = force->qqrd2e;
   const double cut_coulsqplus = (cut_coul+2.0*qdist)*(cut_coul+2.0*qdist);
 
-  int i,j,ii,jj,inum,jnum,itype,jtype,itable;
+  int i,j,ii,jj,jnum,itype,jtype;
   int n,vlist[6];
   int key;
   int iH1,iH2,jH1,jH2;
   double qtmp,xtmp,ytmp,ztmp,delx,dely,delz;
-  double fraction,table;
-  double r,r2inv,forcecoul,forcelj,cforce, respa_coul, respa_lj, frespa;
-  double factor_coul,factor_lj;
-  double grij,expm2,prefactor,t,erfc;
-  double xiM[3],xjM[3],fO[3],fH[3],fd[3],v[6],xH1[3],xH2[3];// f1[3];
+  double r2inv,forcecoul,forcelj,cforce, respa_coul, respa_lj, frespa;
+  double fO[3],fH[3],fd[3],v[6],xH1[3],xH2[3];
   dbl3_t x1,x2;
   int *ilist,*jlist,*numneigh,**firstneigh;
   double rsq,qri;
   int respa_flag;
-  
+
   int ni;
-  double  *cut_ljsqi, *lj1i, *lj2i, *lj3i, *lj4i, *offseti;
+  double *lj1i, *lj2i, *lj3i, *lj4i, *offseti;
   double g2 = g_ewald_6*g_ewald_6, g6 = g2*g2*g2, g8 = g6*g2;
 
   const double cut_in_off = cut_respa[2];
   const double cut_in_on = cut_respa[3];
-  
+
   const double cut_in_diff = cut_in_on - cut_in_off;
   const double cut_in_off_sq = cut_in_off*cut_in_off;
   const double cut_in_on_sq = cut_in_on*cut_in_on;
@@ -1612,7 +1591,7 @@ void PairLJLongTIP4PLongOMP::eval_outer(int iifrom, int iito, ThrData * const th
   ilist = listouter->ilist;
   numneigh = listouter->numneigh;
   firstneigh = listouter->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = iifrom; ii < iito; ++ii) {
@@ -1652,8 +1631,6 @@ void PairLJLongTIP4PLongOMP::eval_outer(int iifrom, int iito, ThrData * const th
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       ni = sbmask(j);
-      factor_lj = special_lj[sbmask(j)];
-      factor_coul = special_coul[sbmask(j)];
       j &= NEIGHMASK;
 
       delx = xtmp - x[j].x;
@@ -1661,7 +1638,7 @@ void PairLJLongTIP4PLongOMP::eval_outer(int iifrom, int iito, ThrData * const th
       delz = ztmp - x[j].z;
       rsq = delx*delx + dely*dely + delz*delz;
       jtype = type[j];
-        
+
       respa_coul = 0;
       respa_lj = 0;
       if (rsq < cut_ljsq[itype][jtype]) {			// lj
@@ -1730,7 +1707,7 @@ void PairLJLongTIP4PLongOMP::eval_outer(int iifrom, int iito, ThrData * const th
 	f[j][0] -= delx*forcelj;
 	f[j][1] -= dely*forcelj;
 	f[j][2] -= delz*forcelj;
-      
+
         if (EVFLAG) {
           fvirial = forcelj + respa_lj*r2inv;
           ev_tally_thr(this,i,j,nlocal,/*newton_pair = */ 1,
@@ -1738,12 +1715,12 @@ void PairLJLongTIP4PLongOMP::eval_outer(int iifrom, int iito, ThrData * const th
         }
       }
 
-      
+
       // adjust rsq and delxyz for off-site O charge(s)
       // ADDITIONAL REQEUST REQUIRED HERE!!!!!
 
       if (rsq < cut_coulsqplus) {
-        if (itype == typeO || jtype == typeO) { 
+        if (itype == typeO || jtype == typeO) {
 	  if (jtype == typeO) {
             if (hneigh_thr[j].a < 0) {
               hneigh_thr[j].a = jH1 = atom->map(atom->tag[j] + 1);
@@ -1818,7 +1795,7 @@ void PairLJLongTIP4PLongOMP::eval_outer(int iifrom, int iito, ThrData * const th
                 ecoul = qiqj*(etable[k]+f*detable[k]-t.f);
               }
             }
-          } 
+          }
 
           cforce = forcecoul * r2inv;
           fvirial = (forcecoul + respa_coul) * r2inv;
@@ -1932,7 +1909,7 @@ void PairLJLongTIP4PLongOMP::eval_outer(int iifrom, int iito, ThrData * const th
 
             fH[0] = 0.5 * alpha * fd[0];
             fH[1] = 0.5 * alpha * fd[1];
-            fH[2] = 0.5 * alpha * fd[2]; 
+            fH[2] = 0.5 * alpha * fd[2];
 
 	    f[j][0] += fO[0];
 	    f[j][1] += fO[1];
@@ -1958,7 +1935,7 @@ void PairLJLongTIP4PLongOMP::eval_outer(int iifrom, int iito, ThrData * const th
 
               fH[0] = 0.5 * alpha * fd[0];
               fH[1] = 0.5 * alpha * fd[1];
-              fH[2] = 0.5 * alpha * fd[2]; 
+              fH[2] = 0.5 * alpha * fd[2];
 
 	      domain->closest_image(&x[j].x,&x[jH1].x,xH1);
 	      domain->closest_image(&x[j].x,&x[jH2].x,xH2);
@@ -1974,7 +1951,7 @@ void PairLJLongTIP4PLongOMP::eval_outer(int iifrom, int iito, ThrData * const th
 	    vlist[n++] = jH1;
 	    vlist[n++] = jH2;
 	  }
- 
+
           if (EVFLAG) ev_tally_list_thr(this,key,vlist,v,ecoul,alpha,thr);
         }
       }
diff --git a/src/USER-OMP/pppm_cg_omp.cpp b/src/USER-OMP/pppm_cg_omp.cpp
index 48e319b4684f98880cba8d05c65f87251511588f..3a0c3f5806405e3f079b288d0392c265916bab1c 100644
--- a/src/USER-OMP/pppm_cg_omp.cpp
+++ b/src/USER-OMP/pppm_cg_omp.cpp
@@ -22,6 +22,7 @@
 #include "error.h"
 #include "fix_omp.h"
 #include "force.h"
+#include "neighbor.h"
 #include "memory.h"
 #include "math_const.h"
 #include "math_special.h"
diff --git a/src/USER-OMP/pppm_disp_tip4p_omp.cpp b/src/USER-OMP/pppm_disp_tip4p_omp.cpp
index 557b36e4269c46e589c6f34aa8ad794535cfbbaf..a07e3d8fee35b3b553c2989d70aee9d9a8510cde 100644
--- a/src/USER-OMP/pppm_disp_tip4p_omp.cpp
+++ b/src/USER-OMP/pppm_disp_tip4p_omp.cpp
@@ -60,8 +60,6 @@ void PPPMDispTIP4POMP::allocate()
 {
   PPPMDispTIP4P::allocate();
 
-  const int nthreads = comm->nthreads;
-
 #if defined(_OPENMP)
 #pragma omp parallel default(none)
 #endif
@@ -78,7 +76,7 @@ void PPPMDispTIP4POMP::allocate()
     }
     if (function[1] + function[2]) {
       ThrData * thr = fix->get_thr(tid);
-      thr->init_pppm_disp(order_6,memory);  
+      thr->init_pppm_disp(order_6,memory);
     }
   }
 }
@@ -136,12 +134,11 @@ void PPPMDispTIP4POMP::compute_gf()
     double unitky = (2.0*MY_PI/yprd);
     double unitkz = (2.0*MY_PI/zprd_slab);
 
-    int tid,nn,nnfrom,nnto,nx,ny,nz,k,l,m;
+    int tid,nn,nnfrom,nnto,k,l,m;
     int kper,lper,mper;
     double snx,sny,snz,snx2,sny2,snz2;
     double sqk;
     double argx,argy,argz,wx,wy,wz,sx,sy,sz,qx,qy,qz;
-    double sum1,dot1,dot2;
     double numerator,denominator;
 
     const int nnx = nxhi_fft-nxlo_fft+1;
@@ -191,7 +188,7 @@ void PPPMDispTIP4POMP::compute_gf()
 
           if (sqk != 0.0) {
             numerator = 4.0*MY_PI/sqk;
-            denominator = gf_denom(snx2,sny2,snz2, gf_b, order);  
+            denominator = gf_denom(snx2,sny2,snz2, gf_b, order);
             greensfn[nn] = numerator*sx*sy*sz*wx*wy*wz/denominator;
           } else greensfn[nn] = 0.0;
         }
@@ -258,7 +255,7 @@ void PPPMDispTIP4POMP::compute_gf_6()
       argz = 0.5*qz*zprd_slab/nz_pppm_6;
       if (argz != 0.0) wz = pow(sin(argz)/argz,order_6);
       wz *= wz;
-              
+
       for (l = nylo_fft_6; l <= nyhi_fft_6; l++) {
         lper = l - ny_pppm_6*(2*l/ny_pppm_6);
         qy = unitky*lper;
@@ -285,10 +282,10 @@ void PPPMDispTIP4POMP::compute_gf_6()
 	  argx = 0.5*qx*xprd/nx_pppm_6;
 	  if (argx != 0.0) wx = pow(sin(argx)/argx,order_6);
           wx *= wx;
-      
+
 	  sqk = pow(qx,2.0) + pow(qy,2.0) + pow(qz,2.0);
 
-	  denominator = gf_denom(snx2,sny2,snz2, gf_b_6, order_6); 
+	  denominator = gf_denom(snx2,sny2,snz2, gf_b_6, order_6);
 	  rtsqk = sqrt(sqk);
           term = (1-2*sqk*inv2ew*inv2ew)*sx*sy*sz +
                   2*sqk*rtsqk*inv2ew*inv2ew*inv2ew*rtpi*erfc(rtsqk*inv2ew);
@@ -418,7 +415,6 @@ void PPPMDispTIP4POMP::particle_map(double dxinv, double dyinv,
   // no local atoms => nothing to do
   if (atom->nlocal == 0) return;
 
-  const int * _noalias const type = atom->type;
   const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0];
   int3_t * _noalias const p2g = (int3_t *) part2grid[0];
   const double boxlox = boxlo[0];
@@ -526,7 +522,7 @@ void PPPMDispTIP4POMP::make_rho_c()
       const int ny = p2g[i].b;
       const int nz = p2g[i].t;
 
-      // pre-screen whether this atom will ever come within 
+      // pre-screen whether this atom will ever come within
       // reach of the data segement this thread is updating.
       if ( ((nz+nlower-nzlo_out)*ix*iy >= jto)
            || ((nz+nupper-nzlo_out+1)*ix*iy < jfrom) ) continue;
@@ -618,7 +614,7 @@ void PPPMDispTIP4POMP::make_rho_g()
       const int ny = p2g[i].b;
       const int nz = p2g[i].t;
 
-      // pre-screen whether this atom will ever come within 
+      // pre-screen whether this atom will ever come within
       // reach of the data segement this thread is updating.
       if ( ((nz+nlower_6-nzlo_out_6)*ix*iy >= jto)
            || ((nz+nupper_6-nzlo_out_6+1)*ix*iy < jfrom) ) continue;
@@ -720,7 +716,7 @@ void PPPMDispTIP4POMP::make_rho_a()
       const int ny = p2g[i].b;
       const int nz = p2g[i].t;
 
-      // pre-screen whether this atom will ever come within 
+      // pre-screen whether this atom will ever come within
       // reach of the data segement this thread is updating.
       if ( ((nz+nlower_6-nzlo_out_6)*ix*iy >= jto)
            || ((nz+nupper_6-nzlo_out_6+1)*ix*iy < jfrom) ) continue;
@@ -1026,7 +1022,6 @@ void PPPMDispTIP4POMP::fieldforce_g_ik()
   // ek = 3 components of E-field on particle
 
   const double * const * const x = atom->x;
-  const double qqrd2e = force->qqrd2e;
 
 #if defined(_OPENMP)
 #pragma omp parallel default(none)
@@ -1681,7 +1676,7 @@ void PPPMDispTIP4POMP::fieldforce_a_peratom()
 
     // this if protects against having more threads than local atoms
     if (ifrom < nlocal) {
-      for (int i = ifrom; i < ito; i++) {
+      for (i = ifrom; i < ito; i++) {
 
         nx = part2grid_6[i][0];
         ny = part2grid_6[i][1];
@@ -1776,20 +1771,20 @@ void PPPMDispTIP4POMP::fieldforce_a_peratom()
         lj6 = B[7*type]*0.5;
 
         if (eflag_atom)
-          eatom[i] += u0*lj0 + u1*lj1 + u2*lj2 + 
+          eatom[i] += u0*lj0 + u1*lj1 + u2*lj2 +
             u3*lj3 + u4*lj4 + u5*lj5 + u6*lj6;
         if (vflag_atom) {
-          vatom[i][0] += v00*lj0 + v01*lj1 + v02*lj2 + v03*lj3 + 
+          vatom[i][0] += v00*lj0 + v01*lj1 + v02*lj2 + v03*lj3 +
             v04*lj4 + v05*lj5 + v06*lj6;
-          vatom[i][1] += v10*lj0 + v11*lj1 + v12*lj2 + v13*lj3 + 
+          vatom[i][1] += v10*lj0 + v11*lj1 + v12*lj2 + v13*lj3 +
             v14*lj4 + v15*lj5 + v16*lj6;
-          vatom[i][2] += v20*lj0 + v21*lj1 + v22*lj2 + v23*lj3 + 
+          vatom[i][2] += v20*lj0 + v21*lj1 + v22*lj2 + v23*lj3 +
             v24*lj4 + v25*lj5 + v26*lj6;
-          vatom[i][3] += v30*lj0 + v31*lj1 + v32*lj2 + v33*lj3 + 
+          vatom[i][3] += v30*lj0 + v31*lj1 + v32*lj2 + v33*lj3 +
             v34*lj4 + v35*lj5 + v36*lj6;
-          vatom[i][4] += v40*lj0 + v41*lj1 + v42*lj2 + v43*lj3 + 
+          vatom[i][4] += v40*lj0 + v41*lj1 + v42*lj2 + v43*lj3 +
             v44*lj4 + v45*lj5 + v46*lj6;
-          vatom[i][5] += v50*lj0 + v51*lj1 + v52*lj2 + v53*lj3 + 
+          vatom[i][5] += v50*lj0 + v51*lj1 + v52*lj2 + v53*lj3 +
             v54*lj4 + v55*lj5 + v56*lj6;
         }
       }
diff --git a/src/USER-REAXC/fix_qeq_reax.cpp b/src/USER-REAXC/fix_qeq_reax.cpp
index ef98a87e91c48930800236ba1bb6e4b4a80f1c0c..98b929e9f39b75fbb964dbe681d5ccadc1a4d2c6 100644
--- a/src/USER-REAXC/fix_qeq_reax.cpp
+++ b/src/USER-REAXC/fix_qeq_reax.cpp
@@ -608,7 +608,7 @@ int FixQEqReax::CG( double *b, double *x )
 {
   int  i, j, imax;
   double tmp, alpha, beta, b_norm;
-  double sig_old, sig_new, sig0;
+  double sig_old, sig_new;
 
   imax = 200;
 
@@ -622,7 +622,6 @@ int FixQEqReax::CG( double *b, double *x )
 
   b_norm = parallel_norm( b, n );
   sig_new = parallel_dot( r, d, n );
-  sig0 = sig_new;
 
   for( i = 1; i < imax && sqrt(sig_new) / b_norm > tolerance; ++i ) {
     comm->forward_comm_fix(this); //Dist_vector( d );
diff --git a/src/USER-REAXC/fix_reaxc_species.cpp b/src/USER-REAXC/fix_reaxc_species.cpp
index 958ef0580370819efddbe0d56f8c3d1b58fd20b3..d488289411ca018111437511b242152afb7c58d5 100644
--- a/src/USER-REAXC/fix_reaxc_species.cpp
+++ b/src/USER-REAXC/fix_reaxc_species.cpp
@@ -486,17 +486,15 @@ AtomCoord chAnchor(AtomCoord in1, AtomCoord in2)
 
 void FixReaxCSpecies::FindMolecule ()
 {
-  int i,j,ii,jj,inum,jnum,n,itype,jtype,itag,jtag,loop,looptot;
+  int i,j,ii,jj,inum,itype,jtype,loop,looptot;
   int change,done,anychange;
   int *mask = atom->mask;
-  int *ilist, *jlist, *numneigh, **firstneigh;
+  int *ilist;
   double bo_tmp,bo_cut;
   double **spec_atom = f_SPECBOND->array_atom;
 
   inum = reaxc->list->inum;
   ilist = reaxc->list->ilist;
-  numneigh = reaxc->list->numneigh;
-  firstneigh = reaxc->list->firstneigh;
 
   for (ii = 0; ii < inum; ii++) {
     i = ilist[ii];
@@ -568,7 +566,7 @@ void FixReaxCSpecies::SortMolecule(int &Nmole)
   memory->destroy(molmap);
   molmap = NULL;
 
-  int m, n, idlo, idhi;
+  int n, idlo, idhi;
   int *mask =atom->mask;
   int lo = ntotal;
   int hi = -ntotal;
@@ -636,8 +634,7 @@ void FixReaxCSpecies::SortMolecule(int &Nmole)
 
 void FixReaxCSpecies::FindSpecies(int Nmole, int &Nspec)
 {
-  int inum, *ilist;
-  int i, j, k, l, m, n, itype, cid;
+  int k, l, m, n, itype, cid;
   int flag_identity, flag_mol, flag_spec;
   int flag_tmp;
   int *mask =atom->mask;
diff --git a/src/USER-REAXC/reaxc_bond_orders.cpp b/src/USER-REAXC/reaxc_bond_orders.cpp
index cffbb4572316687b23c25999e0553531df8a5523..6f37d91c9cfafa30b52f62853eaac8651da75756 100644
--- a/src/USER-REAXC/reaxc_bond_orders.cpp
+++ b/src/USER-REAXC/reaxc_bond_orders.cpp
@@ -804,7 +804,7 @@ void BO( reax_system *system, control_params *control, simulation_data *data,
          storage *workspace, reax_list **lists, output_controls *out_control )
 {
   int i, j, pj, type_i, type_j;
-  int start_i, end_i, sym_index, num_bonds;
+  int start_i, end_i, sym_index;
   real val_i, Deltap_i, Deltap_boc_i;
   real val_j, Deltap_j, Deltap_boc_j;
   real f1, f2, f3, f4, f5, f4f5, exp_f4, exp_f5;
@@ -833,7 +833,6 @@ void BO( reax_system *system, control_params *control, simulation_data *data,
   //   Num_Entries(i, bonds), sizeof(bond_data), compare_bonds );
 #endif
 
-  num_bonds = 0;
   p_boc1 = system->reax_param.gp.l[0];
   p_boc2 = system->reax_param.gp.l[1];
 
@@ -1172,20 +1171,9 @@ void BO( reax_system *system, control_params *control, simulation_data *data,
       workspace->Delta_lp_temp[j] = sbp_j->nlp_opt - workspace->nlp_temp[j];
       workspace->dDelta_lp_temp[j] = workspace->Clp[j];
     }
-
-    //fprintf( stderr, "%d\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\n",
-    //j, workspace->Delta[j], workspace->Delta_e[j], workspace->Delta_boc[j],
-    //workspace->nlp[j], system->reaxprm.sbp[type_j].nlp_opt,
-    //workspace->Delta_lp[j], workspace->Clp[j], workspace->dDelta_lp[j] );
-
-    //fprintf( stdout, "%d(%d) %24.15f\n",
-    //     j, workspace->bond_mark[j], workspace->total_bond_order[j] );
   }
 
-  //Print_Bonds( system, bonds, "pbonds.out" );
-
 #if defined(TEST_ENERGIES) || defined(TEST_FORCES)
-  fprintf( stderr, "Number of bonds: %d\n", num_bonds );
   Print_Bond_List( system, control, data, lists, out_control);
 #endif
 }
diff --git a/src/USER-REAXC/reaxc_lookup.cpp b/src/USER-REAXC/reaxc_lookup.cpp
index aa7b069afaac0049d843660f5b7d38ce48d15122..48a6c19aa5da654efcac2d78a7caef7777a70ae0 100644
--- a/src/USER-REAXC/reaxc_lookup.cpp
+++ b/src/USER-REAXC/reaxc_lookup.cpp
@@ -237,10 +237,10 @@ int Init_Lookup_Tables( reax_system *system, control_params *control,
 
   /* fill in the lookup table entries for existing atom types.
      only lower half should be enough. */
-  for( i = 0; i < num_atom_types; ++i )
-    if( aggregated[i] )
+  for( i = 0; i < num_atom_types; ++i ) {
+    if( aggregated[i] ) {
       //for( j = 0; j < num_atom_types; ++j )
-      for( j = i; j < num_atom_types; ++j )
+      for( j = i; j < num_atom_types; ++j ) {
         if( aggregated[j] ) {
           LR[i][j].xmin = 0;
           LR[i][j].xmax = control->nonb_cut;
@@ -305,11 +305,12 @@ int Init_Lookup_Tables( reax_system *system, control_params *control,
           Natural_Cubic_Spline( &h[1], &fCEclmb[1],
                                 &(LR[i][j].CEclmb[1]), control->tabulate+1,
                                 comm );
-        }
-        else{
+        } else{
           LR[i][j].n = 0;
         }
-
+      }
+    }
+  }
   free(h);
   free(fh);
   free(fvdw);
diff --git a/src/USER-REAXC/reaxc_multi_body.cpp b/src/USER-REAXC/reaxc_multi_body.cpp
index 4932a79b998e1b625ca27b341d40008fb996d607..4744aba38c434bc783fc43003c08db161061396e 100644
--- a/src/USER-REAXC/reaxc_multi_body.cpp
+++ b/src/USER-REAXC/reaxc_multi_body.cpp
@@ -51,18 +51,17 @@ void Atom_Energy( reax_system *system, control_params *control,
   real exp_ovun2n, exp_ovun6, exp_ovun8;
   real inv_exp_ovun1, inv_exp_ovun2, inv_exp_ovun2n, inv_exp_ovun8;
   real e_un, CEunder1, CEunder2, CEunder3, CEunder4;
-  real p_lp1, p_lp2, p_lp3;
+  real p_lp2, p_lp3;
   real p_ovun2, p_ovun3, p_ovun4, p_ovun5, p_ovun6, p_ovun7, p_ovun8;
-  real eng_tmp, f_tmp;
+  real eng_tmp;
 
-  single_body_parameters *sbp_i, *sbp_j;
+  single_body_parameters *sbp_i;
   two_body_parameters *twbp;
   bond_data *pbond;
   bond_order_data *bo_ij;
   reax_list *bonds = (*lists) + BONDS;
 
   /* Initialize parameters */
-  p_lp1 = system->reax_param.gp.l[15];
   p_lp3 = system->reax_param.gp.l[5];
   p_ovun3 = system->reax_param.gp.l[32];
   p_ovun4 = system->reax_param.gp.l[31];
@@ -161,7 +160,6 @@ void Atom_Energy( reax_system *system, control_params *control,
         j = bonds->select.bond_list[pj].nbr;
         type_j = system->my_atoms[j].type;
         bo_ij = &(bonds->select.bond_list[pj].bo_data);
-        sbp_j = &(system->reax_param.sbp[ type_j ]);
         twbp = &(system->reax_param.tbp[ type_i ][ type_j ]);
 
         sum_ovun1 += twbp->p_ovun1 * twbp->De_s * bo_ij->BO;
@@ -221,7 +219,6 @@ void Atom_Energy( reax_system *system, control_params *control,
     /* tally into per-atom energy */
     if( system->pair_ptr->evflag) {
       eng_tmp = e_ov + e_un;
-      f_tmp = CEover3 + CEunder3;
       system->pair_ptr->ev_tally(i,i,system->n,1,eng_tmp,0.0,0.0,0.0,0.0,0.0);
     }
 
diff --git a/src/USER-REAXC/reaxc_traj.cpp b/src/USER-REAXC/reaxc_traj.cpp
index 8fbd26217fc5c8a154faa36a99a69a5b1f23aab5..e74cb4ef5280a28678d6a2febb903b8725e0d5d1 100644
--- a/src/USER-REAXC/reaxc_traj.cpp
+++ b/src/USER-REAXC/reaxc_traj.cpp
@@ -131,7 +131,6 @@ int Write_Header( reax_system *system, control_params *control,
                   output_controls *out_control, mpi_datatypes *mpi_data )
 {
   int  num_hdr_lines, my_hdr_lines, buffer_req;
-  MPI_Status status;
   char ensembles[ens_N][25] =  { "NVE", "NVT", "fully flexible NPT",
                                  "semi isotropic NPT", "isotropic NPT" };
   char reposition[3][25] = { "fit to periodic box", "CoM to center of box",
@@ -339,7 +338,7 @@ int Write_Header( reax_system *system, control_params *control,
                             mpi_data->world, system->my_rank,
                             my_hdr_lines, num_hdr_lines );
     MPI_File_write_all( out_control->trj, out_control->buffer,
-                        num_hdr_lines, mpi_data->header_line, &status );
+                        num_hdr_lines, mpi_data->header_line, MPI_STATUS_IGNORE );
     out_control->trj_offset = (num_hdr_lines) * HEADER_LINE_LEN;
   }
   else {
@@ -549,7 +548,6 @@ int Write_Frame_Header( reax_system *system, control_params *control,
                         mpi_datatypes *mpi_data )
 {
   int me, num_frm_hdr_lines, my_frm_hdr_lines, buffer_req;
-  MPI_Status status;
 
   me = system->my_rank;
   /* frame header lengths */
@@ -670,7 +668,7 @@ int Write_Frame_Header( reax_system *system, control_params *control,
                             me, my_frm_hdr_lines, num_frm_hdr_lines );
 
     MPI_File_write_all(out_control->trj, out_control->buffer, my_frm_hdr_lines,
-                       mpi_data->header_line, &status);
+                       mpi_data->header_line, MPI_STATUS_IGNORE);
     out_control->trj_offset += (num_frm_hdr_lines) * HEADER_LINE_LEN;
   }
   else {
diff --git a/src/USER-SPH/atom_vec_meso.cpp b/src/USER-SPH/atom_vec_meso.cpp
index bca14645d5964a1fca2980f7b3ed49bbabbe8715..808595bb35918a838ce899a1c954c4da1f5d200f 100644
--- a/src/USER-SPH/atom_vec_meso.cpp
+++ b/src/USER-SPH/atom_vec_meso.cpp
@@ -475,7 +475,7 @@ int AtomVecMeso::pack_border_vel(int n, int *list, double *buf, int pbc_flag,
                                  int *pbc)
 {
   int i,j,m;
-  double dx,dy,dz,dvx,dvy,dvz;
+  double dx,dy,dz;
 
   m = 0;
   if (pbc_flag == 0) {
@@ -527,9 +527,6 @@ int AtomVecMeso::pack_border_vel(int n, int *list, double *buf, int pbc_flag,
         buf[m++] = vest[j][2];
       }
     } else {
-      dvx = pbc[0]*h_rate[0] + pbc[5]*h_rate[5] + pbc[4]*h_rate[4];
-      dvy = pbc[1]*h_rate[1] + pbc[3]*h_rate[3];
-      dvz = pbc[2]*h_rate[2];
       for (i = 0; i < n; i++) {
         j = list[i];
         buf[m++] = x[j][0] + dx;
diff --git a/src/USER-SPH/pair_sph_rhosum.cpp b/src/USER-SPH/pair_sph_rhosum.cpp
index e1a77c5d7ad4a9f409d64fc39300289b407f6e02..678ad1bcd457d06869241cb042e8c691d5653622 100644
--- a/src/USER-SPH/pair_sph_rhosum.cpp
+++ b/src/USER-SPH/pair_sph_rhosum.cpp
@@ -66,7 +66,7 @@ void PairSPHRhoSum::init_style() {
 void PairSPHRhoSum::compute(int eflag, int vflag) {
   int i, j, ii, jj, jnum, itype, jtype;
   double xtmp, ytmp, ztmp, delx, dely, delz;
-  double r, rsq, imass, h, ih, ihsq;
+  double rsq, imass, h, ih, ihsq;
   int *jlist;
   double wf;
   // neighbor list variables
diff --git a/src/VORONOI/compute_voronoi_atom.cpp b/src/VORONOI/compute_voronoi_atom.cpp
index c8868ce5118a92906fca223f7e0b2669270de313..535532d0c83bd8ec6b650f0f74ae1f5b1b5a48db 100644
--- a/src/VORONOI/compute_voronoi_atom.cpp
+++ b/src/VORONOI/compute_voronoi_atom.cpp
@@ -227,12 +227,6 @@ void ComputeVoronoi::buildCells()
   // setup bounds for voro++ domain for orthogonal and triclinic simulation boxes
   if( domain->triclinic ) {
     // triclinic box: embed parallelepiped into orthogonal voro++ domain
-    double mx, my, sxy,sxz,syz;
-    mx = (boxhi[0]-boxlo[0])/(subhi[0]-sublo[0]);
-    my = (boxhi[1]-boxlo[1])/(subhi[1]-sublo[1]);
-    sxy = domain->xy/mx;
-    sxz = domain->xz/mx;
-    syz = domain->yz/my;
 
     // cutghost is in lamda coordinates for triclinic boxes, use subxx_lamda
     double *h = domain->h, cuttri[3];
diff --git a/src/XTC/dump_xtc.cpp b/src/XTC/dump_xtc.cpp
index f7c2f8ec0a2179262af1c39cf6a308426a1388e9..cd86e2dbacf39ab10b98418736f1f7514f31fdcf 100644
--- a/src/XTC/dump_xtc.cpp
+++ b/src/XTC/dump_xtc.cpp
@@ -360,7 +360,7 @@ static int *buf = NULL;
 static int magicints[] = {
   0, 0, 0, 0, 0, 0, 0, 0, 0,
   8, 10, 12, 16, 20, 25, 32, 40, 50, 64,
-  80, 101, 128, 161, 203, 256, 322, 406, IMGMAX, 645,
+  80, 101, 128, 161, 203, 256, 322, 406, 512, 645,
   812, 1024, 1290, 1625, 2048, 2580, 3250, 4096, 5060, 6501,
   8192, 10321, 13003, 16384, 20642, 26007, 32768, 41285, 52015, 65536,
   82570, 104031, 131072, 165140, 208063, 262144, 330280, 416127,
@@ -371,7 +371,7 @@ static int magicints[] = {
 
 #define FIRSTIDX 9
 /* note that magicints[FIRSTIDX-1] == 0 */
-#define LASTIDX (sizeof(magicints) / sizeof(*magicints))
+#define LASTIDX (sizeof(magicints) / sizeof(int) - 1 )
 
 /*__________________________________________________________________________
  |
diff --git a/src/delete_bonds.cpp b/src/delete_bonds.cpp
index e8a5809fe701564c2df6cfb9da5fc15cfb051509..6b139b29f9eb5fd30c31b2eceb4504b9d060a792 100644
--- a/src/delete_bonds.cpp
+++ b/src/delete_bonds.cpp
@@ -63,7 +63,7 @@ void DeleteBonds::command(int narg, char **arg)
 
   // set style and which = type value
 
-  int style;
+  int style = -1;
   if (strcmp(arg[1],"multi") == 0) style = MULTI;
   else if (strcmp(arg[1],"atom") == 0) style = ATOM;
   else if (strcmp(arg[1],"bond") == 0) style = BOND;
diff --git a/src/dump_cfg.cpp b/src/dump_cfg.cpp
index 5b74642fe6270c1e58dd41af8e93b8b9d4d11a70..b1acae791b60a10dd23a7d03781282c3748b2f7d 100755
--- a/src/dump_cfg.cpp
+++ b/src/dump_cfg.cpp
@@ -44,6 +44,8 @@ enum{INT,DOUBLE,STRING,BIGINT};   // same as in DumpCustom
 DumpCFG::DumpCFG(LAMMPS *lmp, int narg, char **arg) :
   DumpCustom(lmp, narg, arg)
 {
+  multifile_override = 0;
+
   if (narg < 10 ||
       strcmp(arg[5],"mass") != 0 || strcmp(arg[6],"type") != 0 ||
       (strcmp(arg[7],"xs") != 0 && strcmp(arg[7],"xsu") != 0) ||
@@ -115,7 +117,7 @@ DumpCFG::~DumpCFG()
 
 void DumpCFG::init_style()
 {
-  if (multifile == 0) 
+  if (multifile == 0 && !multifile_override)
     error->all(FLERR,"Dump cfg requires one snapshot per file");
 
   DumpCustom::init_style();
diff --git a/src/dump_cfg.h b/src/dump_cfg.h
index 485b312b39f72e91e5a7e67a38c9a8fe290317e2..9ebcfc0b70af802de35221fdc1b6bf841b765fab 100755
--- a/src/dump_cfg.h
+++ b/src/dump_cfg.h
@@ -26,6 +26,8 @@ namespace LAMMPS_NS {
 
 class DumpCFG : public DumpCustom {
  public:
+  int multifile_override;          // used by write_dump command
+
   DumpCFG(class LAMMPS *, int, char **);
   virtual ~DumpCFG();